On Wed, Nov 23, 2011 at 2:06 PM, goran kent <[email protected]> wrote:
> What the hell is causing $client_sock->sysread( $buf, 6959) to only
> return 2892 bytes!?

PERLFUNC(1) for sysread says "*Attempts* to read LENGTH bytes of
data..." [emphasis mine] which means there might be unread chunks of
bytes.  It looks like the 6k client request is being sent as two or
more chunks, so sysread needs a loop to get it all:

my $ret;
do {
     $ret = $client_sock->sysread( $buf, $len );
      last if not $ret;
      $check_val += $ret;
} while $ret;

or some such, instead of just

$check_val = $client_sock->sysread( $buf, $len );

in SearchServer::serve.

Reply via email to