vinted-memcached 1.8.5 → 1.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -104,32 +104,23 @@ static inline memcached_return memcached_send(memcached_st *ptr,
104
104
  (ptr->flags & MEM_NOREPLY) ? " noreply" : "");
105
105
  else
106
106
  {
107
- char *buffer_ptr= buffer;
108
- const char *command= storage_op_string(verb);
109
-
110
- /* Copy in the command, no space needed, we handle that in the command function*/
111
- memcpy(buffer_ptr, command, strlen(command));
112
-
113
- /* Copy in the key prefix, switch to the buffer_ptr */
114
- buffer_ptr= memcpy(buffer_ptr + strlen(command) , ptr->prefix_key, strlen(ptr->prefix_key));
115
-
116
- /* Copy in the key, adjust point if a key prefix was used. */
117
- buffer_ptr= memcpy(buffer_ptr + (ptr->prefix_key ? strlen(ptr->prefix_key) : 0),
118
- key, key_length);
119
- buffer_ptr+= key_length;
120
- buffer_ptr[0]= ' ';
121
- buffer_ptr++;
122
- write_length= (size_t)(buffer_ptr - buffer);
123
-
124
107
  if (verb == DELETE_OP) {
125
- if (ptr->flags & MEM_NOREPLY)
126
- write_length+= (size_t) snprintf(buffer_ptr, MEMCACHED_DEFAULT_COMMAND_SIZE, "noreply");
127
- } else {
128
- write_length+= (size_t) snprintf(buffer_ptr, MEMCACHED_DEFAULT_COMMAND_SIZE,
129
- "%u %llu %zu%s\r\n",
130
- flags,
131
- (unsigned long long)expiration, value_length,
132
- (ptr->flags & MEM_NOREPLY) ? " noreply" : "");
108
+ write_length= (size_t) snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE,
109
+ "%s%s%.*s %s",
110
+ storage_op_string(verb),
111
+ ptr->prefix_key,
112
+ (int)key_length, key,
113
+ (ptr->flags & MEM_NOREPLY) ? "noreply" : "");
114
+ }
115
+ else
116
+ {
117
+ write_length= (size_t) snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE,
118
+ "%s%s%.*s %u %llu %zu%s\r\n",
119
+ storage_op_string(verb),
120
+ ptr->prefix_key,
121
+ (int)key_length, key, flags,
122
+ (unsigned long long)expiration, value_length,
123
+ (ptr->flags & MEM_NOREPLY) ? " noreply" : "");
133
124
  }
134
125
  }
135
126
 
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vinted-memcached
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.5
4
+ version: 1.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arthur Neves
8
8
  - Evan Weaver
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-04-05 00:00:00.000000000 Z
12
+ date: 2025-04-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -275,7 +275,7 @@ homepage: http://evan.github.com/evan/memcached/
275
275
  licenses:
276
276
  - Academic Free License 3.0 (AFL-3.0)
277
277
  metadata: {}
278
- post_install_message:
278
+ post_install_message:
279
279
  rdoc_options: []
280
280
  require_paths:
281
281
  - lib
@@ -291,7 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
291
291
  version: '0'
292
292
  requirements: []
293
293
  rubygems_version: 3.2.33
294
- signing_key:
294
+ signing_key:
295
295
  specification_version: 4
296
296
  summary: An interface to the libmemcached C client.
297
297
  test_files: []