Maurizio Lotauro wrote: > Scrive Arno Garrels <[EMAIL PROTECTED]>: > >> DZ-Jay wrote: >> >>> we should try to replicate the behaviour in HttpCli: perhaps adding >>> a new machine state that instead of re-sending when 401 is >>> detected, it makes sure that the body has been sent completely, and >>> if not, it delays re-sending until it does. >> >> My attempt below works with the link Maurizio provided. Don't know >> whether it works with a proxy and/or NTLM etc. (forgot everything >> about it) so it's most likely buggy but might be worth testing and >> fixing it ;-) > > Unfortunately I'm still using an old version of HttpProt.pas (1.86), > and it seems different from yours, at least in the StateChange > procedure. Can you send your HttpProt.pas?
It's from Icsv7 but the snippets should match v6 as well. > > Are you sure about the SocketDataSent procedure? If len <=0 then the > SendStream has already reached the end. That's the intention, before the send stream is not sent we cannot put anything else into the send buffer. > And I would be very surprised > if FReqStream has a size > 0. It works in a simple test with the link you provided. Because of: procedure THttpCli.SendRequest(const Method, Version: String); [..] TriggerBeforeHeaderSend(Method, Headers); for N := 0 to Headers.Count - 1 do SendCommand(Headers[N]); TriggerRequestHeaderEnd; SendCommand(''); => if not FDelayRequest then begin FCtrlSocket.PutDataInSendBuffer(FReqStream.Memory, FReqStream.Size); FReqStream.Clear; FCtrlSocket.Send(nil, 0); => end; finally Headers.Free; [..] However all depends on the new flag FDelayRequest that might have to be set and cleared at different places in v5 or with NTLM or a proxy connection as well? It's not a fix so far but shows the principle of how the final fix can be implemented! -- Arno > > Bye, Maurizio. > > ---------------------------------------------------- > This mail has been sent using Alpikom webmail system > http://www.alpikom.it -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be