Closed
Bug 27119
Opened 25 years ago
Closed 22 years ago
http log traffic and headers
Categories
(Core :: Networking: HTTP, enhancement, P3)
Core
Networking: HTTP
Tracking
()
VERIFIED
WORKSFORME
Future
People
(Reporter: dougt, Assigned: darin.moz)
References
Details
We should add this to some sort of debugging log file.
From Steve's document:
To print out http headers, add the following to the SetHeader
methods in nsHTTPRequest.cpp and nsHTTPResponse.cpp
NS_METHOD
nsHTTPRequest::SetHeader(nsIAtom* i_Header, const char* i_Value)
{
/* display headers as they get set */
nsString atom;
i_Header->ToString(atom);
char* s = atom.ToNewCString();
printf("-----REQUEST: <%s> <%s>\n",s, i_Value);
return mHeaders.SetHeader(i_Header, i_Value);
}
nsresult nsHTTPResponse::SetHeader(nsIAtom* i_Header, const char* i_Value)
{
/* display headers as they get set */
nsString atom;
i_Header->ToString(atom);
char* s = atom.ToNewCString();
printf("-----RESPONSE: <%s> <%s>\n",s, i_Value);
return mHeaders.SetHeader(i_Header, i_Value);
}
To print out the raw traffic received by the browser, add the following print
statements:
1. mozilla/netwerk/protocol/http/src
nsHTTPResponseListener.cpp after the call to ReadSegment in ParseStatusLine:
printf("*** status = %s\n", mHeaderBuffer.GetBuffer());
2. mozilla/netwerk/protocol/http/src
nsHTTPResponseListener.cpp after the call to ReadSegment in
ParseHTTPHeader():
printf("*** header = %s\n", mHeaderBuffer.GetBuffer());
3. mozilla/netwerk/streamconv/Converters
nsMultiMixedConv.cpp after the call to inStr->Read in OnDataAvailable():
printf("*** multipart=%s\n", buffer);
To print out the raw traffic send by the browser, add the following print
statement:
1. mozilla/netwerk/protocol/http/src
nsHTTPRequest.cpp just before return in nsHTTPRequest::WriteRequest
printf("~~~%s",mRequestBuffer.GetBuffer());
Reporter | ||
Updated•25 years ago
|
Target Milestone: M17
Comment 2•25 years ago
|
||
Moving post beta bugs to M18 which is now the post-beta milestone.
Target Milestone: M17 → M18
note that you can switch on HTTP logging by-
set NSPR_LOG_MODULES=nsHTTPProtocol:5
set NSPR_LOG_FILE=http.log
Severity: normal → enhancement
Component: Networking → Networking: HTTP
Summary: Make http log traffic and headers → [RFE] http log traffic and headers
Comment 6•24 years ago
|
||
in why build does the
set NSPR_LOG_MODULES=nsHTTPProtocol:5
set NSPR_LOG_FILE=http.log
work?
if you download a normal installer build it doesn't work.
Comment 7•23 years ago
|
||
*** Bug 112389 has been marked as a duplicate of this bug. ***
Comment 8•23 years ago
|
||
*** Bug 119883 has been marked as a duplicate of this bug. ***
Summary: [RFE] http log traffic and headers → http log traffic and headers
Comment 9•22 years ago
|
||
*** Bug 175830 has been marked as a duplicate of this bug. ***
Comment 10•22 years ago
|
||
*** Bug 175830 has been marked as a duplicate of this bug. ***
Comment 11•22 years ago
|
||
Not sure if this warrants another enhancement request, but I would personally
like to see this functionality in the non-debug releases, maybe as a supplement
to the View Source for a given page. I'd like to be able to see the HTTP
requests and responses for a given page (or resource, whatever).
I don't need this information to debug my browser, but to debug my web site.
Sometimes it's useful to be able to see exactly what character set it's
returning, or any of the other HTTP headers that aren't expressed through some
other dialog in the browser. Presently the only way I can do this today is by
sending raw HTTP over a telnet connection.
Comment 12•22 years ago
|
||
I remember this being covered by another bug somewhere...
Assignee | ||
Comment 13•22 years ago
|
||
set these environment variables before running mozilla (debug or nightly build):
NSPR_LOG_MODULES=nsHttp:2
NSPR_LOG_FILE=c:\http.log
and you will get a stream of request/response headers dumped in c:\http.log. (i
usually set these in a DOS prompt and then run mozilla from the DOS prompt.)
marking WORKSFORME
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → WORKSFORME
Comment 14•22 years ago
|
||
*** Bug 132248 has been marked as a duplicate of this bug. ***
Comment 15•22 years ago
|
||
verified wfm, this has been working for awhile
Status: RESOLVED → VERIFIED
Whiteboard: dupeme
Updated•22 years ago
|
QA Contact: httpqa → tever
Comment 16•22 years ago
|
||
*** Bug 188816 has been marked as a duplicate of this bug. ***
Comment 17•22 years ago
|
||
I think an obvious point (wishlist idea) has been missed. Users are asking for a
window that opens in Mozilla (not unlike a 'View Source' or JavaScript console
window). Something that is easy to use. Changeing builds and searching for logs
is not fun.
If this was implimented Mozzila would be an even bigger killer app for web
developers. As one myself I beg a software developer to make this addition [soon].
Comment 18•22 years ago
|
||
just install:
http://livehttpheaders.mozdev.org/
it has all of the features!
Comment 19•22 years ago
|
||
Guys,
I've just stumbled on interesting implementation of the requested functionality:
http://livehttpheaders.mozdev.org
In essence that's exactly what we're looking for. It's a plugin and I'm sure it
worth to be merged with the Mozilla's base.
You need to log in
before you can comment on or make changes to this bug.
Description
•