couchbase 1.3.12-x64-mingw32 → 1.3.13-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 39b9a10fb3689e666ec344cb759eab69513f6fec
4
- data.tar.gz: 9af7110af4bd2db6acce0ffa496f0c372dbd9722
3
+ metadata.gz: 5a284a80d11c2b0db6f9a4086e51b37637155ee1
4
+ data.tar.gz: 9d9c294f75687d405b8b7ee0fb71abadfabcdb48
5
5
  SHA512:
6
- metadata.gz: 1f86b66eefc29115410727c8842341de12064f022ffc394df4f15ef77e2df653fa4fef2ca5b1a785e0767e9131de2300b85c087bbdbae38d65160557b91e2ff5
7
- data.tar.gz: 8bb88a836f5ca2f5a6567713c7ee7999057e5b94b64524cab597311e3c5fd381428ef9a5e1eb1bf55e432093fa45039d84875638c1434b3d6fda5337f42dae4d
6
+ metadata.gz: 070c9b2cba52436c62370149eae8bbe2dfed5e45c5819682c924dacde86362083be988cf9223357407ce9791458aa87a83b65aed10e8d8c1937875ab921e1302
7
+ data.tar.gz: 386ee94c1546e14e78ab14fb6d6349a6267a58afc6b9df352bbcc0d4dfddaf515099257e71ccd19a5dba25d9a9d39d5e292b0a02b9017acdbfdec0468d03473f
@@ -3,6 +3,10 @@
3
3
  This document is a list of user visible feature changes and important
4
4
  bugfixes. Do not forget to update this doc in every important patch.
5
5
 
6
+ ## 1.3.13 (2015-05-16)
7
+
8
+ * [major] RCBC-196 Improved integration with libcouchbase IO API
9
+
6
10
  ## 1.3.12 (2015-04-21)
7
11
 
8
12
  * [major] Experimental support of N1QL querires
@@ -42,19 +42,11 @@ bootstrap_callback(lcb_t handle, lcb_error_t error)
42
42
 
43
43
  lcb_breakout(handle);
44
44
  bucket->exception = cb_check_error(error, "bootstrap error", Qnil);
45
- if (bucket->async && !bucket->connected) {
46
- (void)trigger_on_connect_callback(bucket->self);
47
- }
48
- }
49
-
50
- static void
51
- configuration_callback(lcb_t handle, lcb_configuration_t config)
52
- {
53
- struct cb_bucket_st *bucket = (struct cb_bucket_st *)lcb_get_cookie(handle);
54
-
55
- if (config == LCB_CONFIGURATION_NEW) {
45
+ if (!bucket->connected) {
56
46
  bucket->connected = 1;
57
- (void)trigger_on_connect_callback(bucket->self);
47
+ if (bucket->async) {
48
+ (void)trigger_on_connect_callback(bucket->self);
49
+ }
58
50
  }
59
51
  }
60
52
 
@@ -362,19 +354,19 @@ do_connect(struct cb_bucket_st *bucket)
362
354
  #endif
363
355
  } else if (bucket->engine == cb_sym_libev) {
364
356
  ciops.v.v0.type = LCB_IO_OPS_LIBEV;
357
+ #ifdef BUILD_EVENTMACHINE_PLUGIN
365
358
  } else if (bucket->engine == cb_sym_eventmachine) {
366
- ciops.version = 1;
367
- ciops.v.v1.sofile = NULL;
368
- ciops.v.v1.symbol = "cb_create_ruby_em_io_opts";
369
- ciops.v.v1.cookie = bucket;
359
+ ciops.version = 2;
360
+ ciops.v.v2.create = cb_create_ruby_em_io_opts;
361
+ ciops.v.v2.cookie = bucket;
362
+ #endif
370
363
  } else {
371
364
  #ifdef _WIN32
372
365
  ciops.v.v0.type = LCB_IO_OPS_DEFAULT;
373
366
  #else
374
- ciops.version = 1;
375
- ciops.v.v1.sofile = NULL;
376
- ciops.v.v1.symbol = "cb_create_ruby_mt_io_opts";
377
- ciops.v.v1.cookie = NULL;
367
+ ciops.version = 2;
368
+ ciops.v.v2.create = cb_create_ruby_mt_io_opts;
369
+ ciops.v.v2.cookie = NULL;
378
370
  #endif
379
371
  }
380
372
  err = lcb_create_io_ops(&bucket->io, &ciops);
@@ -424,7 +416,6 @@ do_connect(struct cb_bucket_st *bucket)
424
416
  (void)lcb_set_http_data_callback(bucket->handle, cb_http_data_callback);
425
417
  (void)lcb_set_observe_callback(bucket->handle, cb_observe_callback);
426
418
  (void)lcb_set_unlock_callback(bucket->handle, cb_unlock_callback);
