Arno Garrels wrote: > Frans van Daalen wrote: >>>> Update : Seems there are still scenario's where the problem returns >>>> also sometimes the proxy settings are lost creating a 407 when a >>>> relocation happens. Seems to happen when executing a GetAsync and a >>>> relocate is triggered (with follow relocation set) >>> >>> Thanks for the report. That's probably because SetReady is skipped >>> with it's code related to proxy and www-authentication :( >>> The HTTP component is a TRUE beast. >> >> Yes, it is! Is there not something like a full-blown http test tool >> which we can run against it and then start rewriting some parts to >> get it back in it's cage ? I found several on the web but have no >> idea if it has ever been used for THttpcli >> >> Can you locate that setready skipping somewhere? > > My suggested fix did skip SetReady when FLocationFlag was set, it has > to be removed. I have a new idea: > in procedure THttpCli.StateChange(NewState : THttpState); > try call TriggerRequestDone only when FLocationFlag is not set. > However that might also lead to other side-effects I'm currently not > aware of, it worked with and without proxy connection in a brief test.
That works for me as long as the proxy connection keeps alive after a 301/302. Otherwise it helps to clear the AuthStates in procedure THttpCli.LocationSessionClosed. {$IFDEF UseNTLMAuthentication} FAuthNTLMState := ntlmNone; FProxyAuthNTLMState := ntlmNone; {$ENDIF} {$IFDEF UseDigestAuthentication} FAuthDigestState := digestNone; FProxyAuthDigestState := digestNone; {$ENDIF} FAuthBasicState := BasicNone; FProxyAuthBasicState := BasicNone; -- Arno Garrels > >> I have been >> maintenace programmer for a long time so used to reading others code >> but this one is hard to read and understand. > > Tracing and debugging is a problem when there's not much on the call > stack as with the THttpCli where many events are triggered by posting > messages instead of calling event handlers directly. > > -- > Arno Garrels -- 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