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