Last Comment Bug 736903 - nsHttpChannel wraps the aOffset value it passes to its stream listener instead of clamping it
: nsHttpChannel wraps the aOffset value it passes to its stream listener instea...
Status: RESOLVED FIXED
[build_warning]
:
Product: Core
Classification: Components
Component: Networking: HTTP (show other bugs)
: Trunk
: All All
: -- trivial (vote)
: mozilla14
Assigned To: Brian Smith (:briansmith, :bsmith, use NEEDINFO?)
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-18 16:46 PDT by Brian Smith (:briansmith, :bsmith, use NEEDINFO?)
Modified: 2012-04-05 11:26 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Clamp offset passed to OnDataAvailable instead of wrapping it (1.65 KB, patch)
2012-03-18 16:46 PDT, Brian Smith (:briansmith, :bsmith, use NEEDINFO?)
cbiesinger: review+
Details | Diff | Splinter Review

Description Brian Smith (:briansmith, :bsmith, use NEEDINFO?) 2012-03-18 16:46:44 PDT
Created attachment 607035 [details] [diff] [review]
Clamp offset passed to OnDataAvailable instead of wrapping it

See the documentation:

     * @param aOffset
     *        Number of bytes that were sent in previous onDataAvailable calls
     *        for this request. In other words, the sum of all previous count
     *        parameters.
     *        If that number is greater than or equal to 2^32, this parameter
     *        will be PR_UINT32_MAX (2^32 - 1).

The attached patch clamps the value in the same way that nsInputStreamPump::OnStateTransfer does.

Without this patch, MSVC complains about the implicit PRUint64 to PRUint32 conversion when mLogicalOffset is passed to OnDataAvailable.
Comment 1 Brian Smith (:briansmith, :bsmith, use NEEDINFO?) 2012-04-04 19:19:15 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/d242e16d161c

Note You need to log in before you can comment on or make changes to this bug.