uint8_t micro_version)
{
memcached_server_fn callbacks[1];
- memcached_version(memc);
+ memcached_return_t rc= memcached_version(memc);
+
+ if (rc != MEMCACHED_SUCCESS)
+ return false;
struct local_context check= { .major_version= major_version, .minor_version= minor_version, .micro_version= micro_version, .truth= true };
- memcached_version(memc);
callbacks[0]= check_server_version;
memcached_server_cursor(memc, callbacks, (void *)&check, 1);
rrc= memcached_do(instance, command, send_length, true);
if (rrc != MEMCACHED_SUCCESS)
{
+ instance->major_version= instance->minor_version= instance->micro_version= 0;
rc= MEMCACHED_SOME_ERRORS;
continue;
}
rrc= memcached_response(instance, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, NULL);
if (rrc != MEMCACHED_SUCCESS)
{
+ instance->major_version= instance->minor_version= instance->micro_version= 0;
rc= MEMCACHED_SOME_ERRORS;
continue;
}
response_ptr++;
instance->major_version= (uint8_t)strtol(response_ptr, (char **)NULL, 10);
+ if (errno == ERANGE)
+ {
+ instance->major_version= instance->minor_version= instance->micro_version= 0;
+ rc= MEMCACHED_SOME_ERRORS;
+ continue;
+ }
+
response_ptr= index(response_ptr, '.');
response_ptr++;
+
instance->minor_version= (uint8_t)strtol(response_ptr, (char **)NULL, 10);
+ if (errno == ERANGE)
+ {
+ instance->major_version= instance->minor_version= instance->micro_version= 0;
+ rc= MEMCACHED_SOME_ERRORS;
+ continue;
+ }
+
response_ptr= index(response_ptr, '.');
response_ptr++;
instance->micro_version= (uint8_t)strtol(response_ptr, (char **)NULL, 10);
+ if (errno == ERANGE)
+ {
+ instance->major_version= instance->minor_version= instance->micro_version= 0;
+ rc= MEMCACHED_SOME_ERRORS;
+ continue;
+ }
}
return rc;
// if (! if_successful)
{
+ fprintf(stderr, "\n----------------------------------------------------------------------\n");
+ fprintf(stderr, "\nDumping Server Information\n");
memcached_server_fn callbacks[1];
memcached_version(memc);
callbacks[0]= dump_server_information;
memcached_server_cursor(memc, callbacks, (void *)stderr, 1);
+ fprintf(stderr, "\n----------------------------------------------------------------------\n");
}
test_true(if_successful == false);