[PATCH] os: Fix BigReq ignoring when another request is pending

Adam Jackson ajax at nwnk.net
Thu Oct 28 05:13:06 PDT 2010


On Mon, 2010-10-25 at 22:01 -0700, Aaron Plattner wrote:
> Commit cf88363db0ebb42df7cc286b85d30d7898aea840 fixed the handling of
> BigReq requests that are way too large and handles the case where the
> read() syscall returns a short read.  However, it neglected to handle
> the case where it returns a long read, which happens when the client
> has another request in the queue after the bogus large one.
> 
> Handle the long read case by subtracting the smaller of 'needed' and
> 'gotnow' from oci->ignoreBytes.  If needed < gotnow, simply subtract
> the two, leaving gotnow equal to the number of extra bytes read.
> Since the code immediately following the (oci->ignoreBytes > 0) block
> tries to handle the next request, advance oci->bufptr immediately
> instead of setting oci->lenLastReq and letting the next call to
> ReadRequestFromClient do it.
> 
> Fixes the XTS pChangeKeyboardMapping-3 test.
> 
>          CASES TESTS  PASS UNSUP UNTST NOTIU  WARN   FIP  FAIL UNRES  UNIN ABORT
> -Xproto    122   389   367     2    19     0     0     0     1     0     0     0
> +Xproto    122   389   368     2    19     0     0     0     0     0     0     0
> 
> Signed-off-by: Aaron Plattner <aplattner at nvidia.com>

Reviewed-by: Adam Jackson <ajax at redhat.com>

> ---
> Sorry I screwed this up the first time.  Do you think I should revert the first
> version and then reapply this one?

Meh.  The commit message is sufficiently informative.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20101028/7cce2372/attachment.pgp>


More information about the xorg-devel mailing list