If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

typo in nsHTTPCompressConv.cpp

VERIFIED FIXED

Status

()

Core
Networking
VERIFIED FIXED
13 years ago
13 years ago

People

(Reporter: Esteve Sabate Juncosa, Assigned: Biesinger)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7b) Gecko/20040421
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7b) Gecko/20040421

Yesterdya i've downloaded the source tree for Mozilla and i was looking in the
source to find how the decompression of pages compressed at server works. In the
source i think that there is an error that makes compressed responses with
HTTP_COMPRESS_GZIP method never get decompressed. The involved file is
nsHTTPCompressConv.cpp and the involved line is line 99: in this line you make a
PL_strncasecmp(fromStr, HTTP_GZIP_TYPE, sieof(HTTP_COMPRESS_TYPE)) (Obviously,
the  pointer is rigth but not the length!!! so the comparation is always false).
I think that this is due a vi yy of the lineno 95. I hope that if this is true
help you to improve the excelent suite of software

Reproducible: Always
Assignee: general → darin
Component: General → Networking
Product: Mozilla Application Suite → Core
QA Contact: general → benc
Version: unspecified → Trunk
PL_strncasecmp's third argument is a maximum number of characters to compare,
but it will stop at the first NUL.

/be
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → INVALID

Comment 2

13 years ago
the code in branch, line 99:
http://lxr.mozilla.org/mozilla1.7/source/netwerk/streamconv/converters/nsHTTPCompressConv.cpp#86

in trunk:
http://lxr.mozilla.org/seamonkey/source/netwerk/streamconv/converters/nsHTTPCompressConv.cpp#99
while maybe not a bug, this is still a typo that confuses people who look at it.
it seems to me like we should still fix it.
Status: RESOLVED → UNCONFIRMED
OS: Windows XP → All
Hardware: PC → All
Resolution: INVALID → ---
Created attachment 174924 [details] [diff] [review]
patch
Assignee: darin → cbiesinger
Status: UNCONFIRMED → ASSIGNED
Attachment #174924 - Flags: superreview?(darin)
Attachment #174924 - Flags: review?(darin)
Comment on attachment 174924 [details] [diff] [review]
patch

My apologies, thanks to biesi for reopening and sr=me FWIW.

/be

Updated

13 years ago
Attachment #174924 - Flags: superreview?(darin)
Attachment #174924 - Flags: superreview+
Attachment #174924 - Flags: review?(darin)
Attachment #174924 - Flags: review+
Checking in netwerk/streamconv/converters/nsHTTPCompressConv.cpp;
/cvsroot/mozilla/netwerk/streamconv/converters/nsHTTPCompressConv.cpp,v  <-- 
nsHTTPCompressConv.cpp
new revision: 1.24; previous revision: 1.23
done


Thank you for finding and reporting this typo!
Status: ASSIGNED → RESOLVED
Last Resolved: 13 years ago13 years ago
Resolution: --- → FIXED

Comment 7

13 years ago
Though marked as fixed, this could use a better title. ;-)
Summary: I think that there is a bug in the source code → typo in nsHTTPCompressConv.cpp
Verified FIXED using LXR and Bonsai:

http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&file=nsHTTPCompressConv.cpp&branch=&root=/cvsroot&subdir=mozilla/netwerk/streamconv/converters&command=DIFF_FRAMESET&rev1=1.23&rev2=1.24
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.