aboutsummaryrefslogtreecommitdiff
path: root/tests/server/sockfilt.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2011-10-30 17:12:20 +0100
committerYang Tse <yangsita@gmail.com>2011-10-30 17:12:20 +0100
commit0b315c1cf1e356776033d551367bb3fe41e19ca4 (patch)
tree5ce9aea12bce58f1261b2eeb09e11bfbffb691c6 /tests/server/sockfilt.c
parente2928e1555f8eaca440259c7280d2963b12c15bb (diff)
FTP test server: fix server unresponsiveness
Some torture tests left FTP test server in an unresponsive state, resulting in torture tests that actually completed following unexpected code paths. Changes in this commit solely address this issue and some adjustments for ftpserver.pl logging relative to data channel establishment and tear down. Pending NODATACONN relative adjustments reserved for a further commit.
Diffstat (limited to 'tests/server/sockfilt.c')
-rw-r--r--tests/server/sockfilt.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c
index 90ce9d919..2731348ea 100644
--- a/tests/server/sockfilt.c
+++ b/tests/server/sockfilt.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -950,6 +950,7 @@ int main(int argc, char *argv[])
error = SOCKERRNO;
logmsg("Error creating socket: (%d) %s",
error, strerror(error));
+ write_stdout("FAIL\n", 5);
goto sockfilt_cleanup;
}
@@ -985,6 +986,7 @@ int main(int argc, char *argv[])
error = SOCKERRNO;
logmsg("Error connecting to port %hu: (%d) %s",
connectport, error, strerror(error));
+ write_stdout("FAIL\n", 5);
goto sockfilt_cleanup;
}
logmsg("====> Client connect");
@@ -993,8 +995,10 @@ int main(int argc, char *argv[])
else {
/* passive daemon style */
sock = sockdaemon(sock, &port);
- if(CURL_SOCKET_BAD == sock)
+ if(CURL_SOCKET_BAD == sock) {
+ write_stdout("FAIL\n", 5);
goto sockfilt_cleanup;
+ }
msgsock = CURL_SOCKET_BAD; /* no stream socket yet */
}
@@ -1006,8 +1010,10 @@ int main(int argc, char *argv[])
logmsg("Listening on port %hu", port);
wrotepidfile = write_pidfile(pidname);
- if(!wrotepidfile)
+ if(!wrotepidfile) {
+ write_stdout("FAIL\n", 5);
goto sockfilt_cleanup;
+ }
do {
juggle_again = juggle(&msgsock, sock, &mode);