]> git.pld-linux.org Git - packages/mon.git/commitdiff
- properly handle multiline replies after quit command
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 29 Jan 2006 14:20:20 +0000 (14:20 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    mon-ftp.patch -> 1.1

mon-ftp.patch [new file with mode: 0644]

diff --git a/mon-ftp.patch b/mon-ftp.patch
new file mode 100644 (file)
index 0000000..8a37a99
--- /dev/null
@@ -0,0 +1,28 @@
+diff -urN mon-1.1.0pre1.org/mon.d/ftp.monitor mon-1.1.0pre1/mon.d/ftp.monitor
+--- mon-1.1.0pre1.org/mon.d/ftp.monitor        2004-06-09 07:18:05.000000000 +0200
++++ mon-1.1.0pre1/mon.d/ftp.monitor    2006-01-29 15:19:39.406145500 +0100
+@@ -171,14 +171,16 @@
+       print S "quit\r\n";
+       $result->{"detail"} .= "    > quit\n";
+-      $in = <S>;
+-      $result->{"detail"} .= "    < $in";
+-      if ($in !~ /^221 /) {
+-          alarm 0;
+-          $result->{"ok"} = 0;
+-          $result->{"error"} = "FTP server error after quit";
+-          close(S);
+-          return undef;
++      while ($in = <S>) {
++              $result->{"detail"} .= "    < $in";
++              next if ($in =~ /^[0-9]{3}\-/);
++              if ($in !~ /^221 /) {
++                      alarm 0;
++                      $result->{"ok"} = 0;
++                      $result->{"error"} = "FTP server error after quit";
++                      close(S);
++                      return undef;
++              }
+       }
+       close(S);
This page took 0.103805 seconds and 4 git commands to generate.