agoo 2.5.5 → 2.5.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of agoo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +1 -1
- data/ext/agoo/agoo.c +4 -3
- data/ext/agoo/atomic.h +120 -0
- data/ext/agoo/bind.c +52 -52
- data/ext/agoo/bind.h +13 -13
- data/ext/agoo/con.c +499 -481
- data/ext/agoo/con.h +47 -39
- data/ext/agoo/debug.c +42 -42
- data/ext/agoo/debug.h +1 -1
- data/ext/agoo/doc.c +17 -17
- data/ext/agoo/doc.h +12 -12
- data/ext/agoo/err.c +18 -18
- data/ext/agoo/err.h +27 -27
- data/ext/agoo/error_stream.c +9 -9
- data/ext/agoo/extconf.rb +3 -0
- data/ext/agoo/gqlintro.c +43 -43
- data/ext/agoo/gqlintro.h +1 -1
- data/ext/agoo/gqlvalue.c +131 -131
- data/ext/agoo/gqlvalue.h +32 -32
- data/ext/agoo/graphql.c +158 -158
- data/ext/agoo/graphql.h +34 -33
- data/ext/agoo/hook.c +15 -14
- data/ext/agoo/hook.h +18 -14
- data/ext/agoo/http.c +14 -14
- data/ext/agoo/http.h +4 -4
- data/ext/agoo/kinds.h +5 -5
- data/ext/agoo/log.c +232 -224
- data/ext/agoo/log.h +93 -93
- data/ext/agoo/method.h +17 -17
- data/ext/agoo/page.c +88 -86
- data/ext/agoo/page.h +21 -21
- data/ext/agoo/pub.c +36 -36
- data/ext/agoo/pub.h +23 -23
- data/ext/agoo/queue.c +37 -38
- data/ext/agoo/queue.h +20 -19
- data/ext/agoo/rack_logger.c +13 -13
- data/ext/agoo/ready.c +357 -0
- data/ext/agoo/ready.h +41 -0
- data/ext/agoo/req.c +11 -11
- data/ext/agoo/req.h +30 -31
- data/ext/agoo/request.c +46 -46
- data/ext/agoo/request.h +2 -2
- data/ext/agoo/res.c +40 -18
- data/ext/agoo/res.h +14 -14
- data/ext/agoo/response.c +6 -6
- data/ext/agoo/response.h +9 -9
- data/ext/agoo/rhook.c +3 -3
- data/ext/agoo/rhook.h +1 -1
- data/ext/agoo/rlog.c +47 -42
- data/ext/agoo/rlog.h +0 -1
- data/ext/agoo/rresponse.c +33 -33
- data/ext/agoo/rresponse.h +1 -1
- data/ext/agoo/rserver.c +184 -175
- data/ext/agoo/rserver.h +2 -2
- data/ext/agoo/rupgraded.c +41 -41
- data/ext/agoo/rupgraded.h +3 -3
- data/ext/agoo/sdl.c +80 -80
- data/ext/agoo/sdl.h +1 -1
- data/ext/agoo/seg.h +2 -2
- data/ext/agoo/server.c +143 -117
- data/ext/agoo/server.h +43 -42
- data/ext/agoo/sse.c +7 -7
- data/ext/agoo/sse.h +4 -4
- data/ext/agoo/subject.c +5 -5
- data/ext/agoo/subject.h +6 -6
- data/ext/agoo/text.c +21 -21
- data/ext/agoo/text.h +14 -13
- data/ext/agoo/upgraded.c +41 -40
- data/ext/agoo/upgraded.h +41 -40
- data/ext/agoo/websocket.c +42 -42
- data/ext/agoo/websocket.h +16 -16
- data/lib/agoo/version.rb +1 -1
- data/test/static_test.rb +2 -0
- metadata +5 -5
- data/ext/agoo/log_queue.h +0 -30
- data/ext/agoo/sub.c +0 -111
- data/ext/agoo/sub.h +0 -36
data/ext/agoo/ready.h
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
// Copyright (c) 2018, Peter Ohler, All rights reserved.
|
2
|
+
|
3
|
+
#ifndef AGOO_READY_H
|
4
|
+
#define AGOO_READY_H
|
5
|
+
|
6
|
+
#include <stdbool.h>
|
7
|
+
#include <stdint.h>
|
8
|
+
#include <sys/types.h>
|
9
|
+
|
10
|
+
#include "err.h"
|
11
|
+
|
12
|
+
typedef enum {
|
13
|
+
AGOO_READY_NONE = '\0',
|
14
|
+
AGOO_READY_IN = 'i',
|
15
|
+
AGOO_READY_OUT = 'o',
|
16
|
+
AGOO_READY_BOTH = 'b',
|
17
|
+
} agooReadyIO;
|
18
|
+
|
19
|
+
typedef struct _agooReady *agooReady;
|
20
|
+
|
21
|
+
typedef struct _agooHandler {
|
22
|
+
agooReadyIO (*io)(void *ctx);
|
23
|
+
// return false to remove connection
|
24
|
+
bool (*check)(void *ctx, double now);
|
25
|
+
bool (*read)(agooReady ready, void *ctx);
|
26
|
+
bool (*write)(void *ctx);
|
27
|
+
void (*error)(void *ctx);
|
28
|
+
void (*destroy)(void *ctx);
|
29
|
+
} *agooHandler;
|
30
|
+
|
31
|
+
extern agooReady agoo_ready_create(agooErr err);
|
32
|
+
extern void agoo_ready_destroy(agooReady ready);
|
33
|
+
extern int agoo_ready_add(agooErr err,
|
34
|
+
agooReady ready,
|
35
|
+
int fd,
|
36
|
+
agooHandler handler,
|
37
|
+
void *ctx);
|
38
|
+
extern int agoo_ready_go(agooErr err, agooReady ready);
|
39
|
+
extern void agoo_ready_iterate(agooReady ready, void (*cb)(void *ctx, void *arg), void *arg);
|
40
|
+
|
41
|
+
#endif // AGOO_READY_H
|
data/ext/agoo/req.c
CHANGED
@@ -10,15 +10,15 @@
|
|
10
10
|
#include "server.h"
|
11
11
|
#include "req.h"
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
size_t size = mlen + sizeof(struct
|
16
|
-
|
13
|
+
agooReq
|
14
|
+
agoo_req_create(size_t mlen) {
|
15
|
+
size_t size = mlen + sizeof(struct _agooReq) - 7;
|
16
|
+
agooReq req = (agooReq)malloc(size);
|
17
17
|
|
18
18
|
if (NULL != req) {
|
19
19
|
DEBUG_ALLOC(mem_req, req);
|
20
20
|
memset(req, 0, size);
|
21
|
-
req->env =
|
21
|
+
req->env = agoo_server.env_nil_value;
|
22
22
|
req->mlen = mlen;
|
23
23
|
req->hook = NULL;
|
24
24
|
}
|
@@ -26,7 +26,7 @@ req_create(size_t mlen) {
|
|
26
26
|
}
|
27
27
|
|
28
28
|
void
|
29
|
-
|
29
|
+
agoo_req_destroy(agooReq req) {
|
30
30
|
DEBUG_FREE(mem_req, req);
|
31
31
|
if (NULL != req->hook && PUSH_HOOK == req->hook->type) {
|
32
32
|
free(req->hook);
|
@@ -35,11 +35,11 @@ req_destroy(Req req) {
|
|
35
35
|
}
|
36
36
|
|
37
37
|
const char*
|
38
|
-
|
38
|
+
agoo_req_host(agooReq r, int *lenp) {
|
39
39
|
const char *host;
|
40
40
|
const char *colon;
|
41
41
|
|
42
|
-
if (NULL == (host =
|
42
|
+
if (NULL == (host = agoo_con_header_value(r->header.start, r->header.len, "Host", lenp))) {
|
43
43
|
return NULL;
|
44
44
|
}
|
45
45
|
for (colon = host + *lenp - 1; host < colon; colon--) {
|
@@ -54,12 +54,12 @@ req_host(Req r, int *lenp) {
|
|
54
54
|
}
|
55
55
|
|
56
56
|
int
|
57
|
-
|
57
|
+
agoo_req_port(agooReq r) {
|
58
58
|
int len;
|
59
59
|
const char *host;
|
60
60
|
const char *colon;
|
61
61
|
|
62
|
-
if (NULL == (host =
|
62
|
+
if (NULL == (host = agoo_con_header_value(r->header.start, r->header.len, "Host", &len))) {
|
63
63
|
return 0;
|
64
64
|
}
|
65
65
|
for (colon = host + len - 1; host < colon; colon--) {
|
@@ -74,7 +74,7 @@ req_port(Req r) {
|
|
74
74
|
}
|
75
75
|
|
76
76
|
const char*
|
77
|
-
|
77
|
+
agoo_req_query_value(agooReq r, const char *key, int klen, int *vlenp) {
|
78
78
|
const char *value;
|
79
79
|
|
80
80
|
if (NULL != (value = strstr(r->query.start, key))) {
|
data/ext/agoo/req.h
CHANGED
@@ -8,41 +8,40 @@
|
|
8
8
|
#include "hook.h"
|
9
9
|
#include "kinds.h"
|
10
10
|
|
11
|
-
struct
|
12
|
-
struct
|
13
|
-
struct _Res;
|
11
|
+
struct _agooUpgraded;
|
12
|
+
struct _agooRes;
|
14
13
|
|
15
14
|
typedef enum {
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
}
|
15
|
+
AGOO_UP_NONE = '\0',
|
16
|
+
AGOO_UP_WS = 'W',
|
17
|
+
AGOO_UP_SSE = 'S',
|
18
|
+
} agooUpgrade;
|
20
19
|
|
21
|
-
typedef struct
|
20
|
+
typedef struct _agooStr {
|
22
21
|
char *start;
|
23
22
|
unsigned int len;
|
24
|
-
} *
|
25
|
-
|
26
|
-
typedef struct
|
27
|
-
|
28
|
-
struct
|
29
|
-
|
30
|
-
|
31
|
-
struct
|
32
|
-
struct
|
33
|
-
struct
|
34
|
-
struct
|
35
|
-
struct
|
36
|
-
void
|
37
|
-
|
38
|
-
size_t
|
39
|
-
char
|
40
|
-
} *
|
41
|
-
|
42
|
-
extern
|
43
|
-
extern void
|
44
|
-
extern const char*
|
45
|
-
extern int
|
46
|
-
extern const char*
|
23
|
+
} *agooStr;
|
24
|
+
|
25
|
+
typedef struct _agooReq {
|
26
|
+
agooMethod method;
|
27
|
+
struct _agooRes *res;
|
28
|
+
|
29
|
+
agooUpgrade upgrade;
|
30
|
+
struct _agooUpgraded *up;
|
31
|
+
struct _agooStr path;
|
32
|
+
struct _agooStr query;
|
33
|
+
struct _agooStr header;
|
34
|
+
struct _agooStr body;
|
35
|
+
void *env;
|
36
|
+
agooHook hook;
|
37
|
+
size_t mlen; // allocated msg length
|
38
|
+
char msg[8]; // expanded to be full message
|
39
|
+
} *agooReq;
|
40
|
+
|
41
|
+
extern agooReq agoo_req_create(size_t mlen);
|
42
|
+
extern void agoo_req_destroy(agooReq req);
|
43
|
+
extern const char* agoo_req_host(agooReq r, int *lenp);
|
44
|
+
extern int agoo_req_port(agooReq r);
|
45
|
+
extern const char* agoo_req_query_value(agooReq r, const char *key, int klen, int *vlenp);
|
47
46
|
|
48
47
|
#endif // AGOO_REQ_H
|
data/ext/agoo/request.c
CHANGED
@@ -62,21 +62,21 @@ static const char accept_key[] = "Accept";
|
|
62
62
|
static const char event_stream_val[] = "text/event-stream";
|
63
63
|
|
64
64
|
static VALUE
|
65
|
-
req_method(
|
65
|
+
req_method(agooReq r) {
|
66
66
|
VALUE m;
|
67
67
|
|
68
68
|
if (NULL == r) {
|
69
69
|
rb_raise(rb_eArgError, "Request is no longer valid.");
|
70
70
|
}
|
71
71
|
switch (r->method) {
|
72
|
-
case
|
73
|
-
case
|
74
|
-
case
|
75
|
-
case
|
76
|
-
case
|
77
|
-
case
|
78
|
-
case
|
79
|
-
case
|
72
|
+
case AGOO_CONNECT: m = connect_val; break;
|
73
|
+
case AGOO_DELETE: m = delete_val; break;
|
74
|
+
case AGOO_GET: m = get_val; break;
|
75
|
+
case AGOO_HEAD: m = head_val; break;
|
76
|
+
case AGOO_OPTIONS: m = options_val; break;
|
77
|
+
case AGOO_POST: m = post_val; break;
|
78
|
+
case AGOO_PUT: m = put_val; break;
|
79
|
+
case AGOO_PATCH: m = patch_val; break;
|
80
80
|
default: m = Qnil; break;
|
81
81
|
}
|
82
82
|
return m;
|
@@ -90,11 +90,11 @@ req_method(Req r) {
|
|
90
90
|
*/
|
91
91
|
static VALUE
|
92
92
|
method(VALUE self) {
|
93
|
-
return req_method((
|
93
|
+
return req_method((agooReq)DATA_PTR(self));
|
94
94
|
}
|
95
95
|
|
96
96
|
static VALUE
|
97
|
-
req_script_name(
|
97
|
+
req_script_name(agooReq r) {
|
98
98
|
// The logic is a bit tricky here and for path_info. If the HTTP path is /
|
99
99
|
// then the script_name must be empty and the path_info will be /. All
|
100
100
|
// other cases are handled with the full path in script_name and path_info
|
@@ -115,11 +115,11 @@ req_script_name(Req r) {
|
|
115
115
|
*/
|
116
116
|
static VALUE
|
117
117
|
script_name(VALUE self) {
|
118
|
-
return req_script_name((
|
118
|
+
return req_script_name((agooReq)DATA_PTR(self));
|
119
119
|
}
|
120
120
|
|
121
121
|
static VALUE
|
122
|
-
req_path_info(
|
122
|
+
req_path_info(agooReq r) {
|
123
123
|
if (NULL == r) {
|
124
124
|
rb_raise(rb_eArgError, "Request is no longer valid.");
|
125
125
|
}
|
@@ -143,11 +143,11 @@ req_path_info(Req r) {
|
|
143
143
|
*/
|
144
144
|
static VALUE
|
145
145
|
path_info(VALUE self) {
|
146
|
-
return req_path_info((
|
146
|
+
return req_path_info((agooReq)DATA_PTR(self));
|
147
147
|
}
|
148
148
|
|
149
149
|
static VALUE
|
150
|
-
req_query_string(
|
150
|
+
req_query_string(agooReq r) {
|
151
151
|
if (NULL == r) {
|
152
152
|
rb_raise(rb_eArgError, "Request is no longer valid.");
|
153
153
|
}
|
@@ -165,18 +165,18 @@ req_query_string(Req r) {
|
|
165
165
|
*/
|
166
166
|
static VALUE
|
167
167
|
query_string(VALUE self) {
|
168
|
-
return req_query_string((
|
168
|
+
return req_query_string((agooReq)DATA_PTR(self));
|
169
169
|
}
|
170
170
|
|
171
171
|
static VALUE
|
172
|
-
req_server_name(
|
172
|
+
req_server_name(agooReq r) {
|
173
173
|
int len;
|
174
174
|
const char *host;
|
175
175
|
|
176
176
|
if (NULL == r) {
|
177
177
|
rb_raise(rb_eArgError, "Request is no longer valid.");
|
178
178
|
}
|
179
|
-
if (NULL == (host =
|
179
|
+
if (NULL == (host = agoo_req_host(r, &len))) {
|
180
180
|
return rb_str_new2("unknown");
|
181
181
|
}
|
182
182
|
return rb_str_new(host, len);
|
@@ -190,11 +190,11 @@ req_server_name(Req r) {
|
|
190
190
|
*/
|
191
191
|
static VALUE
|
192
192
|
server_name(VALUE self) {
|
193
|
-
return req_server_name((
|
193
|
+
return req_server_name((agooReq)DATA_PTR(self));
|
194
194
|
}
|
195
195
|
|
196
196
|
static VALUE
|
197
|
-
req_server_port(
|
197
|
+
req_server_port(agooReq r) {
|
198
198
|
int len;
|
199
199
|
const char *host;
|
200
200
|
const char *colon;
|
@@ -202,7 +202,7 @@ req_server_port(Req r) {
|
|
202
202
|
if (NULL == r) {
|
203
203
|
rb_raise(rb_eArgError, "Request is no longer valid.");
|
204
204
|
}
|
205
|
-
if (NULL == (host =
|
205
|
+
if (NULL == (host = agoo_con_header_value(r->header.start, r->header.len, "Host", &len))) {
|
206
206
|
return Qnil;
|
207
207
|
}
|
208
208
|
for (colon = host + len - 1; host < colon; colon--) {
|
@@ -224,14 +224,14 @@ req_server_port(Req r) {
|
|
224
224
|
*/
|
225
225
|
static VALUE
|
226
226
|
server_port(VALUE self) {
|
227
|
-
return req_server_port((
|
227
|
+
return req_server_port((agooReq)DATA_PTR(self));
|
228
228
|
}
|
229
229
|
|
230
230
|
static VALUE
|
231
|
-
req_rack_upgrade(
|
231
|
+
req_rack_upgrade(agooReq r) {
|
232
232
|
switch (r->upgrade) {
|
233
|
-
case
|
234
|
-
case
|
233
|
+
case AGOO_UP_WS: return websocket_sym;
|
234
|
+
case AGOO_UP_SSE: return sse_sym;
|
235
235
|
default: return Qnil;
|
236
236
|
}
|
237
237
|
}
|
@@ -244,7 +244,7 @@ req_rack_upgrade(Req r) {
|
|
244
244
|
*/
|
245
245
|
static VALUE
|
246
246
|
rack_upgrade(VALUE self) {
|
247
|
-
return req_rack_upgrade((
|
247
|
+
return req_rack_upgrade((agooReq)DATA_PTR(self));
|
248
248
|
}
|
249
249
|
|
250
250
|
/* Document-method: rack_version
|
@@ -259,7 +259,7 @@ rack_version(VALUE self) {
|
|
259
259
|
}
|
260
260
|
|
261
261
|
static VALUE
|
262
|
-
req_rack_url_scheme(
|
262
|
+
req_rack_url_scheme(agooReq r) {
|
263
263
|
// TBD http or https when ssl is supported
|
264
264
|
return http_val;
|
265
265
|
}
|
@@ -272,11 +272,11 @@ req_rack_url_scheme(Req r) {
|
|
272
272
|
*/
|
273
273
|
static VALUE
|
274
274
|
rack_url_scheme(VALUE self) {
|
275
|
-
return req_rack_url_scheme((
|
275
|
+
return req_rack_url_scheme((agooReq)DATA_PTR(self));
|
276
276
|
}
|
277
277
|
|
278
278
|
static VALUE
|
279
|
-
req_rack_input(
|
279
|
+
req_rack_input(agooReq r) {
|
280
280
|
if (NULL == r) {
|
281
281
|
rb_raise(rb_eArgError, "Request is no longer valid.");
|
282
282
|
}
|
@@ -295,11 +295,11 @@ req_rack_input(Req r) {
|
|
295
295
|
*/
|
296
296
|
static VALUE
|
297
297
|
rack_input(VALUE self) {
|
298
|
-
return req_rack_input((
|
298
|
+
return req_rack_input((agooReq)DATA_PTR(self));
|
299
299
|
}
|
300
300
|
|
301
301
|
static VALUE
|
302
|
-
req_rack_errors(
|
302
|
+
req_rack_errors(agooReq r) {
|
303
303
|
return error_stream_new();
|
304
304
|
}
|
305
305
|
|
@@ -312,15 +312,15 @@ req_rack_errors(Req r) {
|
|
312
312
|
*/
|
313
313
|
static VALUE
|
314
314
|
rack_errors(VALUE self) {
|
315
|
-
return req_rack_errors((
|
315
|
+
return req_rack_errors((agooReq)DATA_PTR(self));
|
316
316
|
}
|
317
317
|
|
318
318
|
static VALUE
|
319
|
-
req_rack_multithread(
|
319
|
+
req_rack_multithread(agooReq r) {
|
320
320
|
if (NULL == r) {
|
321
321
|
rb_raise(rb_eArgError, "Request is no longer valid.");
|
322
322
|
}
|
323
|
-
if (1 <
|
323
|
+
if (1 < agoo_server.thread_cnt) {
|
324
324
|
return Qtrue;
|
325
325
|
}
|
326
326
|
return Qfalse;
|
@@ -334,7 +334,7 @@ req_rack_multithread(Req r) {
|
|
334
334
|
*/
|
335
335
|
static VALUE
|
336
336
|
rack_multithread(VALUE self) {
|
337
|
-
return req_rack_multithread((
|
337
|
+
return req_rack_multithread((agooReq)DATA_PTR(self));
|
338
338
|
}
|
339
339
|
|
340
340
|
/* Document-method: rack_multiprocess
|
@@ -394,7 +394,7 @@ add_header_value(VALUE hh, const char *key, int klen, const char *val, int vlen)
|
|
394
394
|
|
395
395
|
// TBD req.c
|
396
396
|
static void
|
397
|
-
fill_headers(
|
397
|
+
fill_headers(agooReq r, VALUE hash) {
|
398
398
|
char *h = r->header.start;
|
399
399
|
char *end = h + r->header.len + 1; // +1 for last \r
|
400
400
|
char *key = h;
|
@@ -448,7 +448,7 @@ fill_headers(Req r, VALUE hash) {
|
|
448
448
|
} else if (sizeof(accept_key) - 1 == klen && 0 == strncasecmp(key, accept_key, sizeof(accept_key) - 1)) {
|
449
449
|
if (sizeof(event_stream_val) - 1 == vend - val &&
|
450
450
|
0 == strncasecmp(val, event_stream_val, sizeof(event_stream_val) - 1)) {
|
451
|
-
r->upgrade =
|
451
|
+
r->upgrade = AGOO_UP_SSE;
|
452
452
|
}
|
453
453
|
}
|
454
454
|
key = h + 1;
|
@@ -461,7 +461,7 @@ fill_headers(Req r, VALUE hash) {
|
|
461
461
|
}
|
462
462
|
}
|
463
463
|
if (upgrade && ws) {
|
464
|
-
r->upgrade =
|
464
|
+
r->upgrade = AGOO_UP_WS;
|
465
465
|
}
|
466
466
|
}
|
467
467
|
|
@@ -473,7 +473,7 @@ fill_headers(Req r, VALUE hash) {
|
|
473
473
|
*/
|
474
474
|
static VALUE
|
475
475
|
headers(VALUE self) {
|
476
|
-
|
476
|
+
agooReq r = DATA_PTR(self);
|
477
477
|
volatile VALUE h;
|
478
478
|
|
479
479
|
if (NULL == r) {
|
@@ -494,7 +494,7 @@ headers(VALUE self) {
|
|
494
494
|
*/
|
495
495
|
static VALUE
|
496
496
|
body(VALUE self) {
|
497
|
-
|
497
|
+
agooReq r = DATA_PTR(self);
|
498
498
|
|
499
499
|
if (NULL == r) {
|
500
500
|
rb_raise(rb_eArgError, "Request is no longer valid.");
|
@@ -506,7 +506,7 @@ body(VALUE self) {
|
|
506
506
|
}
|
507
507
|
|
508
508
|
static VALUE
|
509
|
-
req_rack_logger(
|
509
|
+
req_rack_logger(agooReq req) {
|
510
510
|
return rack_logger_new();
|
511
511
|
}
|
512
512
|
|
@@ -521,7 +521,7 @@ req_rack_logger(Req req) {
|
|
521
521
|
*/
|
522
522
|
static VALUE
|
523
523
|
rack_logger(VALUE self) {
|
524
|
-
return req_rack_logger((
|
524
|
+
return req_rack_logger((agooReq)DATA_PTR(self));
|
525
525
|
}
|
526
526
|
|
527
527
|
/* Document-class: Agoo::Request
|
@@ -530,7 +530,7 @@ rack_logger(VALUE self) {
|
|
530
530
|
* request is a more efficient encapsulation of the rack environment.
|
531
531
|
*/
|
532
532
|
VALUE
|
533
|
-
request_env(
|
533
|
+
request_env(agooReq req, VALUE self) {
|
534
534
|
if (Qnil == (VALUE)req->env) {
|
535
535
|
volatile VALUE env = rb_hash_new();
|
536
536
|
|
@@ -580,7 +580,7 @@ request_env(Req req, VALUE self) {
|
|
580
580
|
*/
|
581
581
|
static VALUE
|
582
582
|
to_h(VALUE self) {
|
583
|
-
|
583
|
+
agooReq r = DATA_PTR(self);
|
584
584
|
|
585
585
|
if (NULL == r) {
|
586
586
|
rb_raise(rb_eArgError, "Request is no longer valid.");
|
@@ -609,7 +609,7 @@ to_s(VALUE self) {
|
|
609
609
|
*/
|
610
610
|
static VALUE
|
611
611
|
call(VALUE self) {
|
612
|
-
|
612
|
+
agooReq r = DATA_PTR(self);
|
613
613
|
VALUE args[1];
|
614
614
|
volatile VALUE io;
|
615
615
|
|
@@ -630,7 +630,7 @@ call(VALUE self) {
|
|
630
630
|
}
|
631
631
|
|
632
632
|
VALUE
|
633
|
-
request_wrap(
|
633
|
+
request_wrap(agooReq req) {
|
634
634
|
// freed from the C side of things
|
635
635
|
return Data_Wrap_Struct(req_class, NULL, NULL, req);
|
636
636
|
}
|