427
- (void)lcb_set_configuration_callback(bucket->handle, configuration_callback);
428
419
 
429
420
  lcb_cntl(bucket->handle, (bucket->timeout > 0) ? LCB_CNTL_SET : LCB_CNTL_GET,
430
421
  LCB_CNTL_OP_TIMEOUT, &bucket->timeout);
@@ -27,7 +27,7 @@
27
27
  #endif
28
28
 
29
29
  #include "couchbase_config.h"
30
- #ifdef HAVE_RB_FIBER_YIELD
30
+ #if defined(HAVE_RB_FIBER_YIELD) && !defined(_WIN32)
31
31
  #define BUILD_EVENTMACHINE_PLUGIN
32
32
  #endif
33
33
  #ifdef HAVE_STDINT_H
@@ -644,6 +644,10 @@ int cb_io_connect(struct lcb_io_opt_st *iops, lcb_socket_t sock, const struct so
644
644
  /* plugin init functions */
645
645
  LIBCOUCHBASE_API
646
646
  lcb_error_t cb_create_ruby_mt_io_opts(int version, lcb_io_opt_t *io, void *arg);
647
+ #ifdef BUILD_EVENTMACHINE_PLUGIN
648
+ LIBCOUCHBASE_API
649
+ lcb_error_t cb_create_ruby_em_io_opts(int version, lcb_io_opt_t *io, void *arg);
650
+ #endif
647
651
 
648
652
  /* shortcut functions */
649
653
  static inline VALUE
@@ -17,7 +17,6 @@
17
17
 
18
18
  #include "couchbase_ext.h"
19
19
 
20
- #ifndef _WIN32
21
20
  #ifdef BUILD_EVENTMACHINE_PLUGIN
22
21
 
23
22
  VALUE cb_mEm;
@@ -406,11 +405,36 @@ lcb_destroy_io_opts(struct lcb_io_opt_st *iops)
406
405
  rb_em_loop_destroy((rb_em_loop*)iops->v.v0.cookie);
407
406
  }
408
407
 
408
+ static void
409
+ iops_getprocs(int version,
410
+ lcb_loop_procs *loop_procs, lcb_timer_procs *timer_procs,
411
+ lcb_bsd_procs *bsd_procs, lcb_ev_procs *ev_procs,
412
+ lcb_completion_procs *completion_procs, lcb_iomodel_t *iomodel)
413
+ {
414
+ /* Call the parent function */
415
+ lcb_iops_wire_bsd_impl2(bsd_procs, version);
416
+
417
+ /* Now apply our new I/O functionality */
418
+ ev_procs->create = lcb_io_create_event;
419
+ ev_procs->destroy = lcb_io_destroy_event;
420
+ ev_procs->watch = lcb_io_update_event;
421
+ ev_procs->cancel = lcb_io_delete_event;
422
+
423
+ timer_procs->create = lcb_io_create_timer;
424
+ timer_procs->destroy = lcb_io_destroy_timer;
425
+ timer_procs->schedule = lcb_io_update_timer;
426
+ timer_procs->cancel = lcb_io_delete_timer;
427
+
428
+ loop_procs->start = lcb_io_run_event_loop;
429
+ loop_procs->stop = lcb_io_stop_event_loop;
430
+ (void) completion_procs;
431
+ (void) iomodel;
432
+ }
433
+
409
434
  LIBCOUCHBASE_API lcb_error_t
410
435
  cb_create_ruby_em_io_opts(int version, lcb_io_opt_t *io, void *arg)
