Update docs.
[m6w6/libmemcached] / libmemcached / protocol / binary_handler.c
index 27581ec8093cc0ab7f727924e073ece5114edb84..81c09c99f88f01154857cf4e35e7323f105c873c 100644 (file)
@@ -3,7 +3,6 @@
 
 #include <stdlib.h>
 #include <sys/types.h>
-#include <sys/socket.h>
 #include <errno.h>
 #include <stdbool.h>
 #include <string.h>
@@ -59,11 +58,11 @@ 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;
@@ -125,9 +124,10 @@ get_response_handler(const void *cookie,
       .extlen= 4,
       .bodylen= htonl(bodylen + keylen + 4),
     },
-    .message.body.flags= htonl(flags),
   };
 
+  response.message.body.flags= htonl(flags);
+
   protocol_binary_response_status rval;
   const protocol_binary_response_status success= PROTOCOL_BINARY_RESPONSE_SUCCESS;
   if ((rval= client->root->spool(client, response.bytes, sizeof(response.bytes))) != success ||