aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2012-09-11 12:19:05 +0200
committerMarc Hoersken <info@marc-hoersken.de>2012-09-11 12:19:05 +0200
commitf9da9a0edbb982a125f050fb47f21880bc6cec6b (patch)
treec72803552d8c4a2e672ee8f0fe3dbc6ad8ea5b38
parent6372144be0aef3bb8aac5561941d986e1129f5ee (diff)
libntlmconnect.c: Fixed warning: curl_easy_getinfo expects long pointer
Fixed tests/libtest/libntlmconnect.c:52: warning: call to '_curl_easy_getinfo_err_long' declared with attribute warning: curl_easy_getinfo expects a pointer to long for this info
-rw-r--r--tests/libtest/libntlmconnect.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/libtest/libntlmconnect.c b/tests/libtest/libntlmconnect.c
index 0cfbdfe50..61b40ec31 100644
--- a/tests/libtest/libntlmconnect.c
+++ b/tests/libtest/libntlmconnect.c
@@ -42,6 +42,7 @@ static size_t callback(char* ptr, size_t size, size_t nmemb, void* data)
{
int idx = ((CURL **) data) - easy;
curl_socket_t sock;
+ long lastsock;
char *output = malloc(size * nmemb + 1);
memcpy(output, ptr, size * nmemb);
@@ -49,11 +50,17 @@ static size_t callback(char* ptr, size_t size, size_t nmemb, void* data)
fprintf(stdout, "%s", output);
free(output);
- res = curl_easy_getinfo(easy[idx], CURLINFO_LASTSOCKET, &sock);
+ res = curl_easy_getinfo(easy[idx], CURLINFO_LASTSOCKET, &lastsock);
if (CURLE_OK != res) {
fprintf(stderr, "Error reading CURLINFO_LASTSOCKET\n");
return 0;
}
+ if (lastsock == -1) {
+ sock = INVALID_SOCKET;
+ }
+ else {
+ sock = (curl_socket_t)lastsocket;
+ }
/* sock will only be set for NTLM requests; for others it is -1 */
if (sock != INVALID_SOCKET) {
if (sockets[idx] == INVALID_SOCKET) {