I did not fully understand what you said but here is what I found: In my code the POST with NTLM, the order of execution is normally as:
ConnectionDataAvailable ProcessRequest ProcessPost ConnectionDataAvailable (to receive the data fully and throw away while counting its length, when contentLength <= postedDataLen proceed) Answer401 ConnectionDataSentErrorPages (first Send in Answer401) ConnectionDataSentErrorPages (the event fired) Process Request ProcessPost ... this was the working order. Sometimes due to events, it works a bit strange: ConnectionDataAvailable ProcessRequest ProcessPost ConnectionDataAvailable (to receive the data fully and throw away while counting its length, when contentLength <= postedDataLen proceed) Answer401 ConnectionDataSentErrorPages (first Send in Answer401) ConnectionDataAvailable (ABNORMALLY READS THE NEXT REQUEST HEADER AND SOMETIMES EVEN DATA!!!) ConnectionDataSentErrorPages (the event fired) Process Request (MESSED UP HERE!!) ProcessPost ... Do you have any suggestion to Pause only data reception and not send in TWSocket? That's what comes to my mind! Best Regards, SZ ----- Original Message ----- From: "Stadin, Benjamin" <[EMAIL PROTECTED]> To: <twsocket@elists.org> Sent: Friday, September 15, 2006 10:53 AM Subject: Re: [twsocket] THttpSrv supporting NTLM Beta (updated) : You can rely on the NTLM message size. You can retrieve the message partly, : write it to the context struct bytewise and when the full message is : received process it and do the next step. That should be better than : Receive(). : : : SZ wrote: : : 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 : -- : 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