Maurizio Lotauro wrote:
> This will work with Basic bu not with NTLM because (IIRC) the
> authentication phase is started by the server with the first 401.

Looks like sending body data must be delayed somehow, realy not

Maybe OnSendBegin is the right place:

SendRequest('POST', FRequestVer); 
if TriggerSendBeginEx then begin // New, same for PUT etc. returns TRUE by 
    FAllowedToSend := TRUE;
    SocketDataSent(FCtrlSocket, 0);

New event:
TOnSendBeginExEvent = procedure (Sender : TObject;
                                 var AllowSend: Boolean) of object;

In the event handler some wait loop (arrrgh!) that checks for state httpReady 
or timeout.

> Is there a way to empty the socket buffer?

Yes, CtrlSocket.DeleteBufferedData, but that will most likely 
come far too late, not reliable as well. 

To unsubscribe or change your settings for TWSocket mailing list
please goto
Visit our website at

Reply via email to