isomorfeus-iodine 0.7.49 → 0.7.50
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +1 -1
- data/CHANGELOG.md +17 -3
- data/Rakefile +1 -9
- data/examples/etag.ru +16 -0
- data/ext/{iodine → iodine_ext}/extconf.rb +1 -1
- data/ext/{iodine → iodine_ext}/fio.c +0 -0
- data/ext/{iodine → iodine_ext}/fio.h +0 -0
- data/ext/{iodine → iodine_ext}/fio_cli.c +0 -0
- data/ext/{iodine → iodine_ext}/fio_cli.h +189 -189
- data/ext/{iodine → iodine_ext}/fio_json_parser.h +687 -687
- data/ext/{iodine → iodine_ext}/fio_siphash.c +157 -157
- data/ext/{iodine → iodine_ext}/fio_siphash.h +37 -37
- data/ext/{iodine → iodine_ext}/fio_tls.h +129 -129
- data/ext/{iodine → iodine_ext}/fio_tls_missing.c +0 -0
- data/ext/{iodine → iodine_ext}/fio_tls_openssl.c +0 -0
- data/ext/{iodine → iodine_ext}/fio_tmpfile.h +0 -0
- data/ext/{iodine → iodine_ext}/fiobj.h +44 -44
- data/ext/{iodine → iodine_ext}/fiobj4fio.h +21 -21
- data/ext/{iodine → iodine_ext}/fiobj_ary.c +333 -333
- data/ext/{iodine → iodine_ext}/fiobj_ary.h +139 -139
- data/ext/{iodine → iodine_ext}/fiobj_data.c +0 -0
- data/ext/{iodine → iodine_ext}/fiobj_data.h +0 -0
- data/ext/{iodine → iodine_ext}/fiobj_hash.c +0 -0
- data/ext/{iodine → iodine_ext}/fiobj_hash.h +176 -176
- data/ext/{iodine → iodine_ext}/fiobj_json.c +622 -622
- data/ext/{iodine → iodine_ext}/fiobj_json.h +68 -68
- data/ext/{iodine → iodine_ext}/fiobj_mem.h +71 -71
- data/ext/{iodine → iodine_ext}/fiobj_mustache.c +0 -0
- data/ext/{iodine → iodine_ext}/fiobj_mustache.h +62 -62
- data/ext/{iodine → iodine_ext}/fiobj_numbers.c +0 -0
- data/ext/{iodine → iodine_ext}/fiobj_numbers.h +127 -127
- data/ext/{iodine → iodine_ext}/fiobj_str.c +0 -0
- data/ext/{iodine → iodine_ext}/fiobj_str.h +172 -172
- data/ext/{iodine → iodine_ext}/fiobject.c +0 -0
- data/ext/{iodine → iodine_ext}/fiobject.h +0 -0
- data/ext/{iodine → iodine_ext}/hpack.h +1923 -1923
- data/ext/{iodine → iodine_ext}/http.c +14 -27
- data/ext/{iodine → iodine_ext}/http.h +1002 -1002
- data/ext/{iodine → iodine_ext}/http1.c +0 -0
- data/ext/{iodine → iodine_ext}/http1.h +29 -29
- data/ext/{iodine → iodine_ext}/http1_parser.h +0 -0
- data/ext/{iodine → iodine_ext}/http_internal.c +0 -0
- data/ext/{iodine → iodine_ext}/http_internal.h +0 -0
- data/ext/{iodine → iodine_ext}/http_mime_parser.h +350 -350
- data/ext/{iodine → iodine_ext}/iodine.c +1 -1
- data/ext/{iodine → iodine_ext}/iodine.h +0 -0
- data/ext/{iodine → iodine_ext}/iodine_caller.c +0 -0
- data/ext/{iodine → iodine_ext}/iodine_caller.h +0 -0
- data/ext/{iodine → iodine_ext}/iodine_connection.c +0 -0
- data/ext/{iodine → iodine_ext}/iodine_connection.h +55 -55
- data/ext/{iodine → iodine_ext}/iodine_defer.c +0 -0
- data/ext/{iodine → iodine_ext}/iodine_defer.h +6 -6
- data/ext/{iodine → iodine_ext}/iodine_fiobj2rb.h +120 -120
- data/ext/{iodine → iodine_ext}/iodine_helpers.c +0 -0
- data/ext/{iodine → iodine_ext}/iodine_helpers.h +12 -12
- data/ext/{iodine → iodine_ext}/iodine_http.c +0 -2
- data/ext/{iodine → iodine_ext}/iodine_http.h +23 -23
- data/ext/{iodine → iodine_ext}/iodine_json.c +302 -302
- data/ext/{iodine → iodine_ext}/iodine_json.h +6 -6
- data/ext/{iodine → iodine_ext}/iodine_mustache.c +0 -0
- data/ext/{iodine → iodine_ext}/iodine_mustache.h +6 -6
- data/ext/{iodine → iodine_ext}/iodine_pubsub.c +0 -0
- data/ext/{iodine → iodine_ext}/iodine_pubsub.h +26 -26
- data/ext/{iodine → iodine_ext}/iodine_rack_io.c +0 -0
- data/ext/{iodine → iodine_ext}/iodine_rack_io.h +20 -20
- data/ext/{iodine → iodine_ext}/iodine_store.c +0 -0
- data/ext/{iodine → iodine_ext}/iodine_store.h +20 -20
- data/ext/{iodine → iodine_ext}/iodine_tcp.c +0 -0
- data/ext/{iodine → iodine_ext}/iodine_tcp.h +0 -0
- data/ext/{iodine → iodine_ext}/iodine_tls.c +0 -0
- data/ext/{iodine → iodine_ext}/iodine_tls.h +13 -13
- data/ext/{iodine → iodine_ext}/mustache_parser.h +0 -0
- data/ext/{iodine → iodine_ext}/redis_engine.c +0 -0
- data/ext/{iodine → iodine_ext}/redis_engine.h +0 -0
- data/ext/{iodine → iodine_ext}/resp_parser.h +0 -0
- data/ext/{iodine → iodine_ext}/websocket_parser.h +505 -505
- data/ext/{iodine → iodine_ext}/websockets.c +0 -0
- data/ext/{iodine → iodine_ext}/websockets.h +185 -185
- data/isomorfeus-iodine.gemspec +1 -2
- data/lib/iodine/version.rb +1 -1
- data/lib/iodine.rb +1 -1
- metadata +79 -78
@@ -1325,7 +1325,7 @@ Ruby loads the library and invokes the Init_<lib_name> function...
|
|
1325
1325
|
Here we connect all the C code to the Ruby interface, completing the bridge
|
1326
1326
|
between Lib-Server and Ruby.
|
1327
1327
|
***************************************************************************** */
|
1328
|
-
void
|
1328
|
+
void Init_iodine_ext(void) {
|
1329
1329
|
/* common Symbol objects in use by Iodine */
|
1330
1330
|
#define IODINE_MAKE_SYM(name) \
|
1331
1331
|
do { \
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,55 +1,55 @@
|
|
1
|
-
#ifndef H_IODINE_CONNECTION_H
|
2
|
-
#define H_IODINE_CONNECTION_H
|
3
|
-
|
4
|
-
#include "iodine.h"
|
5
|
-
|
6
|
-
typedef enum {
|
7
|
-
IODINE_CONNECTION_RAW,
|
8
|
-
IODINE_CONNECTION_WEBSOCKET,
|
9
|
-
IODINE_CONNECTION_SSE
|
10
|
-
} iodine_connection_type_e;
|
11
|
-
|
12
|
-
typedef struct {
|
13
|
-
iodine_connection_type_e type;
|
14
|
-
intptr_t uuid;
|
15
|
-
void *arg; /* holds the connection pointer (ws_s / sse_s) */
|
16
|
-
VALUE handler;
|
17
|
-
VALUE env;
|
18
|
-
} iodine_connection_s;
|
19
|
-
|
20
|
-
/**
|
21
|
-
* Creates a new connection object.
|
22
|
-
*/
|
23
|
-
VALUE iodine_connection_new(iodine_connection_s args);
|
24
|
-
#define iodine_connection_new(...) \
|
25
|
-
iodine_connection_new((iodine_connection_s){__VA_ARGS__})
|
26
|
-
|
27
|
-
typedef enum {
|
28
|
-
IODINE_CONNECTION_ON_OPEN,
|
29
|
-
IODINE_CONNECTION_ON_MESSAGE,
|
30
|
-
IODINE_CONNECTION_ON_DRAINED,
|
31
|
-
IODINE_CONNECTION_PING,
|
32
|
-
IODINE_CONNECTION_ON_SHUTDOWN,
|
33
|
-
IODINE_CONNECTION_ON_CLOSE
|
34
|
-
} iodine_connection_event_type_e;
|
35
|
-
|
36
|
-
/**
|
37
|
-
* Fires a connection object's event. `data` is only for the on_message event.
|
38
|
-
*/
|
39
|
-
void iodine_connection_fire_event(VALUE connection,
|
40
|
-
iodine_connection_event_type_e ev,
|
41
|
-
VALUE data);
|
42
|
-
|
43
|
-
/** Initializes the Connection Ruby class. */
|
44
|
-
void iodine_connection_init(void);
|
45
|
-
|
46
|
-
extern const rb_data_type_t iodine_connection_data_type;
|
47
|
-
|
48
|
-
static inline iodine_connection_s *iodine_connection_CData(VALUE self) {
|
49
|
-
iodine_connection_s *c = NULL;
|
50
|
-
TypedData_Get_Struct(self, iodine_connection_s, &iodine_connection_data_type,
|
51
|
-
c);
|
52
|
-
return c;
|
53
|
-
}
|
54
|
-
|
55
|
-
#endif
|
1
|
+
#ifndef H_IODINE_CONNECTION_H
|
2
|
+
#define H_IODINE_CONNECTION_H
|
3
|
+
|
4
|
+
#include "iodine.h"
|
5
|
+
|
6
|
+
typedef enum {
|
7
|
+
IODINE_CONNECTION_RAW,
|
8
|
+
IODINE_CONNECTION_WEBSOCKET,
|
9
|
+
IODINE_CONNECTION_SSE
|
10
|
+
} iodine_connection_type_e;
|
11
|
+
|
12
|
+
typedef struct {
|
13
|
+
iodine_connection_type_e type;
|
14
|
+
intptr_t uuid;
|
15
|
+
void *arg; /* holds the connection pointer (ws_s / sse_s) */
|
16
|
+
VALUE handler;
|
17
|
+
VALUE env;
|
18
|
+
} iodine_connection_s;
|
19
|
+
|
20
|
+
/**
|
21
|
+
* Creates a new connection object.
|
22
|
+
*/
|
23
|
+
VALUE iodine_connection_new(iodine_connection_s args);
|
24
|
+
#define iodine_connection_new(...) \
|
25
|
+
iodine_connection_new((iodine_connection_s){__VA_ARGS__})
|
26
|
+
|
27
|
+
typedef enum {
|
28
|
+
IODINE_CONNECTION_ON_OPEN,
|
29
|
+
IODINE_CONNECTION_ON_MESSAGE,
|
30
|
+
IODINE_CONNECTION_ON_DRAINED,
|
31
|
+
IODINE_CONNECTION_PING,
|
32
|
+
IODINE_CONNECTION_ON_SHUTDOWN,
|
33
|
+
IODINE_CONNECTION_ON_CLOSE
|
34
|
+
} iodine_connection_event_type_e;
|
35
|
+
|
36
|
+
/**
|
37
|
+
* Fires a connection object's event. `data` is only for the on_message event.
|
38
|
+
*/
|
39
|
+
void iodine_connection_fire_event(VALUE connection,
|
40
|
+
iodine_connection_event_type_e ev,
|
41
|
+
VALUE data);
|
42
|
+
|
43
|
+
/** Initializes the Connection Ruby class. */
|
44
|
+
void iodine_connection_init(void);
|
45
|
+
|
46
|
+
extern const rb_data_type_t iodine_connection_data_type;
|
47
|
+
|
48
|
+
static inline iodine_connection_s *iodine_connection_CData(VALUE self) {
|
49
|
+
iodine_connection_s *c = NULL;
|
50
|
+
TypedData_Get_Struct(self, iodine_connection_s, &iodine_connection_data_type,
|
51
|
+
c);
|
52
|
+
return c;
|
53
|
+
}
|
54
|
+
|
55
|
+
#endif
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
|
-
#ifndef H_IODINE_DEFER_H
|
2
|
-
#define H_IODINE_DEFER_H
|
3
|
-
|
4
|
-
void iodine_defer_initialize(void);
|
5
|
-
|
6
|
-
#endif
|
1
|
+
#ifndef H_IODINE_DEFER_H
|
2
|
+
#define H_IODINE_DEFER_H
|
3
|
+
|
4
|
+
void iodine_defer_initialize(void);
|
5
|
+
|
6
|
+
#endif
|
@@ -1,120 +1,120 @@
|
|
1
|
-
#ifndef H_RB_FIOBJ2RUBY_H
|
2
|
-
/*
|
3
|
-
Copyright: Boaz segev, 2016-2017
|
4
|
-
License: MIT
|
5
|
-
|
6
|
-
Feel free to copy, use and enjoy according to the license provided.
|
7
|
-
*/
|
8
|
-
#define H_RB_FIOBJ2RUBY_H
|
9
|
-
#include <fiobj.h>
|
10
|
-
#include <ruby.h>
|
11
|
-
|
12
|
-
#include "iodine_store.h"
|
13
|
-
|
14
|
-
typedef struct {
|
15
|
-
FIOBJ stack;
|
16
|
-
uintptr_t count;
|
17
|
-
VALUE rb;
|
18
|
-
uint8_t str2sym;
|
19
|
-
} fiobj2rb_s;
|
20
|
-
|
21
|
-
typedef struct {
|
22
|
-
uint8_t str2sym;
|
23
|
-
} fiobj2rb_settings_s;
|
24
|
-
|
25
|
-
static inline VALUE fiobj2rb(FIOBJ o, uint8_t str2sym) {
|
26
|
-
VALUE rb;
|
27
|
-
if (!o)
|
28
|
-
return Qnil;
|
29
|
-
switch (FIOBJ_TYPE(o)) {
|
30
|
-
case FIOBJ_T_NUMBER:
|
31
|
-
rb = LONG2FIX(fiobj_obj2num(o));
|
32
|
-
break;
|
33
|
-
case FIOBJ_T_TRUE:
|
34
|
-
rb = Qtrue;
|
35
|
-
break;
|
36
|
-
case FIOBJ_T_FALSE:
|
37
|
-
rb = Qfalse;
|
38
|
-
break;
|
39
|
-
case FIOBJ_T_FLOAT:
|
40
|
-
rb = rb_float_new(fiobj_obj2float(o));
|
41
|
-
break;
|
42
|
-
case FIOBJ_T_DATA: /* fallthrough */
|
43
|
-
case FIOBJ_T_UNKNOWN: /* fallthrough */
|
44
|
-
case FIOBJ_T_STRING: {
|
45
|
-
fio_str_info_s tmp = fiobj_obj2cstr(o);
|
46
|
-
if (str2sym) {
|
47
|
-
rb = rb_intern2(tmp.data, tmp.len);
|
48
|
-
rb = ID2SYM(rb);
|
49
|
-
} else {
|
50
|
-
rb = rb_str_new(tmp.data, tmp.len);
|
51
|
-
}
|
52
|
-
|
53
|
-
} break;
|
54
|
-
case FIOBJ_T_ARRAY:
|
55
|
-
rb = rb_ary_new();
|
56
|
-
break;
|
57
|
-
case FIOBJ_T_HASH:
|
58
|
-
rb = rb_hash_new();
|
59
|
-
break;
|
60
|
-
case FIOBJ_T_NULL: /* fallthrough */
|
61
|
-
default:
|
62
|
-
rb = Qnil;
|
63
|
-
break;
|
64
|
-
};
|
65
|
-
return rb;
|
66
|
-
}
|
67
|
-
|
68
|
-
static int fiobj2rb_task(FIOBJ o, void *data_) {
|
69
|
-
fiobj2rb_s *data = data_;
|
70
|
-
VALUE rb_tmp;
|
71
|
-
rb_tmp = fiobj2rb(o, 0);
|
72
|
-
IodineStore.add(rb_tmp);
|
73
|
-
if (data->rb) {
|
74
|
-
if (RB_TYPE_P(data->rb, T_HASH)) {
|
75
|
-
rb_hash_aset(data->rb, fiobj2rb(fiobj_hash_key_in_loop(), data->str2sym),
|
76
|
-
rb_tmp);
|
77
|
-
} else {
|
78
|
-
rb_ary_push(data->rb, rb_tmp);
|
79
|
-
}
|
80
|
-
--(data->count);
|
81
|
-
IodineStore.remove(rb_tmp);
|
82
|
-
} else {
|
83
|
-
data->rb = rb_tmp;
|
84
|
-
// IodineStore.add(rb_tmp);
|
85
|
-
}
|
86
|
-
if (FIOBJ_TYPE_IS(o, FIOBJ_T_ARRAY)) {
|
87
|
-
fiobj_ary_push(data->stack, (FIOBJ)data->count);
|
88
|
-
fiobj_ary_push(data->stack, (FIOBJ)data->rb);
|
89
|
-
data->count = fiobj_ary_count(o);
|
90
|
-
data->rb = rb_tmp;
|
91
|
-
} else if (FIOBJ_TYPE_IS(o, FIOBJ_T_HASH)) {
|
92
|
-
fiobj_ary_push(data->stack, (FIOBJ)data->count);
|
93
|
-
fiobj_ary_push(data->stack, (FIOBJ)data->rb);
|
94
|
-
data->count = fiobj_hash_count(o);
|
95
|
-
data->rb = rb_tmp;
|
96
|
-
}
|
97
|
-
while (data->count == 0 && fiobj_ary_count(data->stack)) {
|
98
|
-
data->rb = fiobj_ary_pop(data->stack);
|
99
|
-
data->count = fiobj_ary_pop(data->stack);
|
100
|
-
}
|
101
|
-
return 0;
|
102
|
-
}
|
103
|
-
|
104
|
-
static inline VALUE fiobj2rb_deep(FIOBJ obj, uint8_t str2sym) {
|
105
|
-
fiobj2rb_s data = {.stack = fiobj_ary_new2(4), .str2sym = str2sym};
|
106
|
-
|
107
|
-
/* deep copy */
|
108
|
-
fiobj_each2(obj, fiobj2rb_task, &data);
|
109
|
-
/* cleanup (shouldn't happen, but what the hell)... */
|
110
|
-
while (fiobj_ary_pop(data.stack))
|
111
|
-
;
|
112
|
-
fiobj_free(data.stack);
|
113
|
-
// IodineStore.remove(data.rb); // don't remove data
|
114
|
-
return data.rb;
|
115
|
-
}
|
116
|
-
|
117
|
-
// require 'iodine'
|
118
|
-
// Iodine::JSON.parse "{\"1\":[1,2,3,4]}"
|
119
|
-
// Iodine::JSON.parse IO.binread("")
|
120
|
-
#endif /* H_RB_FIOBJ2RUBY_H */
|
1
|
+
#ifndef H_RB_FIOBJ2RUBY_H
|
2
|
+
/*
|
3
|
+
Copyright: Boaz segev, 2016-2017
|
4
|
+
License: MIT
|
5
|
+
|
6
|
+
Feel free to copy, use and enjoy according to the license provided.
|
7
|
+
*/
|
8
|
+
#define H_RB_FIOBJ2RUBY_H
|
9
|
+
#include <fiobj.h>
|
10
|
+
#include <ruby.h>
|
11
|
+
|
12
|
+
#include "iodine_store.h"
|
13
|
+
|
14
|
+
typedef struct {
|
15
|
+
FIOBJ stack;
|
16
|
+
uintptr_t count;
|
17
|
+
VALUE rb;
|
18
|
+
uint8_t str2sym;
|
19
|
+
} fiobj2rb_s;
|
20
|
+
|
21
|
+
typedef struct {
|
22
|
+
uint8_t str2sym;
|
23
|
+
} fiobj2rb_settings_s;
|
24
|
+
|
25
|
+
static inline VALUE fiobj2rb(FIOBJ o, uint8_t str2sym) {
|
26
|
+
VALUE rb;
|
27
|
+
if (!o)
|
28
|
+
return Qnil;
|
29
|
+
switch (FIOBJ_TYPE(o)) {
|
30
|
+
case FIOBJ_T_NUMBER:
|
31
|
+
rb = LONG2FIX(fiobj_obj2num(o));
|
32
|
+
break;
|
33
|
+
case FIOBJ_T_TRUE:
|
34
|
+
rb = Qtrue;
|
35
|
+
break;
|
36
|
+
case FIOBJ_T_FALSE:
|
37
|
+
rb = Qfalse;
|
38
|
+
break;
|
39
|
+
case FIOBJ_T_FLOAT:
|
40
|
+
rb = rb_float_new(fiobj_obj2float(o));
|
41
|
+
break;
|
42
|
+
case FIOBJ_T_DATA: /* fallthrough */
|
43
|
+
case FIOBJ_T_UNKNOWN: /* fallthrough */
|
44
|
+
case FIOBJ_T_STRING: {
|
45
|
+
fio_str_info_s tmp = fiobj_obj2cstr(o);
|
46
|
+
if (str2sym) {
|
47
|
+
rb = rb_intern2(tmp.data, tmp.len);
|
48
|
+
rb = ID2SYM(rb);
|
49
|
+
} else {
|
50
|
+
rb = rb_str_new(tmp.data, tmp.len);
|
51
|
+
}
|
52
|
+
|
53
|
+
} break;
|
54
|
+
case FIOBJ_T_ARRAY:
|
55
|
+
rb = rb_ary_new();
|
56
|
+
break;
|
57
|
+
case FIOBJ_T_HASH:
|
58
|
+
rb = rb_hash_new();
|
59
|
+
break;
|
60
|
+
case FIOBJ_T_NULL: /* fallthrough */
|
61
|
+
default:
|
62
|
+
rb = Qnil;
|
63
|
+
break;
|
64
|
+
};
|
65
|
+
return rb;
|
66
|
+
}
|
67
|
+
|
68
|
+
static int fiobj2rb_task(FIOBJ o, void *data_) {
|
69
|
+
fiobj2rb_s *data = data_;
|
70
|
+
VALUE rb_tmp;
|
71
|
+
rb_tmp = fiobj2rb(o, 0);
|
72
|
+
IodineStore.add(rb_tmp);
|
73
|
+
if (data->rb) {
|
74
|
+
if (RB_TYPE_P(data->rb, T_HASH)) {
|
75
|
+
rb_hash_aset(data->rb, fiobj2rb(fiobj_hash_key_in_loop(), data->str2sym),
|
76
|
+
rb_tmp);
|
77
|
+
} else {
|
78
|
+
rb_ary_push(data->rb, rb_tmp);
|
79
|
+
}
|
80
|
+
--(data->count);
|
81
|
+
IodineStore.remove(rb_tmp);
|
82
|
+
} else {
|
83
|
+
data->rb = rb_tmp;
|
84
|
+
// IodineStore.add(rb_tmp);
|
85
|
+
}
|
86
|
+
if (FIOBJ_TYPE_IS(o, FIOBJ_T_ARRAY)) {
|
87
|
+
fiobj_ary_push(data->stack, (FIOBJ)data->count);
|
88
|
+
fiobj_ary_push(data->stack, (FIOBJ)data->rb);
|
89
|
+
data->count = fiobj_ary_count(o);
|
90
|
+
data->rb = rb_tmp;
|
91
|
+
} else if (FIOBJ_TYPE_IS(o, FIOBJ_T_HASH)) {
|
92
|
+
fiobj_ary_push(data->stack, (FIOBJ)data->count);
|
93
|
+
fiobj_ary_push(data->stack, (FIOBJ)data->rb);
|
94
|
+
data->count = fiobj_hash_count(o);
|
95
|
+
data->rb = rb_tmp;
|
96
|
+
}
|
97
|
+
while (data->count == 0 && fiobj_ary_count(data->stack)) {
|
98
|
+
data->rb = fiobj_ary_pop(data->stack);
|
99
|
+
data->count = fiobj_ary_pop(data->stack);
|
100
|
+
}
|
101
|
+
return 0;
|
102
|
+
}
|
103
|
+
|
104
|
+
static inline VALUE fiobj2rb_deep(FIOBJ obj, uint8_t str2sym) {
|
105
|
+
fiobj2rb_s data = {.stack = fiobj_ary_new2(4), .str2sym = str2sym};
|
106
|
+
|
107
|
+
/* deep copy */
|
108
|
+
fiobj_each2(obj, fiobj2rb_task, &data);
|
109
|
+
/* cleanup (shouldn't happen, but what the hell)... */
|
110
|
+
while (fiobj_ary_pop(data.stack))
|
111
|
+
;
|
112
|
+
fiobj_free(data.stack);
|
113
|
+
// IodineStore.remove(data.rb); // don't remove data
|
114
|
+
return data.rb;
|
115
|
+
}
|
116
|
+
|
117
|
+
// require 'iodine'
|
118
|
+
// Iodine::JSON.parse "{\"1\":[1,2,3,4]}"
|
119
|
+
// Iodine::JSON.parse IO.binread("")
|
120
|
+
#endif /* H_RB_FIOBJ2RUBY_H */
|
File without changes
|
@@ -1,12 +1,12 @@
|
|
1
|
-
#ifndef H_IODINE_HELPERS_H
|
2
|
-
#define H_IODINE_HELPERS_H
|
3
|
-
/*
|
4
|
-
Copyright: Boaz segev, 2016-2018
|
5
|
-
License: MIT
|
6
|
-
|
7
|
-
Feel free to copy, use and enjoy according to the license provided.
|
8
|
-
*/
|
9
|
-
|
10
|
-
void iodine_init_helpers(void);
|
11
|
-
|
12
|
-
#endif
|
1
|
+
#ifndef H_IODINE_HELPERS_H
|
2
|
+
#define H_IODINE_HELPERS_H
|
3
|
+
/*
|
4
|
+
Copyright: Boaz segev, 2016-2018
|
5
|
+
License: MIT
|
6
|
+
|
7
|
+
Feel free to copy, use and enjoy according to the license provided.
|
8
|
+
*/
|
9
|
+
|
10
|
+
void iodine_init_helpers(void);
|
11
|
+
|
12
|
+
#endif
|
@@ -369,7 +369,6 @@ static inline VALUE copy2env(iodine_http_request_handle_s *handle) {
|
|
369
369
|
if (*pos == 0) {
|
370
370
|
rb_hash_aset(env, SERVER_NAME,
|
371
371
|
rb_enc_str_new(tmp.data, tmp.len, IodineBinaryEncoding));
|
372
|
-
rb_hash_aset(env, SERVER_PORT, QUERY_ESTRING);
|
373
372
|
} else {
|
374
373
|
rb_hash_aset(
|
375
374
|
env, SERVER_NAME,
|
@@ -870,7 +869,6 @@ static void initialize_env_template(void) {
|
|
870
869
|
rb_hash_aset(env_template_no_upgrade, REMOTE_ADDR, QUERY_STRING);
|
871
870
|
rb_hash_aset(env_template_no_upgrade, REQUEST_METHOD, QUERY_STRING);
|
872
871
|
rb_hash_aset(env_template_no_upgrade, SERVER_NAME, QUERY_STRING);
|
873
|
-
rb_hash_aset(env_template_no_upgrade, SERVER_PORT, QUERY_ESTRING);
|
874
872
|
rb_hash_aset(env_template_no_upgrade, SERVER_PROTOCOL, QUERY_STRING);
|
875
873
|
|
876
874
|
/* WebSocket upgrade support */
|
@@ -1,23 +1,23 @@
|
|
1
|
-
#ifndef H_IODINE_HTTP_H
|
2
|
-
#define H_IODINE_HTTP_H
|
3
|
-
/*
|
4
|
-
Copyright: Boaz segev, 2016-2018
|
5
|
-
License: MIT
|
6
|
-
|
7
|
-
Feel free to copy, use and enjoy according to the license provided.
|
8
|
-
*/
|
9
|
-
#include "iodine.h"
|
10
|
-
|
11
|
-
/* these three are used also by rb-rack-io.c */
|
12
|
-
extern VALUE IODINE_R_INPUT;
|
13
|
-
extern VALUE IODINE_R_INPUT_DEFAULT;
|
14
|
-
extern VALUE IODINE_R_HIJACK;
|
15
|
-
extern VALUE IODINE_R_HIJACK_IO;
|
16
|
-
extern VALUE IODINE_R_HIJACK_CB;
|
17
|
-
void iodine_init_http(void);
|
18
|
-
|
19
|
-
intptr_t iodine_http_listen(iodine_connection_args_s args);
|
20
|
-
// intptr_t iodine_http_connect(iodine_connection_args_s args); // not yet...
|
21
|
-
intptr_t iodine_ws_connect(iodine_connection_args_s args);
|
22
|
-
|
23
|
-
#endif
|
1
|
+
#ifndef H_IODINE_HTTP_H
|
2
|
+
#define H_IODINE_HTTP_H
|
3
|
+
/*
|
4
|
+
Copyright: Boaz segev, 2016-2018
|
5
|
+
License: MIT
|
6
|
+
|
7
|
+
Feel free to copy, use and enjoy according to the license provided.
|
8
|
+
*/
|
9
|
+
#include "iodine.h"
|
10
|
+
|
11
|
+
/* these three are used also by rb-rack-io.c */
|
12
|
+
extern VALUE IODINE_R_INPUT;
|
13
|
+
extern VALUE IODINE_R_INPUT_DEFAULT;
|
14
|
+
extern VALUE IODINE_R_HIJACK;
|
15
|
+
extern VALUE IODINE_R_HIJACK_IO;
|
16
|
+
extern VALUE IODINE_R_HIJACK_CB;
|
17
|
+
void iodine_init_http(void);
|
18
|
+
|
19
|
+
intptr_t iodine_http_listen(iodine_connection_args_s args);
|
20
|
+
// intptr_t iodine_http_connect(iodine_connection_args_s args); // not yet...
|
21
|
+
intptr_t iodine_ws_connect(iodine_connection_args_s args);
|
22
|
+
|
23
|
+
#endif
|