lucy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From goran kent <>
Subject Re: [lucy-user] Concurrent searching
Date Wed, 23 Nov 2011 12:31:16 GMT
On Wed, Nov 23, 2011 at 2:06 PM, goran kent <> 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.

View raw message