Because the 401 response could be sent before the POST data is fully here. 
The same applies to all POST routines--you cannot simply rely on packet 
boundaries--this is TCP! Here is my approach:

int ToPost = toBePostedDataLen - postedDataLen;

if(ToPost > 8192)

ToPost = 8192;

int Len = Receive(postedDataBuffer, ToPost);

postedDataLen += Len;



toBePostedDataLen is determined is basically FRequestContentLength64 which 
is 64-bit version of the same ICS variable. Also, IMO, all the ints such as 
contentlength should be tranformed to __int64 to support file sizes > 2GB!

Best Regards,

SZ

----- Original Message ----- 
From: "Fastream Technologies" <[EMAIL PROTECTED]>
To: "ICS support mailing" <twsocket@elists.org>
Sent: Friday, September 15, 2006 8:15 AM
Subject: Re: [twsocket] THttpSrv supporting NTLM Beta (updated)


:I debugged the code and this is the problem (client sending data before
: receiving 401). Here is my idea:
:
: In OnDataAvailable, instead of FRcvdLine = RecieveStr(); we need to count
: the number of bytes we receive and then pass to the hcRequest state
: (PostDataReceived()) after that!
:
: Regards,
:
: SZ
:
: ----- Original Message ----- 
: From: "Stadin, Benjamin" <[EMAIL PROTECTED]>
: To: <twsocket@elists.org>
: Sent: Thursday, September 14, 2006 9:13 PM
: Subject: Re: [twsocket] THttpSrv supporting NTLM Beta (updated)
:
:
:: Fastream Technologies schrieb:
:: >
:: > I see why I did not face this problem before with other auth methods:
:: > because they (basic + digest) send 401 response only once per 
connection
:: and
:: > the first request most probably is a GET. However, NTLM requires each
:: > request to have its own 401!
::
::
:: That would be strange, I don't think that's the real deal. Maybe it works
:: only because the connection is closed on 401? Check in your ethereal log
: if
:: the connection isn't closed when FF's status bar hangs.
::
:: -- 
:: To unsubscribe or change your settings for TWSocket mailing list
:: please goto http://www.elists.org/mailman/listinfo/twsocket
:: Visit our website at http://www.overbyte.be
:
: -- 
: To unsubscribe or change your settings for TWSocket mailing list
: please goto http://www.elists.org/mailman/listinfo/twsocket
: Visit our website at http://www.overbyte.be 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to