- value_ptr= memcached_string_value_mutable(&result->value);
- /*
- We read the \r\n into the string since not doing so is more
- cycles then the waster of memory to do so.
-
- We are null terminating through, which will most likely make
- some people lazy about using the return length.
- */
- to_read= (value_length) + 2;
- rrc= memcached_io_read(ptr, value_ptr, to_read, &read_length);
- if (rrc != MEMCACHED_SUCCESS)
- return rrc;
+ {
+ char *value_ptr= memcached_string_value_mutable(&result->value);
+ /*
+ We read the \r\n into the string since not doing so is more
+ cycles then the waster of memory to do so.
+
+ We are null terminating through, which will most likely make
+ some people lazy about using the return length.
+ */
+ to_read= (value_length) + 2;
+ memcached_return_t rrc= memcached_io_read(ptr, value_ptr, to_read, &read_length);
+ if (memcached_failed(rrc) and rrc == MEMCACHED_IN_PROGRESS)
+ {
+ memcached_quit_server(ptr, true);
+ return memcached_set_error(*ptr, MEMCACHED_IN_PROGRESS, MEMCACHED_AT);
+ }
+ else if (memcached_failed(rrc))
+ {
+ return rrc;
+ }
+ }