Make use of memcached_fatal for determining state of loop processing.
[awesomized/libmemcached] / libmemcached / response.cc
index 437c4cc9e5d0b76d4c86670f157bb82a7f9a8dfc..8ed3469c818b449178f7a2664e612c67df3ab2e3 100644 (file)
@@ -776,22 +776,7 @@ memcached_return_t memcached_response(memcached_server_write_instance_st ptr,
       memcached_return_t rc= _read_one_response(ptr, buffer, buffer_length, junked_result_ptr);
 
       // @TODO should we return an error on another but a bad read case?
-      if (
-          rc != MEMCACHED_DATA_EXISTS and
-          rc != MEMCACHED_DELETED and
-          rc != MEMCACHED_E2BIG and
-          rc != MEMCACHED_END and
-          rc != MEMCACHED_ERROR and
-          rc != MEMCACHED_ITEM and
-          rc != MEMCACHED_NOTFOUND and
-          rc != MEMCACHED_NOTSTORED and
-          rc != MEMCACHED_SERVER_ERROR and
-          rc != MEMCACHED_SERVER_MEMORY_ALLOCATION_FAILURE and
-          rc != MEMCACHED_STAT and
-          rc != MEMCACHED_STORED and
-          rc != MEMCACHED_SUCCESS and
-          rc != MEMCACHED_VALUE
-          )
+      if (memcached_fatal(rc))
       {
         memcached_result_free(junked_result_ptr);
         return rc;