X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fprotocol%2Fbinary_handler.c;h=a9e4ce95890915f0cc067c7004d8ac9944afb7a5;hb=f285e1b3821f56a8983b5ce9fb1a0070e7bb0a1c;hp=2bafdeb1a445df0378bb4e366a955f1fca2bee3c;hpb=8cc3921d72dabcc2a89c38bbee08007b7abe6976;p=awesomized%2Flibmemcached diff --git a/libmemcached/protocol/binary_handler.c b/libmemcached/protocol/binary_handler.c index 2bafdeb1..a9e4ce95 100644 --- a/libmemcached/protocol/binary_handler.c +++ b/libmemcached/protocol/binary_handler.c @@ -3,7 +3,6 @@ #include #include -#include #include #include #include @@ -40,7 +39,7 @@ raw_response_handler(const void *cookie, if (!client->root->drain(client)) { - return PROTOCOL_BINARY_RESPONSE_EIO; + return PROTOCOL_BINARY_RESPONSE_EINTERNAL; } size_t len= sizeof(*response) + htonl(response->response.bodylen); @@ -59,14 +58,14 @@ raw_response_handler(const void *cookie, num_bytes); if (nw == -1) { - if (errno == EWOULDBLOCK) + if (get_socket_errno() == EWOULDBLOCK) { break; } - else if (errno != EINTR) + else if (get_socket_errno() != EINTR) { client->error= errno; - return PROTOCOL_BINARY_RESPONSE_EIO; + return PROTOCOL_BINARY_RESPONSE_EINTERNAL; } } else @@ -701,7 +700,7 @@ quit_command_handler(const void *cookie, } /* I need a better way to signal to close the connection */ - return PROTOCOL_BINARY_RESPONSE_EIO; + return PROTOCOL_BINARY_RESPONSE_EINTERNAL; } /** @@ -971,8 +970,8 @@ static protocol_binary_response_status execute_command(memcached_protocol_client } if (rval != PROTOCOL_BINARY_RESPONSE_SUCCESS && - rval != PROTOCOL_BINARY_RESPONSE_EIO && - rval != PROTOCOL_BINARY_RESPONSE_PAUSE) + rval != PROTOCOL_BINARY_RESPONSE_EINTERNAL && + rval != PROTOCOL_BINARY_RESPONSE_NOT_SUPPORTED) { protocol_binary_response_no_extras response= { .message= { @@ -1019,12 +1018,12 @@ memcached_protocol_event_t memcached_binary_protocol_process_data(memcached_prot client->current_command= header; protocol_binary_response_status rv= execute_command(client, header); - if (rv == PROTOCOL_BINARY_RESPONSE_EIO) + if (rv == PROTOCOL_BINARY_RESPONSE_EINTERNAL) { *length= len; *endptr= (void*)header; return MEMCACHED_PROTOCOL_ERROR_EVENT; - } else if (rv == PROTOCOL_BINARY_RESPONSE_PAUSE) + } else if (rv == PROTOCOL_BINARY_RESPONSE_NOT_SUPPORTED) return MEMCACHED_PROTOCOL_PAUSE_EVENT; ssize_t total= (ssize_t)(sizeof(*header) + ntohl(header->request.bodylen));