1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-15 22:15:13 -05:00

tests: verify OPEN/CLOSESOCKETFUNCTION

Test 585: Fix opensocket return type, and avoid function name clash.
This commit is contained in:
Yang Tse 2011-05-19 22:28:28 +02:00
parent 5db30a1d8c
commit b578534508

View File

@ -27,9 +27,9 @@
int counter; int counter;
static int opensocket(void *clientp, static curl_socket_t tst_opensocket(void *clientp,
curlsocktype purpose, curlsocktype purpose,
struct curl_sockaddr *addr) struct curl_sockaddr *addr)
{ {
(void)clientp; (void)clientp;
(void)purpose; (void)purpose;
@ -37,7 +37,7 @@ static int opensocket(void *clientp,
return socket(addr->family, addr->socktype, addr->protocol); return socket(addr->family, addr->socktype, addr->protocol);
} }
static int closesocket(void *clientp, curl_socket_t sock) static int tst_closesocket(void *clientp, curl_socket_t sock)
{ {
(void)clientp; (void)clientp;
printf("[CLOSE] counter: %d\n", counter--); printf("[CLOSE] counter: %d\n", counter--);
@ -46,8 +46,8 @@ static int closesocket(void *clientp, curl_socket_t sock)
static void setupcallbacks(CURL *curl) static void setupcallbacks(CURL *curl)
{ {
curl_easy_setopt(curl, CURLOPT_OPENSOCKETFUNCTION, opensocket); curl_easy_setopt(curl, CURLOPT_OPENSOCKETFUNCTION, tst_opensocket);
curl_easy_setopt(curl, CURLOPT_CLOSESOCKETFUNCTION, closesocket); curl_easy_setopt(curl, CURLOPT_CLOSESOCKETFUNCTION, tst_closesocket);
counter = 0; counter = 0;
} }