Cleanup on uint8 to bool for quit.
[m6w6/libmemcached] / libmemcached / quit.c
index c22635a8a77af69ff22d2def8a810d461b6d8198..8b5acf67d1f056727f38328241af7b0c4abac6c4 100644 (file)
@@ -9,11 +9,11 @@
   will force data to be completed.
 */
 
-void memcached_quit_server(memcached_server_st *ptr, uint8_t io_death)
+void memcached_quit_server(memcached_server_st *ptr, bool io_death)
 {
   if (ptr->fd != -1)
   {
-    if (io_death == 0 && ptr->type != MEMCACHED_CONNECTION_UDP)
+    if (io_death == false && ptr->type != MEMCACHED_CONNECTION_UDP)
     {
       memcached_return_t rc;
       char buffer[MEMCACHED_MAX_BUFFER];
@@ -24,11 +24,11 @@ void memcached_quit_server(memcached_server_st *ptr, uint8_t io_death)
         request.message.header.request.magic = PROTOCOL_BINARY_REQ;
         request.message.header.request.opcode = PROTOCOL_BINARY_CMD_QUIT;
         request.message.header.request.datatype = PROTOCOL_BINARY_RAW_BYTES;
-        rc= memcached_do(ptr, request.bytes, sizeof(request.bytes), 1);
+        rc= memcached_do(ptr, request.bytes, sizeof(request.bytes), true);
       }
       else
       {
-        rc= memcached_do(ptr, "quit\r\n", 6, 1);
+        rc= memcached_do(ptr, "quit\r\n", sizeof("quit\r\n"), true);
       }
 
       WATCHPOINT_ASSERT(rc == MEMCACHED_SUCCESS || rc == MEMCACHED_FETCH_NOTFINISHED);
@@ -61,7 +61,7 @@ void memcached_quit_server(memcached_server_st *ptr, uint8_t io_death)
   ptr->read_ptr= ptr->read_buffer;
   memcached_server_response_reset(ptr);
 
-  if(io_death)
+  if (io_death)
   {
     ptr->server_failure_counter++;
   }