411
436
  {
412
- lcb_bsd_procs procs;
413
- struct lcb_io_opt_st *ret;
437
+ lcb_io_opt_t ret;
414
438
  rb_em_loop *loop;
415
439
  struct cb_bucket_st *bucket = arg;
416
440
 
@@ -422,43 +446,21 @@ cb_create_ruby_em_io_opts(int version, lcb_io_opt_t *io, void *arg)
422
446
 
423
447
  ret = calloc(1, sizeof(*ret));
424
448
  if (ret == NULL) {
449
+ return LCB_CLIENT_ENOMEM;
450
+ }
451
+ loop = rb_em_loop_create(bucket);
452
+ if (loop == NULL) {
425
453
  free(ret);
426
454
  return LCB_CLIENT_ENOMEM;
427
455
  }
428
456
 
429
- ret->version = 0;
430
457
  ret->dlhandle = NULL;
431
458
  ret->destructor = lcb_destroy_io_opts;
432
- /* consider that struct isn't allocated by the library,
433
- * `need_cleanup' flag might be set in lcb_create() */
434
- ret->v.v0.need_cleanup = 0;
435
- lcb_iops_wire_bsd_impl2(&procs, 0);
436
- ret->v.v0.recv = procs.recv;
437
- ret->v.v0.recvv = procs.recvv;
438
- ret->v.v0.send = procs.send;
439
- ret->v.v0.sendv = procs.sendv;
440
- ret->v.v0.socket = procs.socket0;
441
- ret->v.v0.connect = procs.connect0;
442
- ret->v.v0.close = procs.close;
443
- ret->v.v0.delete_event = lcb_io_delete_event;
444
- ret->v.v0.destroy_event = lcb_io_destroy_event;
445
- ret->v.v0.create_event = lcb_io_create_event;
446
- ret->v.v0.update_event = lcb_io_update_event;
447
-
448
- ret->v.v0.delete_timer = lcb_io_delete_timer;
449
- ret->v.v0.destroy_timer = lcb_io_destroy_timer;
450
- ret->v.v0.create_timer = lcb_io_create_timer;
451
- ret->v.v0.update_timer = lcb_io_update_timer;
452
-
453
- ret->v.v0.run_event_loop = lcb_io_run_event_loop;
454
- ret->v.v0.stop_event_loop = lcb_io_stop_event_loop;
455
-
456
- loop = rb_em_loop_create(bucket);
457
- ret->v.v0.cookie = loop;
458
-
459
+ ret->version = 2;
460
+ ret->v.v2.get_procs = iops_getprocs;
461
+ LCB_IOPS_BASEFLD(ret, cookie) = loop;
459
462
  *io = ret;
460
463
  return LCB_SUCCESS;
461
464
  }
462
465
 
463
466
  #endif
464
- #endif
@@ -580,8 +580,8 @@ loop_run_select(VALUE argp)
580
580
  hrtime_t now, next_time;
581
581
 
582
582
  next_time = timers_minimum(&loop->timers);
