eventmachine 1.0.7-java → 1.0.8-java
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/CHANGELOG.md +12 -0
- data/README.md +1 -1
- data/ext/binder.cpp +9 -9
- data/ext/binder.h +5 -5
- data/ext/cmain.cpp +68 -55
- data/ext/ed.cpp +106 -70
- data/ext/ed.h +19 -13
- data/ext/em.cpp +228 -194
- data/ext/em.h +33 -28
- data/ext/eventmachine.h +53 -52
- data/ext/extconf.rb +26 -3
- data/ext/fastfilereader/rubymain.cpp +1 -1
- data/ext/kb.cpp +1 -1
- data/ext/pipe.cpp +4 -2
- data/ext/project.h +6 -0
- data/ext/rubymain.cpp +218 -188
- data/ext/ssl.cpp +7 -7
- data/ext/ssl.h +1 -1
- data/lib/em/protocols/line_and_text.rb +1 -0
- data/lib/em/protocols/linetext2.rb +44 -38
- data/lib/em/protocols/smtpclient.rb +60 -31
- data/lib/em/version.rb +1 -1
- data/lib/eventmachine.rb +9 -1
- data/tests/test_ltp2.rb +20 -0
- data/tests/test_smtpclient.rb +20 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9407d5002e439f7bfc0290697021ba19adcb68fc
|
4
|
+
data.tar.gz: f7b6f83ff388375b52f5b0207d0a7bd03388ec94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6a7975235284f6c4ae1c9f602fbb8789d7fe46325b5a4741a99cb94d27733273172b80bb341a29a4a7a747586f821373e435c854eca1286b43de59c0b16ea18
|
7
|
+
data.tar.gz: a9728d5e9ea5b63cc8f20b88f0d72e73824b8a46ba764fd9d237386275961a6c879adc7bd3cb603b715c5ffd7494bc290d37209e0b369504c263602db1a3deff
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.0.8 (August 6, 2015)
|
4
|
+
* fix kqueue assertion failed, postpone ArmKqueueWriter until all events are processed [#51, #176, #372, #401, #619]
|
5
|
+
* fix Rubinius GC, crank the machine from Ruby space when running Rubinius [#201, #202, #617]
|
6
|
+
* test to show that LineText2 preserves whitespace and newlines [#32, #622]
|
7
|
+
* bump up compiler warnings and resolve them [#616]
|
8
|
+
* fix Windows x64 use uintptr_t instead of unsigned long for binding pointers [#612, #615]
|
9
|
+
* fix linetext2 unroll tail recursion to avoid stack level too deep [#609]
|
10
|
+
* fix for compilation with SSL on windows [#601]
|
11
|
+
* open file descriptors and sockets with O_CLOEXEC where possible [#298, #488, #591]
|
12
|
+
* fix SmtpClient: send second EHLO after STARTTLS. [#589]
|
13
|
+
* fix nul-terminated strings in C, use StringValueCStr instead of StringValuePtr
|
14
|
+
|
3
15
|
## 1.0.7 (February 10, 2015)
|
4
16
|
* fix delay in kqueue/epoll reactor shutdown when timers exist [#587]
|
5
17
|
* fix memory leak introduced in v1.0.5 [#586]
|
data/README.md
CHANGED
@@ -32,7 +32,7 @@ EventMachine has been around since the early 2000s and is a mature and battle te
|
|
32
32
|
|
33
33
|
## What platforms are supported by EventMachine? ##
|
34
34
|
|
35
|
-
EventMachine supports Ruby 1.8.7
|
35
|
+
EventMachine supports Ruby >= 1.8.7 and <= 2.2 REE, JRuby and **works well on Windows** as well
|
36
36
|
as many operating systems from the Unix family (Linux, Mac OS X, BSD flavors).
|
37
37
|
|
38
38
|
|
data/ext/binder.cpp
CHANGED
@@ -22,16 +22,16 @@ See the file COPYING for complete licensing information.
|
|
22
22
|
#define DEV_URANDOM "/dev/urandom"
|
23
23
|
|
24
24
|
|
25
|
-
map<
|
25
|
+
map<uintptr_t, Bindable_t*> Bindable_t::BindingBag;
|
26
26
|
|
27
27
|
|
28
28
|
/********************************
|
29
29
|
STATIC Bindable_t::CreateBinding
|
30
30
|
********************************/
|
31
31
|
|
32
|
-
|
32
|
+
uintptr_t Bindable_t::CreateBinding()
|
33
33
|
{
|
34
|
-
static
|
34
|
+
static uintptr_t num = 0;
|
35
35
|
while(BindingBag[++num]) {}
|
36
36
|
return num;
|
37
37
|
}
|
@@ -90,13 +90,13 @@ string Bindable_t::CreateBinding()
|
|
90
90
|
STATIC: Bindable_t::GetObject
|
91
91
|
*****************************/
|
92
92
|
|
93
|
-
Bindable_t *Bindable_t::GetObject (const
|
93
|
+
Bindable_t *Bindable_t::GetObject (const uintptr_t binding)
|
94
94
|
{
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
95
|
+
map<uintptr_t, Bindable_t*>::const_iterator i = BindingBag.find (binding);
|
96
|
+
if (i != BindingBag.end())
|
97
|
+
return i->second;
|
98
|
+
else
|
99
|
+
return NULL;
|
100
100
|
}
|
101
101
|
|
102
102
|
|
data/ext/binder.h
CHANGED
@@ -24,18 +24,18 @@ See the file COPYING for complete licensing information.
|
|
24
24
|
class Bindable_t
|
25
25
|
{
|
26
26
|
public:
|
27
|
-
static
|
28
|
-
static Bindable_t *GetObject (const
|
29
|
-
static map<
|
27
|
+
static uintptr_t CreateBinding();
|
28
|
+
static Bindable_t *GetObject (const uintptr_t);
|
29
|
+
static map<uintptr_t, Bindable_t*> BindingBag;
|
30
30
|
|
31
31
|
public:
|
32
32
|
Bindable_t();
|
33
33
|
virtual ~Bindable_t();
|
34
34
|
|
35
|
-
const
|
35
|
+
const uintptr_t GetBinding() {return Binding;}
|
36
36
|
|
37
37
|
private:
|
38
|
-
|
38
|
+
uintptr_t Binding;
|
39
39
|
};
|
40
40
|
|
41
41
|
|
data/ext/cmain.cpp
CHANGED
@@ -29,8 +29,7 @@ See the file COPYING for complete licensing information.
|
|
29
29
|
#endif
|
30
30
|
|
31
31
|
static EventMachine_t *EventMachine;
|
32
|
-
static
|
33
|
-
static int bUseKqueue = 0;
|
32
|
+
static Poller_t Poller = Poller_Default;
|
34
33
|
|
35
34
|
extern "C" void ensure_eventmachine (const char *caller = "unknown caller")
|
36
35
|
{
|
@@ -58,11 +57,8 @@ extern "C" void evma_initialize_library (EMCallback cb)
|
|
58
57
|
#else
|
59
58
|
throw std::runtime_error ("eventmachine already initialized: evma_initialize_library");
|
60
59
|
#endif
|
61
|
-
|
62
|
-
|
63
|
-
EventMachine->_UseEpoll();
|
64
|
-
if (bUseKqueue)
|
65
|
-
EventMachine->_UseKqueue();
|
60
|
+
|
61
|
+
EventMachine = new EventMachine_t (cb, Poller);
|
66
62
|
}
|
67
63
|
|
68
64
|
|
@@ -78,6 +74,17 @@ extern "C" void evma_release_library()
|
|
78
74
|
}
|
79
75
|
|
80
76
|
|
77
|
+
/*********************
|
78
|
+
evma_run_machine_once
|
79
|
+
*********************/
|
80
|
+
|
81
|
+
extern "C" bool evma_run_machine_once()
|
82
|
+
{
|
83
|
+
ensure_eventmachine("evma_run_machine_once");
|
84
|
+
return EventMachine->RunOnce();
|
85
|
+
}
|
86
|
+
|
87
|
+
|
81
88
|
/****************
|
82
89
|
evma_run_machine
|
83
90
|
****************/
|
@@ -93,7 +100,7 @@ extern "C" void evma_run_machine()
|
|
93
100
|
evma_install_oneshot_timer
|
94
101
|
**************************/
|
95
102
|
|
96
|
-
extern "C" const
|
103
|
+
extern "C" const uintptr_t evma_install_oneshot_timer (int seconds)
|
97
104
|
{
|
98
105
|
ensure_eventmachine("evma_install_oneshot_timer");
|
99
106
|
return EventMachine->InstallOneshotTimer (seconds);
|
@@ -104,7 +111,7 @@ extern "C" const unsigned long evma_install_oneshot_timer (int seconds)
|
|
104
111
|
evma_connect_to_server
|
105
112
|
**********************/
|
106
113
|
|
107
|
-
extern "C" const
|
114
|
+
extern "C" const uintptr_t evma_connect_to_server (const char *bind_addr, int bind_port, const char *server, int port)
|
108
115
|
{
|
109
116
|
ensure_eventmachine("evma_connect_to_server");
|
110
117
|
return EventMachine->ConnectToServer (bind_addr, bind_port, server, port);
|
@@ -114,7 +121,7 @@ extern "C" const unsigned long evma_connect_to_server (const char *bind_addr, in
|
|
114
121
|
evma_connect_to_unix_server
|
115
122
|
***************************/
|
116
123
|
|
117
|
-
extern "C" const
|
124
|
+
extern "C" const uintptr_t evma_connect_to_unix_server (const char *server)
|
118
125
|
{
|
119
126
|
ensure_eventmachine("evma_connect_to_unix_server");
|
120
127
|
return EventMachine->ConnectToUnixServer (server);
|
@@ -124,7 +131,7 @@ extern "C" const unsigned long evma_connect_to_unix_server (const char *server)
|
|
124
131
|
evma_attach_fd
|
125
132
|
**************/
|
126
133
|
|
127
|
-
extern "C" const
|
134
|
+
extern "C" const uintptr_t evma_attach_fd (int file_descriptor, int watch_mode)
|
128
135
|
{
|
129
136
|
ensure_eventmachine("evma_attach_fd");
|
130
137
|
return EventMachine->AttachFD (file_descriptor, watch_mode ? true : false);
|
@@ -134,7 +141,7 @@ extern "C" const unsigned long evma_attach_fd (int file_descriptor, int watch_mo
|
|
134
141
|
evma_detach_fd
|
135
142
|
**************/
|
136
143
|
|
137
|
-
extern "C" int evma_detach_fd (const
|
144
|
+
extern "C" int evma_detach_fd (const uintptr_t binding)
|
138
145
|
{
|
139
146
|
ensure_eventmachine("evma_detach_fd");
|
140
147
|
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
|
@@ -153,7 +160,7 @@ extern "C" int evma_detach_fd (const unsigned long binding)
|
|
153
160
|
evma_get_file_descriptor
|
154
161
|
************************/
|
155
162
|
|
156
|
-
extern "C" int evma_get_file_descriptor (const
|
163
|
+
extern "C" int evma_get_file_descriptor (const uintptr_t binding)
|
157
164
|
{
|
158
165
|
ensure_eventmachine("evma_get_file_descriptor");
|
159
166
|
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
|
@@ -172,7 +179,7 @@ extern "C" int evma_get_file_descriptor (const unsigned long binding)
|
|
172
179
|
evma_is_notify_readable
|
173
180
|
***********************/
|
174
181
|
|
175
|
-
extern "C" int evma_is_notify_readable (const
|
182
|
+
extern "C" int evma_is_notify_readable (const uintptr_t binding)
|
176
183
|
{
|
177
184
|
ConnectionDescriptor *cd = dynamic_cast <ConnectionDescriptor*> (Bindable_t::GetObject (binding));
|
178
185
|
if (cd)
|
@@ -184,7 +191,7 @@ extern "C" int evma_is_notify_readable (const unsigned long binding)
|
|
184
191
|
evma_set_notify_readable
|
185
192
|
************************/
|
186
193
|
|
187
|
-
extern "C" void evma_set_notify_readable (const
|
194
|
+
extern "C" void evma_set_notify_readable (const uintptr_t binding, int mode)
|
188
195
|
{
|
189
196
|
ConnectionDescriptor *cd = dynamic_cast <ConnectionDescriptor*> (Bindable_t::GetObject (binding));
|
190
197
|
if (cd)
|
@@ -195,7 +202,7 @@ extern "C" void evma_set_notify_readable (const unsigned long binding, int mode)
|
|
195
202
|
evma_is_notify_writable
|
196
203
|
***********************/
|
197
204
|
|
198
|
-
extern "C" int evma_is_notify_writable (const
|
205
|
+
extern "C" int evma_is_notify_writable (const uintptr_t binding)
|
199
206
|
{
|
200
207
|
ConnectionDescriptor *cd = dynamic_cast <ConnectionDescriptor*> (Bindable_t::GetObject (binding));
|
201
208
|
if (cd)
|
@@ -207,7 +214,7 @@ extern "C" int evma_is_notify_writable (const unsigned long binding)
|
|
207
214
|
evma_set_notify_writable
|
208
215
|
************************/
|
209
216
|
|
210
|
-
extern "C" void evma_set_notify_writable (const
|
217
|
+
extern "C" void evma_set_notify_writable (const uintptr_t binding, int mode)
|
211
218
|
{
|
212
219
|
ConnectionDescriptor *cd = dynamic_cast <ConnectionDescriptor*> (Bindable_t::GetObject (binding));
|
213
220
|
if (cd)
|
@@ -218,7 +225,7 @@ extern "C" void evma_set_notify_writable (const unsigned long binding, int mode)
|
|
218
225
|
evma_pause
|
219
226
|
**********/
|
220
227
|
|
221
|
-
extern "C" int evma_pause (const
|
228
|
+
extern "C" int evma_pause (const uintptr_t binding)
|
222
229
|
{
|
223
230
|
EventableDescriptor *cd = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
|
224
231
|
if (cd)
|
@@ -231,7 +238,7 @@ extern "C" int evma_pause (const unsigned long binding)
|
|
231
238
|
evma_resume
|
232
239
|
***********/
|
233
240
|
|
234
|
-
extern "C" int evma_resume (const
|
241
|
+
extern "C" int evma_resume (const uintptr_t binding)
|
235
242
|
{
|
236
243
|
EventableDescriptor *cd = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
|
237
244
|
if (cd)
|
@@ -244,7 +251,7 @@ extern "C" int evma_resume (const unsigned long binding)
|
|
244
251
|
evma_is_paused
|
245
252
|
**************/
|
246
253
|
|
247
|
-
extern "C" int evma_is_paused (const
|
254
|
+
extern "C" int evma_is_paused (const uintptr_t binding)
|
248
255
|
{
|
249
256
|
EventableDescriptor *cd = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
|
250
257
|
if (cd)
|
@@ -267,7 +274,7 @@ extern "C" int evma_num_close_scheduled ()
|
|
267
274
|
evma_create_tcp_server
|
268
275
|
**********************/
|
269
276
|
|
270
|
-
extern "C" const
|
277
|
+
extern "C" const uintptr_t evma_create_tcp_server (const char *address, int port)
|
271
278
|
{
|
272
279
|
ensure_eventmachine("evma_create_tcp_server");
|
273
280
|
return EventMachine->CreateTcpServer (address, port);
|
@@ -277,7 +284,7 @@ extern "C" const unsigned long evma_create_tcp_server (const char *address, int
|
|
277
284
|
evma_create_unix_domain_server
|
278
285
|
******************************/
|
279
286
|
|
280
|
-
extern "C" const
|
287
|
+
extern "C" const uintptr_t evma_create_unix_domain_server (const char *filename)
|
281
288
|
{
|
282
289
|
ensure_eventmachine("evma_create_unix_domain_server");
|
283
290
|
return EventMachine->CreateUnixDomainServer (filename);
|
@@ -287,7 +294,7 @@ extern "C" const unsigned long evma_create_unix_domain_server (const char *filen
|
|
287
294
|
evma_attach_sd
|
288
295
|
************************/
|
289
296
|
|
290
|
-
extern "C" const
|
297
|
+
extern "C" const uintptr_t evma_attach_sd (int sd)
|
291
298
|
{
|
292
299
|
ensure_eventmachine("evma_attach_sd");
|
293
300
|
return EventMachine->AttachSD (sd);
|
@@ -297,7 +304,7 @@ extern "C" const unsigned long evma_attach_sd (int sd)
|
|
297
304
|
evma_open_datagram_socket
|
298
305
|
*************************/
|
299
306
|
|
300
|
-
extern "C" const
|
307
|
+
extern "C" const uintptr_t evma_open_datagram_socket (const char *address, int port)
|
301
308
|
{
|
302
309
|
ensure_eventmachine("evma_open_datagram_socket");
|
303
310
|
return EventMachine->OpenDatagramSocket (address, port);
|
@@ -307,7 +314,7 @@ extern "C" const unsigned long evma_open_datagram_socket (const char *address, i
|
|
307
314
|
evma_open_keyboard
|
308
315
|
******************/
|
309
316
|
|
310
|
-
extern "C" const
|
317
|
+
extern "C" const uintptr_t evma_open_keyboard()
|
311
318
|
{
|
312
319
|
ensure_eventmachine("evma_open_keyboard");
|
313
320
|
return EventMachine->OpenKeyboard();
|
@@ -317,7 +324,7 @@ extern "C" const unsigned long evma_open_keyboard()
|
|
317
324
|
evma_watch_filename
|
318
325
|
*******************/
|
319
326
|
|
320
|
-
extern "C" const
|
327
|
+
extern "C" const uintptr_t evma_watch_filename (const char *fname)
|
321
328
|
{
|
322
329
|
ensure_eventmachine("evma_watch_filename");
|
323
330
|
return EventMachine->WatchFile(fname);
|
@@ -327,7 +334,7 @@ extern "C" const unsigned long evma_watch_filename (const char *fname)
|
|
327
334
|
evma_unwatch_filename
|
328
335
|
*********************/
|
329
336
|
|
330
|
-
extern "C" void evma_unwatch_filename (const
|
337
|
+
extern "C" void evma_unwatch_filename (const uintptr_t sig)
|
331
338
|
{
|
332
339
|
ensure_eventmachine("evma_unwatch_file");
|
333
340
|
EventMachine->UnwatchFile(sig);
|
@@ -337,7 +344,7 @@ extern "C" void evma_unwatch_filename (const unsigned long sig)
|
|
337
344
|
evma_watch_pid
|
338
345
|
**************/
|
339
346
|
|
340
|
-
extern "C" const
|
347
|
+
extern "C" const uintptr_t evma_watch_pid (int pid)
|
341
348
|
{
|
342
349
|
ensure_eventmachine("evma_watch_pid");
|
343
350
|
return EventMachine->WatchPid(pid);
|
@@ -347,7 +354,7 @@ extern "C" const unsigned long evma_watch_pid (int pid)
|
|
347
354
|
evma_unwatch_pid
|
348
355
|
****************/
|
349
356
|
|
350
|
-
extern "C" void evma_unwatch_pid (const
|
357
|
+
extern "C" void evma_unwatch_pid (const uintptr_t sig)
|
351
358
|
{
|
352
359
|
ensure_eventmachine("evma_unwatch_pid");
|
353
360
|
EventMachine->UnwatchPid(sig);
|
@@ -357,7 +364,7 @@ extern "C" void evma_unwatch_pid (const unsigned long sig)
|
|
357
364
|
evma_send_data_to_connection
|
358
365
|
****************************/
|
359
366
|
|
360
|
-
extern "C" int evma_send_data_to_connection (const
|
367
|
+
extern "C" int evma_send_data_to_connection (const uintptr_t binding, const char *data, int data_length)
|
361
368
|
{
|
362
369
|
ensure_eventmachine("evma_send_data_to_connection");
|
363
370
|
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
|
@@ -370,7 +377,7 @@ extern "C" int evma_send_data_to_connection (const unsigned long binding, const
|
|
370
377
|
evma_send_datagram
|
371
378
|
******************/
|
372
379
|
|
373
|
-
extern "C" int evma_send_datagram (const
|
380
|
+
extern "C" int evma_send_datagram (const uintptr_t binding, const char *data, int data_length, const char *address, int port)
|
374
381
|
{
|
375
382
|
ensure_eventmachine("evma_send_datagram");
|
376
383
|
DatagramDescriptor *dd = dynamic_cast <DatagramDescriptor*> (Bindable_t::GetObject (binding));
|
@@ -384,7 +391,7 @@ extern "C" int evma_send_datagram (const unsigned long binding, const char *data
|
|
384
391
|
evma_close_connection
|
385
392
|
*********************/
|
386
393
|
|
387
|
-
extern "C" void evma_close_connection (const
|
394
|
+
extern "C" void evma_close_connection (const uintptr_t binding, int after_writing)
|
388
395
|
{
|
389
396
|
ensure_eventmachine("evma_close_connection");
|
390
397
|
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
|
@@ -396,7 +403,7 @@ extern "C" void evma_close_connection (const unsigned long binding, int after_wr
|
|
396
403
|
evma_report_connection_error_status
|
397
404
|
***********************************/
|
398
405
|
|
399
|
-
extern "C" int evma_report_connection_error_status (const
|
406
|
+
extern "C" int evma_report_connection_error_status (const uintptr_t binding)
|
400
407
|
{
|
401
408
|
ensure_eventmachine("evma_report_connection_error_status");
|
402
409
|
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
|
@@ -409,7 +416,7 @@ extern "C" int evma_report_connection_error_status (const unsigned long binding)
|
|
409
416
|
evma_stop_tcp_server
|
410
417
|
********************/
|
411
418
|
|
412
|
-
extern "C" void evma_stop_tcp_server (const
|
419
|
+
extern "C" void evma_stop_tcp_server (const uintptr_t binding)
|
413
420
|
{
|
414
421
|
ensure_eventmachine("evma_stop_tcp_server");
|
415
422
|
AcceptorDescriptor::StopAcceptor (binding);
|
@@ -431,7 +438,7 @@ extern "C" void evma_stop_machine()
|
|
431
438
|
evma_start_tls
|
432
439
|
**************/
|
433
440
|
|
434
|
-
extern "C" void evma_start_tls (const
|
441
|
+
extern "C" void evma_start_tls (const uintptr_t binding)
|
435
442
|
{
|
436
443
|
ensure_eventmachine("evma_start_tls");
|
437
444
|
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
|
@@ -443,7 +450,7 @@ extern "C" void evma_start_tls (const unsigned long binding)
|
|
443
450
|
evma_set_tls_parms
|
444
451
|
******************/
|
445
452
|
|
446
|
-
extern "C" void evma_set_tls_parms (const
|
453
|
+
extern "C" void evma_set_tls_parms (const uintptr_t binding, const char *privatekey_filename, const char *certchain_filename, int verify_peer)
|
447
454
|
{
|
448
455
|
ensure_eventmachine("evma_set_tls_parms");
|
449
456
|
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
|
@@ -456,7 +463,7 @@ evma_get_peer_cert
|
|
456
463
|
******************/
|
457
464
|
|
458
465
|
#ifdef WITH_SSL
|
459
|
-
extern "C" X509 *evma_get_peer_cert (const
|
466
|
+
extern "C" X509 *evma_get_peer_cert (const uintptr_t binding)
|
460
467
|
{
|
461
468
|
ensure_eventmachine("evma_get_peer_cert");
|
462
469
|
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
|
@@ -471,7 +478,7 @@ evma_accept_ssl_peer
|
|
471
478
|
********************/
|
472
479
|
|
473
480
|
#ifdef WITH_SSL
|
474
|
-
extern "C" void evma_accept_ssl_peer (const
|
481
|
+
extern "C" void evma_accept_ssl_peer (const uintptr_t binding)
|
475
482
|
{
|
476
483
|
ensure_eventmachine("evma_accept_ssl_peer");
|
477
484
|
ConnectionDescriptor *cd = dynamic_cast <ConnectionDescriptor*> (Bindable_t::GetObject (binding));
|
@@ -484,7 +491,7 @@ extern "C" void evma_accept_ssl_peer (const unsigned long binding)
|
|
484
491
|
evma_get_peername
|
485
492
|
*****************/
|
486
493
|
|
487
|
-
extern "C" int evma_get_peername (const
|
494
|
+
extern "C" int evma_get_peername (const uintptr_t binding, struct sockaddr *sa, socklen_t *len)
|
488
495
|
{
|
489
496
|
ensure_eventmachine("evma_get_peername");
|
490
497
|
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
|
@@ -499,7 +506,7 @@ extern "C" int evma_get_peername (const unsigned long binding, struct sockaddr *
|
|
499
506
|
evma_get_sockname
|
500
507
|
*****************/
|
501
508
|
|
502
|
-
extern "C" int evma_get_sockname (const
|
509
|
+
extern "C" int evma_get_sockname (const uintptr_t binding, struct sockaddr *sa, socklen_t *len)
|
503
510
|
{
|
504
511
|
ensure_eventmachine("evma_get_sockname");
|
505
512
|
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
|
@@ -514,7 +521,7 @@ extern "C" int evma_get_sockname (const unsigned long binding, struct sockaddr *
|
|
514
521
|
evma_get_subprocess_pid
|
515
522
|
***********************/
|
516
523
|
|
517
|
-
extern "C" int evma_get_subprocess_pid (const
|
524
|
+
extern "C" int evma_get_subprocess_pid (const uintptr_t binding, pid_t *pid)
|
518
525
|
{
|
519
526
|
ensure_eventmachine("evma_get_subprocess_pid");
|
520
527
|
#ifdef OS_UNIX
|
@@ -537,7 +544,7 @@ extern "C" int evma_get_subprocess_pid (const unsigned long binding, pid_t *pid)
|
|
537
544
|
evma_get_subprocess_status
|
538
545
|
**************************/
|
539
546
|
|
540
|
-
extern "C" int evma_get_subprocess_status (const
|
547
|
+
extern "C" int evma_get_subprocess_status (const uintptr_t binding UNUSED, int *status)
|
541
548
|
{
|
542
549
|
ensure_eventmachine("evma_get_subprocess_status");
|
543
550
|
if (status) {
|
@@ -574,7 +581,7 @@ extern "C" void evma_signal_loopbreak()
|
|
574
581
|
evma_get_comm_inactivity_timeout
|
575
582
|
********************************/
|
576
583
|
|
577
|
-
extern "C" float evma_get_comm_inactivity_timeout (const
|
584
|
+
extern "C" float evma_get_comm_inactivity_timeout (const uintptr_t binding)
|
578
585
|
{
|
579
586
|
ensure_eventmachine("evma_get_comm_inactivity_timeout");
|
580
587
|
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
|
@@ -589,7 +596,7 @@ extern "C" float evma_get_comm_inactivity_timeout (const unsigned long binding)
|
|
589
596
|
evma_set_comm_inactivity_timeout
|
590
597
|
********************************/
|
591
598
|
|
592
|
-
extern "C" int evma_set_comm_inactivity_timeout (const
|
599
|
+
extern "C" int evma_set_comm_inactivity_timeout (const uintptr_t binding, float value)
|
593
600
|
{
|
594
601
|
ensure_eventmachine("evma_set_comm_inactivity_timeout");
|
595
602
|
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
|
@@ -605,7 +612,7 @@ extern "C" int evma_set_comm_inactivity_timeout (const unsigned long binding, fl
|
|
605
612
|
evma_get_pending_connect_timeout
|
606
613
|
********************************/
|
607
614
|
|
608
|
-
extern "C" float evma_get_pending_connect_timeout (const
|
615
|
+
extern "C" float evma_get_pending_connect_timeout (const uintptr_t binding)
|
609
616
|
{
|
610
617
|
ensure_eventmachine("evma_get_pending_connect_timeout");
|
611
618
|
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
|
@@ -621,7 +628,7 @@ extern "C" float evma_get_pending_connect_timeout (const unsigned long binding)
|
|
621
628
|
evma_set_pending_connect_timeout
|
622
629
|
********************************/
|
623
630
|
|
624
|
-
extern "C" int evma_set_pending_connect_timeout (const
|
631
|
+
extern "C" int evma_set_pending_connect_timeout (const uintptr_t binding, float value)
|
625
632
|
{
|
626
633
|
ensure_eventmachine("evma_set_pending_connect_timeout");
|
627
634
|
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
|
@@ -700,7 +707,7 @@ extern "C" void evma_setuid_string (const char *username)
|
|
700
707
|
evma_popen
|
701
708
|
**********/
|
702
709
|
|
703
|
-
extern "C" const
|
710
|
+
extern "C" const uintptr_t evma_popen (char * const*cmd_strings)
|
704
711
|
{
|
705
712
|
ensure_eventmachine("evma_popen");
|
706
713
|
return EventMachine->Socketpair (cmd_strings);
|
@@ -711,7 +718,7 @@ extern "C" const unsigned long evma_popen (char * const*cmd_strings)
|
|
711
718
|
evma_get_outbound_data_size
|
712
719
|
***************************/
|
713
720
|
|
714
|
-
extern "C" int evma_get_outbound_data_size (const
|
721
|
+
extern "C" int evma_get_outbound_data_size (const uintptr_t binding)
|
715
722
|
{
|
716
723
|
ensure_eventmachine("evma_get_outbound_data_size");
|
717
724
|
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
|
@@ -725,7 +732,10 @@ evma_set_epoll
|
|
725
732
|
|
726
733
|
extern "C" void evma_set_epoll (int use)
|
727
734
|
{
|
728
|
-
|
735
|
+
if (use)
|
736
|
+
Poller = Poller_Epoll;
|
737
|
+
else
|
738
|
+
Poller = Poller_Default;
|
729
739
|
}
|
730
740
|
|
731
741
|
/***************
|
@@ -734,7 +744,10 @@ evma_set_kqueue
|
|
734
744
|
|
735
745
|
extern "C" void evma_set_kqueue (int use)
|
736
746
|
{
|
737
|
-
|
747
|
+
if (use)
|
748
|
+
Poller = Poller_Kqueue;
|
749
|
+
else
|
750
|
+
Poller = Poller_Default;
|
738
751
|
}
|
739
752
|
|
740
753
|
|
@@ -752,7 +765,7 @@ extern "C" int evma_set_rlimit_nofile (int nofiles)
|
|
752
765
|
evma_send_file_data_to_connection
|
753
766
|
*********************************/
|
754
767
|
|
755
|
-
extern "C" int evma_send_file_data_to_connection (const
|
768
|
+
extern "C" int evma_send_file_data_to_connection (const uintptr_t binding, const char *filename)
|
756
769
|
{
|
757
770
|
/* This is a sugaring over send_data_to_connection that reads a file into a
|
758
771
|
* locally-allocated buffer, and sends the file data to the remote peer.
|
@@ -819,7 +832,7 @@ extern "C" int evma_send_file_data_to_connection (const unsigned long binding, c
|
|
819
832
|
evma_start_proxy
|
820
833
|
*****************/
|
821
834
|
|
822
|
-
extern "C" void evma_start_proxy (const
|
835
|
+
extern "C" void evma_start_proxy (const uintptr_t from, const uintptr_t to, const unsigned long bufsize, const unsigned long length)
|
823
836
|
{
|
824
837
|
ensure_eventmachine("evma_start_proxy");
|
825
838
|
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (from));
|
@@ -832,7 +845,7 @@ extern "C" void evma_start_proxy (const unsigned long from, const unsigned long
|
|
832
845
|
evma_stop_proxy
|
833
846
|
****************/
|
834
847
|
|
835
|
-
extern "C" void evma_stop_proxy (const
|
848
|
+
extern "C" void evma_stop_proxy (const uintptr_t from)
|
836
849
|
{
|
837
850
|
ensure_eventmachine("evma_stop_proxy");
|
838
851
|
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (from));
|
@@ -844,7 +857,7 @@ extern "C" void evma_stop_proxy (const unsigned long from)
|
|
844
857
|
evma_proxied_bytes
|
845
858
|
*******************/
|
846
859
|
|
847
|
-
extern "C" unsigned long evma_proxied_bytes (const
|
860
|
+
extern "C" unsigned long evma_proxied_bytes (const uintptr_t from)
|
848
861
|
{
|
849
862
|
ensure_eventmachine("evma_proxied_bytes");
|
850
863
|
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (from));
|
@@ -859,7 +872,7 @@ extern "C" unsigned long evma_proxied_bytes (const unsigned long from)
|
|
859
872
|
evma_get_last_activity_time
|
860
873
|
****************************/
|
861
874
|
|
862
|
-
extern "C" uint64_t evma_get_last_activity_time(const
|
875
|
+
extern "C" uint64_t evma_get_last_activity_time(const uintptr_t from)
|
863
876
|
{
|
864
877
|
ensure_eventmachine("evma_get_last_activity_time");
|
865
878
|
EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (from));
|