]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: log "Throwing away" messages before throwing away
authorDan Fandrich <dan@coneharvesters.com>
Mon, 3 Jun 2024 20:25:29 +0000 (13:25 -0700)
committerDan Fandrich <dan@coneharvesters.com>
Tue, 4 Jun 2024 00:00:42 +0000 (17:00 -0700)
In case the read that follows hangs we'll get a clue as to what it was
doing.

tests/ftpserver.pl
tests/server/sockfilt.c

index 10abe418c23d056fd7c75cf0398fb39cc5935ff7..282121d69d079a8c9cf84102b6431c958f93fdfb 100755 (executable)
@@ -670,7 +670,7 @@ sub protocolsetup {
     }
 }
 
-# Perform the disconnecgt handshake with sockfilt on the secondary connection
+# Perform the disconnect handshake with sockfilt on the secondary connection
 # (the only connection we actively disconnect).
 # This involves waiting for the disconnect acknowledgment after the DISC
 # command, while throwing away anything else that might come in before
@@ -690,9 +690,8 @@ sub disc_handshake {
                 $size = hex($1);
             }
 
-            read_datasockf(\$line, $size);
-
             logmsg "> Throwing away $size bytes on closed connection\n";
+            read_datasockf(\$line, $size);
         }
         elsif($line eq "DISC\n") {
             logmsg "Fancy that; client wants to DISC, too\n";
index 8d9d13b4f47555d9dbe8ef63572d279f9784c9a2..0e31dfcd4dbffaa87c1917f0c3546c2956482fd8 100644 (file)
@@ -921,11 +921,10 @@ static bool disc_handshake(void)
       }
       else if(!memcmp("DATA", buffer, 4)) {
         /* We must read more data to stay in sync */
+        logmsg("Throwing away %zd data bytes", buffer_len);
         if(!read_data_block(buffer, sizeof(buffer), &buffer_len))
           return FALSE;
 
-        logmsg("Throwing again %zd data bytes", buffer_len);
-
       }
       else if(!memcmp("QUIT", buffer, 4)) {
         /* just die */