On Fri, 24 Aug 2012, Joe Mason wrote:

If this seems to be the problem you're having, try the attached patch.

Thanks. I just tried it and it still fails. I think in my case the first failure is really fast.

I added a few fprintf() outputs to the test code, see the attached patch. With that applied I ran the test, it failed and log/stderr2032 looked like this:

URL: http://127.0.0.1:8990/2032
* About to connect() to 127.0.0.1 port 8990 (#0)
*   Trying 127.0.0.1...
* connected
* Connected to 127.0.0.1 (127.0.0.1) port 8990 (#0)
* 0x490c40c is at send pipe head!
* STATE: CONNECT => DO handle 0x49209a4; (connection #0)
* Server auth using Basic with user 'testuser'
GET /20320100 HTTP/1.1
Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
Host: 127.0.0.1:8990
Accept: */*

* STATE: DO => DO_DONE handle 0x49209a4; (connection #0)
* STATE: DO_DONE => WAITPERFORM handle 0x49209a4; (connection #0)
* STATE: WAITPERFORM => PERFORM handle 0x49209a4; (connection #0)
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 401 Need Basic or NTLM auth
< Server: Microsoft-IIS/5.0
< Content-Type: text/html; charset=iso-8859-1
< Content-Length: 29
< WWW-Authenticate: NTLM
* Authentication problem. Ignoring this.
< WWW-Authenticate: Basic realm="testrealm"
<
* STATE: PERFORM => DONE handle 0x49209a4; (connection #0)
* Connection #0 to host 127.0.0.1 left intact
libntlmconnect.c:139 running 0
* Expire cleared

See line 139, running is 0 so the code aborts immediately afterwards, and num_handles is only 1 at that point.

--

 / daniel.haxx.se
diff --git a/tests/libtest/libntlmconnect.c b/tests/libtest/libntlmconnect.c
index 3ed1aa3..ee8728a 100644
--- a/tests/libtest/libntlmconnect.c
+++ b/tests/libtest/libntlmconnect.c
@@ -136,6 +136,8 @@ int test(char *url)
 
     abort_on_test_timeout();
 
+    fprintf(stderr, "%s:%d running %d\n", __FILE__, __LINE__, running);
+
     if(!running)
       break; /* done */
 
@@ -180,12 +182,14 @@ int test(char *url)
         fprintf(stderr, "Handle %d wrote to socket %d then detected on %d\n",
                 num_handles-1, sockets[num_handles-1], i);
         res = TEST_ERR_MAJOR_BAD;
+        fprintf(stderr, "%s:%d running %d\n", __FILE__, __LINE__, running);
         goto test_cleanup;
       }
       else {
         sockets[num_handles-1] = i;
         found_new_socket = TRUE;
         /* continue to make sure there's only one new handle */
+        fprintf(stderr, "%s:%d running %d\n", __FILE__, __LINE__, running);
       }
     }
 
@@ -214,6 +218,7 @@ int test(char *url)
 
     select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &interval);
 
+    fprintf(stderr, "%s:%d running %d\n", __FILE__, __LINE__, running);
     abort_on_test_timeout();
   }
 
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to