curb 1.3.3 → 1.3.4
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.
- checksums.yaml +4 -4
- data/ext/curb.h +3 -3
- data/ext/curb_multi.c +46 -14
- data/tests/tc_fiber_scheduler.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 91423579fc22ce296ae84abfa27438de27d2e9bf6da58658ce86939aabecfe86
|
|
4
|
+
data.tar.gz: 46f1a051e546934eee05283bdbed84635ae1be3f46adaf48625140f260feb27f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b863797088f6ade8e6a48c3018a7f24b4469fda0daa35cabdacc826452b31c028ba75a2d0fd9bfefeb90817a39421110979d7013b0a573c7b06016f27e7d93fd
|
|
7
|
+
data.tar.gz: 851be0f60e8e7e53db42f2e6b03742c403c55c7d2242282dd4bab8b77f33c4b0eb206fb221c7f26d26dafa2f6fdddd7a0e84369ca94a0afd038510910cf7d5de
|
data/ext/curb.h
CHANGED
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
#include "curb_macros.h"
|
|
29
29
|
|
|
30
30
|
// These should be managed from the Rake 'release' task.
|
|
31
|
-
#define CURB_VERSION "1.3.
|
|
32
|
-
#define CURB_VER_NUM
|
|
31
|
+
#define CURB_VERSION "1.3.4"
|
|
32
|
+
#define CURB_VER_NUM 1034
|
|
33
33
|
#define CURB_VER_MAJ 1
|
|
34
34
|
#define CURB_VER_MIN 3
|
|
35
|
-
#define CURB_VER_MIC
|
|
35
|
+
#define CURB_VER_MIC 4
|
|
36
36
|
#define CURB_VER_PATCH 0
|
|
37
37
|
|
|
38
38
|
|
data/ext/curb_multi.c
CHANGED
|
@@ -1225,18 +1225,32 @@ static void rb_fdset_from_sockmap(st_table *map, rb_fdset_t *rfds, rb_fdset_t *w
|
|
|
1225
1225
|
*maxfd_out = a.maxfd;
|
|
1226
1226
|
}
|
|
1227
1227
|
|
|
1228
|
-
struct
|
|
1229
|
-
|
|
1228
|
+
struct ready_fd {
|
|
1229
|
+
int fd;
|
|
1230
|
+
int flags;
|
|
1231
|
+
};
|
|
1232
|
+
|
|
1233
|
+
struct collect_ready_fd_args {
|
|
1234
|
+
rb_fdset_t *r;
|
|
1235
|
+
rb_fdset_t *w;
|
|
1236
|
+
rb_fdset_t *e;
|
|
1237
|
+
struct ready_fd *fds;
|
|
1238
|
+
int capacity;
|
|
1239
|
+
int count;
|
|
1240
|
+
};
|
|
1241
|
+
|
|
1242
|
+
static int collect_ready_fd_i(st_data_t key, st_data_t val, st_data_t argp) {
|
|
1230
1243
|
(void)val;
|
|
1231
|
-
struct
|
|
1244
|
+
struct collect_ready_fd_args *a = (struct collect_ready_fd_args *)argp;
|
|
1232
1245
|
int fd = (int)key;
|
|
1233
1246
|
int flags = 0;
|
|
1234
|
-
if (rb_fd_isset(fd,
|
|
1235
|
-
if (rb_fd_isset(fd,
|
|
1236
|
-
if (rb_fd_isset(fd,
|
|
1237
|
-
if (flags) {
|
|
1238
|
-
|
|
1239
|
-
|
|
1247
|
+
if (rb_fd_isset(fd, a->r)) flags |= CURL_CSELECT_IN;
|
|
1248
|
+
if (rb_fd_isset(fd, a->w)) flags |= CURL_CSELECT_OUT;
|
|
1249
|
+
if (rb_fd_isset(fd, a->e)) flags |= CURL_CSELECT_ERR;
|
|
1250
|
+
if (flags && a->count < a->capacity) {
|
|
1251
|
+
a->fds[a->count].fd = fd;
|
|
1252
|
+
a->fds[a->count].flags = flags;
|
|
1253
|
+
a->count++;
|
|
1240
1254
|
}
|
|
1241
1255
|
return ST_CONTINUE;
|
|
1242
1256
|
}
|
|
@@ -1336,12 +1350,25 @@ static void rb_curl_multi_socket_drive(VALUE self, ruby_curl_multi *rbcm, multi_
|
|
|
1336
1350
|
any_ready = (rc > 0);
|
|
1337
1351
|
did_timeout = (rc == 0);
|
|
1338
1352
|
if (any_ready) {
|
|
1339
|
-
struct
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1353
|
+
struct ready_fd *ready_fds = ALLOC_N(struct ready_fd, count_tracked);
|
|
1354
|
+
struct collect_ready_fd_args d;
|
|
1355
|
+
int i;
|
|
1356
|
+
d.r = &rfds;
|
|
1357
|
+
d.w = &wfds;
|
|
1358
|
+
d.e = &efds;
|
|
1359
|
+
d.fds = ready_fds;
|
|
1360
|
+
d.capacity = count_tracked;
|
|
1361
|
+
d.count = 0;
|
|
1362
|
+
st_foreach(ctx->sock_map, collect_ready_fd_i, (st_data_t)&d);
|
|
1363
|
+
for (i = 0; i < d.count; i++) {
|
|
1364
|
+
mrc = curl_multi_socket_action(rbcm->handle, (curl_socket_t)d.fds[i].fd, d.fds[i].flags, &rbcm->running);
|
|
1365
|
+
if (mrc != CURLM_OK) {
|
|
1366
|
+
xfree(ready_fds);
|
|
1367
|
+
rb_fd_term(&rfds); rb_fd_term(&wfds); rb_fd_term(&efds);
|
|
1368
|
+
raise_curl_multi_error_exception(mrc);
|
|
1369
|
+
}
|
|
1344
1370
|
}
|
|
1371
|
+
xfree(ready_fds);
|
|
1345
1372
|
}
|
|
1346
1373
|
rb_fd_term(&rfds); rb_fd_term(&wfds); rb_fd_term(&efds);
|
|
1347
1374
|
handled_wait = 1;
|
|
@@ -1503,6 +1530,10 @@ static VALUE ruby_curl_multi_socket_drive_ensure(VALUE argp) {
|
|
|
1503
1530
|
c->ctx->sock_map = NULL;
|
|
1504
1531
|
}
|
|
1505
1532
|
if (c->ctx) {
|
|
1533
|
+
if (!NIL_P(c->ctx->io_cache)) {
|
|
1534
|
+
rb_hash_clear(c->ctx->io_cache);
|
|
1535
|
+
rb_gc_unregister_address(&c->ctx->io_cache);
|
|
1536
|
+
}
|
|
1506
1537
|
c->ctx->io_cache = Qnil;
|
|
1507
1538
|
}
|
|
1508
1539
|
return Qnil;
|
|
@@ -1523,6 +1554,7 @@ static VALUE ruby_curl_multi_socket_perform_impl(int argc, VALUE *argv, VALUE se
|
|
|
1523
1554
|
ctx.sock_map = st_init_numtable();
|
|
1524
1555
|
ctx.timeout_ms = -1;
|
|
1525
1556
|
ctx.io_cache = rb_hash_new();
|
|
1557
|
+
rb_gc_register_address(&ctx.io_cache);
|
|
1526
1558
|
|
|
1527
1559
|
/* install socket/timer callbacks */
|
|
1528
1560
|
curl_multi_setopt(rbcm->handle, CURLMOPT_SOCKETFUNCTION, multi_socket_cb);
|
data/tests/tc_fiber_scheduler.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: curb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
4
|
+
version: 1.3.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ross Bamford
|
|
8
8
|
- Todd A. Fisher
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-05-
|
|
11
|
+
date: 2026-05-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Curb (probably CUrl-RuBy or something) provides Ruby-language bindings
|
|
14
14
|
for the libcurl(3), a fully-featured client-side URL transfer library. cURL and
|