X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fresponse.cc;h=ad3c0785dfa24bed1e1bc2b09b1488e08d2f85ee;hb=8c96d045f23d3f787ea6fc84237eb9e30c1c4fce;hp=c01d508942ea8ddb199ff41f1f7c066d44066864;hpb=0e40facad567ea11474b62f597c34faeea5c86fe;p=awesomized%2Flibmemcached diff --git a/libmemcached/response.cc b/libmemcached/response.cc index c01d5089..ad3c0785 100644 --- a/libmemcached/response.cc +++ b/libmemcached/response.cc @@ -500,6 +500,8 @@ static memcached_return_t binary_read_one_response(memcached_instance_st* instan memcached_return_t rc; protocol_binary_response_header header; + assert(memcached_is_binary(instance->root)); + if ((rc= memcached_safe_read(instance, &header.bytes, sizeof(header.bytes))) != MEMCACHED_SUCCESS) { WATCHPOINT_ERROR(rc); @@ -892,12 +894,19 @@ memcached_return_t memcached_response(memcached_instance_st* instance, return memcached_set_error(*instance, MEMCACHED_NOT_SUPPORTED, MEMCACHED_AT); } - /* We may have old commands in the buffer not set, first purge */ + /* We may have old commands in the buffer not sent, first purge */ if ((instance->root->flags.no_block) and (memcached_is_processing_input(instance->root) == false)) { (void)memcached_io_write(instance); } + /* Before going into loop wait to see if we have any IO waiting for us */ + if (0) + { + memcached_return_t read_rc= memcached_io_wait_for_read(instance); + fprintf(stderr, "%s:%d: %s\n", __FILE__, __LINE__, memcached_strerror(NULL, read_rc)); + } + /* * The previous implementation purged all pending requests and just * returned the last one. Purge all pending messages to ensure backwards