- instance->minor_version= (uint8_t)strtol(p + 1, &p, 10);
- if (errno == ERANGE)
- {
- instance->major_version= instance->minor_version= instance->micro_version= UINT8_MAX;
- rc= MEMCACHED_SOME_ERRORS;
- continue;
- }
+static inline void version_ascii_instance(org::libmemcached::Instance* instance)
+{
+ if (instance->major_version != UINT8_MAX)
+ {
+ libmemcached_io_vector_st vector[]=
+ {
+ { memcached_literal_param("version\r\n") },
+ };
+
+ (void)memcached_vdo(instance, vector, 1, false);
+ }
+}
+
+static inline void version_binary_instance(org::libmemcached::Instance* instance)
+{
+ if (instance->major_version != UINT8_MAX)
+ {
+ protocol_binary_request_version request= {};
+
+ request.message.header.request.opcode= PROTOCOL_BINARY_CMD_VERSION;
+ request.message.header.request.datatype= PROTOCOL_BINARY_RAW_BYTES;
+
+ libmemcached_io_vector_st vector[]=
+ {
+ { request.bytes, sizeof(request.bytes) }
+ };
+
+ initialize_binary_request(instance, request.message.header);
+
+ (void)memcached_vdo(instance, vector, 1, false);
+ }
+}