Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Get response body for redirected requests

24 views
Skip to first unread message

Jan Odvarko

unread,
Nov 18, 2009, 10:14:42 AM11/18/09
to
This bug was originally reported here:
http://code.google.com/p/fbug/issues/detail?id=2434

The problem is to get response for requests that are being redirected.
Here is an example scenario:

1) Firefox loads page process1.php. It returns: "Process1->Process2"
and redirects to process2.php.

2) Firefox loads page process2.php. It returns: "Process2->Process3"
and redirects to process3.php.

3) Firefox loads page process3.php and it returns: "Process3 Finish!"

I am using nsITraceableChannel to register a nsIStreamListner every
time the on-http-examine-response event is received (three times in
this case). But it seems that the same http channel is reused for all
three requests and so, I am getting only "Process3 Finish!" in all
three stream-listeners.

Is it possible to get even "Process1->Process2" and "Process2-
>Process3" responses, which I can see in Wireshark?

Honza

Boris Zbarsky

unread,
Nov 18, 2009, 10:19:13 AM11/18/09
to
On 11/18/09 10:14 AM, Jan Odvarko wrote:
> But it seems that the same http channel is reused for all
> three requests

That is not in fact the case. There's a new channel for each redirect,
but each new channel gets the listener from the previous channel (since
that's where the data needs to go in the end from the final channel).

Response bodies from redirects are not generally passed on to the necko
consumer unless the redirect fails, just like the consumer doesn't get
OnStartRequest/OnStopRequest for redirects.

> Is it possible to get even "Process1->Process2" and "Process2-
>> Process3" responses, which I can see in Wireshark?

Not without changing necko in some way.

-Boris

Jan Odvarko

unread,
Nov 18, 2009, 10:57:27 AM11/18/09
to
> Not without changing necko in some way.
I see. I have created a new ticket for this
https://bugzilla.mozilla.org/show_bug.cgi?id=529536

Honza

0 new messages