>> During the process, netlib calls OnStartRequest(), but somehow knows >> not to call OnDataAvailable() and OnStopRequest(), which I can't quite >> understand. > > No, it doesn't call any of those. OnStartRequest is only called for the > final channel (that's the intent, anyway).
nsHttpChannel::OnStartRequest seems to be called always when data is received. Why only the last channel? > ProcessRedirection sets mListener to null, so OnDataAvailable and > OnStopRequest won't call them on the listener. mListener is an instance of the nsIStreamListener interface. Is this usually implemented thgrough the same class in this case? If yes, which one? For example, nsHttpChannel implements nsIStreamListener, but obviously mListeners is no an object of nsHttpChannel. Hm, I also set mListener but nsHttpChannel::OnDataAvailable and nsHttpChannel::OnStopRequest still get called. My statements have the same order as in ProcessRedirect(): AsyncOpen() on the new channel Cancel(NS_BINDING_REDIRECTED) --> to cancel the current one mListener = 0; mListenerContext = 0; ... return NS_OK nsHttpChannel::OnDataAvailable() and nsHttpChannel::OnStopRequest() still get called. Thanks, Peter _______________________________________________ dev-tech-network mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-network
