try_read_network doubt

dormando dormando at rydia.net
Wed Feb 20 07:12:44 UTC 2008


Hey,

Does this fix a specific error condition? Anything we could write a test
for?

I believe in my own network code I've done it the way you just
described... will double check.

-Dormando

Tao Hui wrote:
> Hi!
>     I have a doubt, in memcached-1.2.4 try_read_network(conn *c)
> funcation, when read returns -1 and  errno  is not  EWOULDBLOCK or
> EAGAIN, it returns 0. If it's more suitable to change state to
> conn_closing and return 1. the patch is as below:
> 1928,1934c1928
> <             else {
> <                               /* otherwise we have a real error, on
> which we close the connection */
> <                               if (settings.verbose > 0)
> <                             
>           fprintf(stderr, "Failed to read, and not due to blocking\n");
> <                               conn_set_state(c, conn_closing);
> <                               return 1;
> <                       }
> ---
>>             else return 0;



More information about the memcached mailing list