583
+ now = gethrtime();
583
584
  if (next_time) {
584
- now = gethrtime();
585
585
  if (next_time <= now) {
586
586
  timeout.tv_sec = 0;
587
587
  timeout.tv_usec = 0;
@@ -621,11 +621,6 @@ loop_run_select(VALUE argp)
621
621
  if (result < 0) {
622
622
  rb_sys_fail("rb_thread_fd_select");
623
623
  }
624
- /* fix current time so that socket callbacks will not cause timers timeouts */
625
- if (next_time) {
626
- now = gethrtime();
627
- }
628
-
629
624
  if (result > 0) {
630
625
  uint32_t i;
631
626
  for(i = 0; i < loop->events.count && result; i++) {
@@ -772,8 +767,8 @@ loop_run_poll(VALUE argp)
772
767
 
773
768
  retry:
774
769
  next_time = timers_minimum(&loop->timers);
770
+ now = gethrtime();
775
771
  if (next_time) {
776
- now = gethrtime();
777
772
  args->ts = next_time <= now ? 0 : next_time - now;
778
773
  } else {
779
774
  args->ts = HRTIME_INFINITY;
@@ -825,10 +820,6 @@ retry:
825
820
  return Qnil;
826
821
  }
827
822
 
828
- if (next_time) {
829
- now = gethrtime();
830
- }
831
-
832
823
  if (args->result > 0) {
833
824
  uint32_t cnt = args->result;
834
825
  uint32_t fd_n = 0, ev_n = 0;
@@ -1036,11 +1027,36 @@ lcb_destroy_io_opts(struct lcb_io_opt_st *iops)
1036
1027
  free(iops);
1037
1028
  }
1038
1029
 
1030
+ static void
1031
+ iops_getprocs(int version,
1032
+ lcb_loop_procs *loop_procs, lcb_timer_procs *timer_procs,
1033
+ lcb_bsd_procs *bsd_procs, lcb_ev_procs *ev_procs,
1034
+ lcb_completion_procs *completion_procs, lcb_iomodel_t *iomodel)
1035
+ {
1036
+ /* Call the parent function */
1037
+ lcb_iops_wire_bsd_impl2(bsd_procs, version);
1038
+
1039
+ /* Now apply our new I/O functionality */
1040
+ ev_procs->create = lcb_io_create_event;
1041
+ ev_procs->destroy = lcb_io_destroy_event;
1042
+ ev_procs->watch = lcb_io_update_event;
1043
+ ev_procs->cancel = lcb_io_delete_event;
1044
+
1045
+ timer_procs->create = lcb_io_create_timer;
1046
+ timer_procs->destroy = lcb_io_destroy_timer;
1047
+ timer_procs->schedule = lcb_io_update_timer;
1048
+ timer_procs->cancel = lcb_io_delete_timer;
1049
+
1050
+ loop_procs->start = lcb_io_run_event_loop;
1051
+ loop_procs->stop = lcb_io_stop_event_loop;
1052
+ (void) completion_procs;
1053
+ (void) iomodel;
1054
+ }
1055
+
1039
1056
  LIBCOUCHBASE_API lcb_error_t
1040
1057
  cb_create_ruby_mt_io_opts(int version, lcb_io_opt_t *io, void *arg)
1041
1058
  {
1042
- lcb_bsd_procs procs;
1043
- struct lcb_io_opt_st *ret;
1059
+ lcb_io_opt_t ret;
1044
1060
  rb_mt_loop *loop;
1045
1061
  (void)arg;
1046
1062
  if (version != 0) {
@@ -1048,44 +1064,20 @@ cb_create_ruby_mt_io_opts(int version, lcb_io_opt_t *io, void *arg)
1048
1064
  }
1049
1065
  ret = calloc(1, sizeof(*ret));
1050
1066
  if (ret == NULL) {
1051
- free(ret);
1052
1067
  return LCB_CLIENT_ENOMEM;
1053
1068
  }
1054
-
1055
- ret->version = 0;
1056
- ret->dlhandle = NULL;
1057
- ret->destructor = lcb_destroy_io_opts;
1058
- /* consider that struct isn't allocated by the library,
1059
- * `need_cleanup' flag might be set in lcb_create() */
1060
- ret->v.v0.need_cleanup = 0;
1061
- lcb_iops_wire_bsd_impl2(&procs, 0);
1062
- ret->v.v0.recv = procs.recv;
1063
- ret->v.v0.recvv = procs.recvv;
1064
- ret->v.v0.send = procs.send;
1065
- ret->v.v0.sendv = procs.sendv;
1066
- ret->v.v0.socket = procs.socket0;
1067
- ret->v.v0.connect = procs.connect0;
1068
- ret->v.v0.close = procs.close;
1069
-
1070
- ret->v.v0.delete_event = lcb_io_delete_event;
1071
- ret->v.v0.destroy_event = lcb_io_destroy_event;
1072
- ret->v.v0.create_event = lcb_io_create_event;
1073
- ret->v.v0.update_event = lcb_io_update_event;
1074
-
1075
- ret->v.v0.delete_timer = lcb_io_delete_timer;
1076
- ret->v.v0.destroy_timer = lcb_io_destroy_timer;
1077
- ret->v.v0.create_timer = lcb_io_create_timer;
1078
- ret->v.v0.update_timer = lcb_io_update_timer;
1079
-
1080
- ret->v.v0.run_event_loop = lcb_io_run_event_loop;
1081
- ret->v.v0.stop_event_loop = lcb_io_stop_event_loop;
1082
-
1083
1069
  loop = loop_create();
1084
1070
  if (loop == NULL) {
1085
1071
  free(ret);
1086
1072
  return LCB_CLIENT_ENOMEM;
1087
1073
  }
1088
- ret->v.v0.cookie = loop;
1074
+
1075
+ ret->dlhandle = NULL;
1076
+ ret->destructor = lcb_destroy_io_opts;
1077
+ LCB_IOPS_BASEFLD(ret, cookie) = loop;
1078
+ ret->version = 2;
1079
+ ret->v.v2.get_procs = iops_getprocs;
1080
+
1089
1081
  *io = ret;
1090
1082
  return LCB_SUCCESS;
1091
1083
  }
@@ -75,7 +75,7 @@ cb_bucket_query(int argc, VALUE *argv, VALUE self)
75
75
  lcb_N1QLPARAMS *params = lcb_n1p_new();
76
76
  lcb_CMDN1QL cmd = { 0 };
77
77
  lcb_error_t rc;
78
- VALUE qstr, proc, opts, args;
78
+ VALUE qstr, proc, args;
79
79
  VALUE exc, rv;
80
80
 
81
81
  rb_scan_args(argc, argv, "1*&", &qstr, &args, &proc);
@@ -17,5 +17,5 @@
17
17
 
18
18
  # Couchbase ruby client
19
19
  module Couchbase
20
- VERSION = '1.3.12'
20
+ VERSION = '1.3.13'
21
21
  end
@@ -137,7 +137,7 @@ task 'package:windows' => ['package', 'lib/couchbase_ext.rb'] do
137
137
  ENV['TARGET'] = platform.name
138
138
  rm_rf('tmp/ ports/')
139
139
  mkdir_p('ports')
140
- recipe = MiniPortile.new('libcouchbase', '2.4.9')
140
+ recipe = MiniPortile.new('libcouchbase', '2.5.0')
141
141
  recipe.host = platform.host
142
142
  recipe.files << "http://packages.couchbase.com/clients/c/libcouchbase-#{recipe.version}.tar.gz"
143
143
  recipe.configure_options.push('--disable-cxx',
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couchbase
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.12
4
+ version: 1.3.13
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Couchbase
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-21 00:00:00.000000000 Z
11
+ date: 2015-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yaji