memcache 1.2.4 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/ext/native_server.c +20 -5
- data/memcache.gemspec +1 -1
- metadata +1 -1
data/VERSION.yml
CHANGED
data/ext/native_server.c
CHANGED
@@ -311,7 +311,8 @@ static VALUE mc_cas(int argc, VALUE *argv, VALUE self) {
|
|
311
311
|
Data_Get_Struct(self, memcached_st, mc);
|
312
312
|
rb_scan_args(argc, argv, "32", &key, &value, &cas, &expiry, &flags);
|
313
313
|
|
314
|
-
key
|
314
|
+
key = StringValue(key);
|
315
|
+
if (!use_binary(mc)) key = escape_key(key, NULL);
|
315
316
|
value = StringValue(value);
|
316
317
|
|
317
318
|
result = memcached_cas(mc, RSTRING_PTR(key), RSTRING_LEN(key), RSTRING_PTR(value), RSTRING_LEN(value),
|
@@ -337,7 +338,8 @@ VALUE mc_incr(int argc, VALUE *argv, VALUE self) {
|
|
337
338
|
Data_Get_Struct(self, memcached_st, mc);
|
338
339
|
rb_scan_args(argc, argv, "11", &key, &amount);
|
339
340
|
|
340
|
-
key
|
341
|
+
key = StringValue(key);
|
342
|
+
if (!use_binary(mc)) key = escape_key(key, NULL);
|
341
343
|
amount = RTEST(amount) ? NUM2INT(amount) : 1;
|
342
344
|
|
343
345
|
result = memcached_increment(mc, RSTRING_PTR(key), RSTRING_LEN(key), amount, value);
|
@@ -360,7 +362,8 @@ VALUE mc_decr(int argc, VALUE *argv, VALUE self) {
|
|
360
362
|
Data_Get_Struct(self, memcached_st, mc);
|
361
363
|
rb_scan_args(argc, argv, "11", &key, &amount);
|
362
364
|
|
363
|
-
key
|
365
|
+
key = StringValue(key);
|
366
|
+
if (!use_binary(mc)) key = escape_key(key, NULL);
|
364
367
|
amount = RTEST(amount) ? NUM2INT(amount) : 1;
|
365
368
|
|
366
369
|
result = memcached_decrement(mc, RSTRING_PTR(key), RSTRING_LEN(key), amount, value);
|
@@ -380,6 +383,8 @@ VALUE mc_delete(VALUE self, VALUE key) {
|
|
380
383
|
|
381
384
|
Data_Get_Struct(self, memcached_st, mc);
|
382
385
|
|
386
|
+
key = StringValue(key);
|
387
|
+
if (!use_binary(mc)) key = escape_key(key, NULL);
|
383
388
|
result = memcached_delete(mc, RSTRING_PTR(key), RSTRING_LEN(key), 0);
|
384
389
|
|
385
390
|
if (result == MEMCACHED_SUCCESS) {
|
@@ -399,7 +404,8 @@ VALUE mc_add(int argc, VALUE *argv, VALUE self) {
|
|
399
404
|
Data_Get_Struct(self, memcached_st, mc);
|
400
405
|
rb_scan_args(argc, argv, "22", &key, &value, &expiry, &flags);
|
401
406
|
|
402
|
-
key
|
407
|
+
key = StringValue(key);
|
408
|
+
if (!use_binary(mc)) key = escape_key(key, NULL);
|
403
409
|
value = StringValue(value);
|
404
410
|
|
405
411
|
result = memcached_add(mc, RSTRING_PTR(key), RSTRING_LEN(key), RSTRING_PTR(value), RSTRING_LEN(value),
|
@@ -423,7 +429,8 @@ VALUE mc_replace(int argc, VALUE *argv, VALUE self) {
|
|
423
429
|
Data_Get_Struct(self, memcached_st, mc);
|
424
430
|
rb_scan_args(argc, argv, "22", &key, &value, &expiry, &flags);
|
425
431
|
|
426
|
-
key
|
432
|
+
key = StringValue(key);
|
433
|
+
if (!use_binary(mc)) key = escape_key(key, NULL);
|
427
434
|
value = StringValue(value);
|
428
435
|
|
429
436
|
result = memcached_replace(mc, RSTRING_PTR(key), RSTRING_LEN(key), RSTRING_PTR(value), RSTRING_LEN(value),
|
@@ -445,6 +452,10 @@ VALUE mc_append(VALUE self, VALUE key, VALUE value) {
|
|
445
452
|
|
446
453
|
Data_Get_Struct(self, memcached_st, mc);
|
447
454
|
|
455
|
+
key = StringValue(key);
|
456
|
+
if (!use_binary(mc)) key = escape_key(key, NULL);
|
457
|
+
value = StringValue(value);
|
458
|
+
|
448
459
|
result = memcached_append(mc, RSTRING_PTR(key), RSTRING_LEN(key), RSTRING_PTR(value), RSTRING_LEN(value), 0, 0);
|
449
460
|
|
450
461
|
if (result == MEMCACHED_SUCCESS) {
|
@@ -462,6 +473,10 @@ VALUE mc_prepend(VALUE self, VALUE key, VALUE value) {
|
|
462
473
|
|
463
474
|
Data_Get_Struct(self, memcached_st, mc);
|
464
475
|
|
476
|
+
key = StringValue(key);
|
477
|
+
if (!use_binary(mc)) key = escape_key(key, NULL);
|
478
|
+
value = StringValue(value);
|
479
|
+
|
465
480
|
result = memcached_prepend(mc, RSTRING_PTR(key), RSTRING_LEN(key), RSTRING_PTR(value), RSTRING_LEN(value), 0, 0);
|
466
481
|
|
467
482
|
if (result == MEMCACHED_SUCCESS) {
|
data/memcache.gemspec
CHANGED