cURL / Mailing Lists / curl-library / Single Mail

curl-library

cURL fails to POST to NTLM protected IIS6 server when using ANY authentication with post size less t

From: Greg Morse <snatch_65_at_hotmail.com>
Date: Fri, 27 Jul 2007 15:17:24 -0700

This is a bug in 7.15.3 (non-Windows) and persists through 7.16.4 though much of the relevant code has changed.
 
Most involved/effected files: http.c, transfer.c, select.c.
 
When using CURLOPT_POSTFIELDS with data of size CURLOPT_POSTFIELDSIZE that is length than 1024 bytes (hardcoded small post value) while having CURLOPT_HTTPAUTH set to CURLAUTH_ANY and connecting to an IIS6 server that accepts NTLM, then cURL gets stuck in the function Transfer calling Curl_select/Curl_socket_ready and then Curl_readwrite which do nothing. It stays this way indefinetly. In Windows with version 7.15.3, Curl_select called select with all empty descriptors which would cause an error of WSAEINVAL which would cause Transfer to exit. When Transfer exits, cURL retries using a new/cached connection and all behaves well. When both the read and write descriptor are bad, Transfer should exit from the loop to handle this case. It seems due to the fixes in select.c and transfer.c that Windows may now have the same problem in current builds because of the new wait_ms function that handles EINVAL (it seems Windows relied on a bug to work properly in this case before). In non-Windows, poll/select will perform a sleep when no valid descriptors are passed and not throw an error. This allows it to loop infinitely.
 
I am looking to help resolve this problem so I would like to hear from some of the experts on this before I suggest some sort of fix - I am hoping others may have a different perspective to offer on this issue. Nonetheless it seems this is a long standing bug in the library that should be easy to reproduce based on the description provided if you have an IIS6 server available.
 
-Greg
_________________________________________________________________
PC Magazine’s 2007 editors’ choice for best web mail—award-winning Windows Live Hotmail.
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HMWL_mini_pcmag_0707
Received on 2007-07-28