From: Dan Fandrich Date: Mon, 3 Jun 2024 20:25:29 +0000 (-0700) Subject: tests: log "Throwing away" messages before throwing away X-Git-Tag: curl-8_9_0~312 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bc21c505e4d625df38e2f584ac1b7f6d9b923543;p=thirdparty%2Fcurl.git tests: log "Throwing away" messages before throwing away In case the read that follows hangs we'll get a clue as to what it was doing. --- diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl index 10abe418c2..282121d69d 100755 --- a/tests/ftpserver.pl +++ b/tests/ftpserver.pl @@ -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"; diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index 8d9d13b4f4..0e31dfcd4d 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -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 */