diff options
Diffstat (limited to 'tests/server')
-rw-r--r-- | tests/server/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tests/server/Makefile.am | 4 | ||||
-rw-r--r-- | tests/server/Makefile.inc | 2 | ||||
-rwxr-xr-x | tests/server/base64.pl | 2 | ||||
-rw-r--r-- | tests/server/disabled.c | 4 | ||||
-rw-r--r-- | tests/server/fake_ntlm.c | 2 | ||||
-rw-r--r-- | tests/server/getpart.c | 2 | ||||
-rw-r--r-- | tests/server/getpart.h | 2 | ||||
-rw-r--r-- | tests/server/mqttd.c | 9 | ||||
-rw-r--r-- | tests/server/resolve.c | 2 | ||||
-rw-r--r-- | tests/server/rtspd.c | 2 | ||||
-rw-r--r-- | tests/server/server_setup.h | 2 | ||||
-rw-r--r-- | tests/server/server_sockaddr.h | 2 | ||||
-rw-r--r-- | tests/server/sockfilt.c | 8 | ||||
-rw-r--r-- | tests/server/socksd.c | 2 | ||||
-rw-r--r-- | tests/server/sws.c | 2 | ||||
-rw-r--r-- | tests/server/testpart.c | 2 | ||||
-rw-r--r-- | tests/server/tftp.h | 2 | ||||
-rw-r--r-- | tests/server/tftpd.c | 15 | ||||
-rw-r--r-- | tests/server/util.c | 13 | ||||
-rw-r--r-- | tests/server/util.h | 2 |
21 files changed, 46 insertions, 37 deletions
diff --git a/tests/server/CMakeLists.txt b/tests/server/CMakeLists.txt index e07abf6fa..0c93efdaa 100644 --- a/tests/server/CMakeLists.txt +++ b/tests/server/CMakeLists.txt @@ -9,7 +9,7 @@ # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms -# are also available at https://curl.haxx.se/docs/copyright.html. +# are also available at https://curl.se/docs/copyright.html. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is diff --git a/tests/server/Makefile.am b/tests/server/Makefile.am index a5b98130c..3a89b5f33 100644 --- a/tests/server/Makefile.am +++ b/tests/server/Makefile.am @@ -5,11 +5,11 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. +# Copyright (C) 1998 - 2020, 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 -# are also available at https://curl.haxx.se/docs/copyright.html. +# are also available at https://curl.se/docs/copyright.html. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is diff --git a/tests/server/Makefile.inc b/tests/server/Makefile.inc index 55bc3a737..35d4dbaa1 100644 --- a/tests/server/Makefile.inc +++ b/tests/server/Makefile.inc @@ -9,7 +9,7 @@ # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms -# are also available at https://curl.haxx.se/docs/copyright.html. +# are also available at https://curl.se/docs/copyright.html. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is diff --git a/tests/server/base64.pl b/tests/server/base64.pl index d00673ec9..e1b88cf58 100755 --- a/tests/server/base64.pl +++ b/tests/server/base64.pl @@ -10,7 +10,7 @@ # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms -# are also available at https://curl.haxx.se/docs/copyright.html. +# are also available at https://curl.se/docs/copyright.html. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is diff --git a/tests/server/disabled.c b/tests/server/disabled.c index c82847d8e..0e862177d 100644 --- a/tests/server/disabled.c +++ b/tests/server/disabled.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, 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 - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/tests/server/fake_ntlm.c b/tests/server/fake_ntlm.c index c9211f7ea..ae281ca1c 100644 --- a/tests/server/fake_ntlm.c +++ b/tests/server/fake_ntlm.c @@ -10,7 +10,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/tests/server/getpart.c b/tests/server/getpart.c index 664d81569..483d37802 100644 --- a/tests/server/getpart.c +++ b/tests/server/getpart.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/tests/server/getpart.h b/tests/server/getpart.h index e8ddd22aa..211139205 100644 --- a/tests/server/getpart.h +++ b/tests/server/getpart.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/tests/server/mqttd.c b/tests/server/mqttd.c index 6785b0014..1f4344ac0 100644 --- a/tests/server/mqttd.c +++ b/tests/server/mqttd.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -486,6 +486,7 @@ static curl_socket_t mqttit(curl_socket_t fd) size_t bytes = 0; /* remaining length field size in bytes */ char client_id[MAX_CLIENT_ID_LENGTH]; long testno; + FILE *stream = NULL; static const char protocol[7] = { 0x00, 0x04, /* protocol length */ @@ -550,7 +551,6 @@ static curl_socket_t mqttit(curl_socket_t fd) } } else if(byte == MQTT_MSG_SUBSCRIBE) { - FILE *stream; int error; char *data; size_t datalen; @@ -636,7 +636,10 @@ static curl_socket_t mqttit(curl_socket_t fd) } while(1); end: - fclose(dump); + if(dump) + fclose(dump); + if(stream) + fclose(stream); return CURL_SOCKET_BAD; } diff --git a/tests/server/resolve.c b/tests/server/resolve.c index f72561879..6905b7e78 100644 --- a/tests/server/resolve.c +++ b/tests/server/resolve.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/tests/server/rtspd.c b/tests/server/rtspd.c index 6ee7787b1..39f6d1413 100644 --- a/tests/server/rtspd.c +++ b/tests/server/rtspd.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/tests/server/server_setup.h b/tests/server/server_setup.h index 1f2cef10c..e406a3d83 100644 --- a/tests/server/server_setup.h +++ b/tests/server/server_setup.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/tests/server/server_sockaddr.h b/tests/server/server_sockaddr.h index c3602e1cf..e72531179 100644 --- a/tests/server/server_sockaddr.h +++ b/tests/server/server_sockaddr.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index 6b3758c94..dd7ada09f 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -705,7 +705,7 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds, if(FD_ISSET(wsasock, writefds)) { FD_SET(wsasock, &writesock); - wsaevents.lNetworkEvents |= FD_WRITE|FD_CONNECT; + wsaevents.lNetworkEvents |= FD_WRITE|FD_CONNECT|FD_CLOSE; } if(FD_ISSET(wsasock, exceptfds)) { @@ -835,11 +835,11 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds, FD_CLR(wsasock, readfds); /* remove from descriptor set if not ready for write/connect */ - if(!(wsaevents.lNetworkEvents & (FD_WRITE|FD_CONNECT))) + if(!(wsaevents.lNetworkEvents & (FD_WRITE|FD_CONNECT|FD_CLOSE))) FD_CLR(wsasock, writefds); /* remove from descriptor set if not exceptional */ - if(!(wsaevents.lNetworkEvents & (FD_OOB))) + if(!(wsaevents.lNetworkEvents & FD_OOB)) FD_CLR(wsasock, exceptfds); } } diff --git a/tests/server/socksd.c b/tests/server/socksd.c index e6e9c12b0..e8b71bedf 100644 --- a/tests/server/socksd.c +++ b/tests/server/socksd.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/tests/server/sws.c b/tests/server/sws.c index b0f2a83d6..74dd3a778 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/tests/server/testpart.c b/tests/server/testpart.c index 9c295e0f5..1ea9c2004 100644 --- a/tests/server/testpart.c +++ b/tests/server/testpart.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/tests/server/tftp.h b/tests/server/tftp.h index 62a0cc35e..569967222 100644 --- a/tests/server/tftp.h +++ b/tests/server/tftp.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c index 4215bfe4a..92d584918 100644 --- a/tests/server/tftpd.c +++ b/tests/server/tftpd.c @@ -821,11 +821,6 @@ int main(int argc, char **argv) sclose(peer); peer = CURL_SOCKET_BAD; - if(test.ofile > 0) { - close(test.ofile); - test.ofile = 0; - } - if(got_exit_signal) break; @@ -1304,6 +1299,11 @@ send_ack: } } while(size == SEGSIZE); write_behind(test, pf->f_convert); + /* close the output file as early as possible after upload completion */ + if(test->ofile > 0) { + close(test->ofile); + test->ofile = 0; + } rap->th_opcode = htons((unsigned short)opcode_ACK); /* send the "final" ack */ @@ -1326,6 +1326,11 @@ send_ack: (void) swrite(peer, &ackbuf.storage[0], 4); /* resend final ack */ } abort: + /* make sure the output file is closed in case of abort */ + if(test->ofile > 0) { + close(test->ofile); + test->ofile = 0; + } return; } diff --git a/tests/server/util.c b/tests/server/util.c index dccce596b..bfd133cec 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -167,8 +167,8 @@ void win32_init(void) WORD wVersionRequested; WSADATA wsaData; int err; - wVersionRequested = MAKEWORD(USE_WINSOCK, USE_WINSOCK); + wVersionRequested = MAKEWORD(2, 2); err = WSAStartup(wVersionRequested, &wsaData); if(err != 0) { @@ -177,8 +177,8 @@ void win32_init(void) exit(1); } - if(LOBYTE(wsaData.wVersion) != USE_WINSOCK || - HIBYTE(wsaData.wVersion) != USE_WINSOCK) { + if(LOBYTE(wsaData.wVersion) != LOBYTE(wVersionRequested) || + HIBYTE(wsaData.wVersion) != HIBYTE(wVersionRequested) ) { WSACleanup(); perror("Winsock init failed"); logmsg("No suitable winsock.dll found -- aborting"); @@ -682,13 +682,14 @@ static DWORD WINAPI main_window_loop(LPVOID lpParameter) ZeroMemory(&wc, sizeof(wc)); wc.lpfnWndProc = (WNDPROC)main_window_proc; wc.hInstance = (HINSTANCE)lpParameter; - wc.lpszClassName = "MainWClass"; + wc.lpszClassName = TEXT("MainWClass"); if(!RegisterClass(&wc)) { perror("RegisterClass failed"); return (DWORD)-1; } - hidden_main_window = CreateWindowEx(0, "MainWClass", "Recv WM_CLOSE msg", + hidden_main_window = CreateWindowEx(0, TEXT("MainWClass"), + TEXT("Recv WM_CLOSE msg"), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, diff --git a/tests/server/util.h b/tests/server/util.h index 629539205..68473f28f 100644 --- a/tests/server/util.h +++ b/tests/server/util.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is |