cool.io 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. data/.gitignore +25 -0
  2. data/CHANGES +199 -0
  3. data/LICENSE +20 -0
  4. data/README.markdown +4 -0
  5. data/Rakefile +98 -0
  6. data/VERSION +1 -0
  7. data/examples/echo_client.rb +38 -0
  8. data/examples/echo_server.rb +27 -0
  9. data/examples/google.rb +9 -0
  10. data/examples/httpclient.rb +38 -0
  11. data/ext/cool.io/.gitignore +5 -0
  12. data/ext/cool.io/cool.io.h +58 -0
  13. data/ext/cool.io/cool.io_ext.c +25 -0
  14. data/ext/cool.io/ev_wrap.h +8 -0
  15. data/ext/cool.io/extconf.rb +69 -0
  16. data/ext/cool.io/iowatcher.c +189 -0
  17. data/ext/cool.io/libev.c +8 -0
  18. data/ext/cool.io/loop.c +303 -0
  19. data/ext/cool.io/stat_watcher.c +191 -0
  20. data/ext/cool.io/timer_watcher.c +219 -0
  21. data/ext/cool.io/utils.c +122 -0
  22. data/ext/cool.io/watcher.c +264 -0
  23. data/ext/cool.io/watcher.h +71 -0
  24. data/ext/http11_client/.gitignore +5 -0
  25. data/ext/http11_client/ext_help.h +14 -0
  26. data/ext/http11_client/extconf.rb +6 -0
  27. data/ext/http11_client/http11_client.c +300 -0
  28. data/ext/http11_client/http11_parser.c +403 -0
  29. data/ext/http11_client/http11_parser.h +48 -0
  30. data/ext/http11_client/http11_parser.rl +173 -0
  31. data/ext/libev/Changes +364 -0
  32. data/ext/libev/LICENSE +36 -0
  33. data/ext/libev/README +58 -0
  34. data/ext/libev/README.embed +3 -0
  35. data/ext/libev/ev.c +3867 -0
  36. data/ext/libev/ev.h +826 -0
  37. data/ext/libev/ev_epoll.c +234 -0
  38. data/ext/libev/ev_kqueue.c +198 -0
  39. data/ext/libev/ev_poll.c +148 -0
  40. data/ext/libev/ev_port.c +164 -0
  41. data/ext/libev/ev_select.c +307 -0
  42. data/ext/libev/ev_vars.h +197 -0
  43. data/ext/libev/ev_win32.c +153 -0
  44. data/ext/libev/ev_wrap.h +186 -0
  45. data/ext/libev/test_libev_win32.c +123 -0
  46. data/ext/libev/update_ev_wrap +19 -0
  47. data/lib/.gitignore +2 -0
  48. data/lib/cool.io.rb +30 -0
  49. data/lib/cool.io/async_watcher.rb +43 -0
  50. data/lib/cool.io/dns_resolver.rb +220 -0
  51. data/lib/cool.io/eventmachine.rb +234 -0
  52. data/lib/cool.io/http_client.rb +419 -0
  53. data/lib/cool.io/io.rb +174 -0
  54. data/lib/cool.io/iowatcher.rb +17 -0
  55. data/lib/cool.io/listener.rb +93 -0
  56. data/lib/cool.io/loop.rb +130 -0
  57. data/lib/cool.io/meta.rb +49 -0
  58. data/lib/cool.io/server.rb +74 -0
  59. data/lib/cool.io/socket.rb +224 -0
  60. data/lib/cool.io/timer_watcher.rb +17 -0
  61. data/lib/coolio.rb +2 -0
  62. data/lib/rev.rb +4 -0
  63. data/spec/async_watcher_spec.rb +57 -0
  64. data/spec/possible_tests/schedules_other_threads.rb +48 -0
  65. data/spec/possible_tests/test_on_resolve_failed.rb +9 -0
  66. data/spec/possible_tests/test_resolves.rb +27 -0
  67. data/spec/possible_tests/test_write_during_resolve.rb +27 -0
  68. data/spec/possible_tests/works_straight.rb +71 -0
  69. data/spec/spec_helper.rb +5 -0
  70. data/spec/timer_watcher_spec.rb +55 -0
  71. data/spec/unix_listener_spec.rb +25 -0
  72. data/spec/unix_server_spec.rb +25 -0
  73. metadata +184 -0
@@ -0,0 +1,173 @@
1
+ /**
2
+ * Copyright (c) 2005 Zed A. Shaw
3
+ * You can redistribute it and/or modify it under the same terms as Ruby.
4
+ */
5
+
6
+ #include "http11_parser.h"
7
+ #include <stdio.h>
8
+ #include <assert.h>
9
+ #include <stdlib.h>
10
+ #include <ctype.h>
11
+ #include <string.h>
12
+
13
+ #define LEN(AT, FPC) (FPC - buffer - parser->AT)
14
+ #define MARK(M,FPC) (parser->M = (FPC) - buffer)
15
+ #define PTR_TO(F) (buffer + parser->F)
16
+ #define L(M) fprintf(stderr, "" # M "\n");
17
+
18
+
19
+ /** machine **/
20
+ %%{
21
+ machine httpclient_parser;
22
+
23
+ action mark {MARK(mark, fpc); }
24
+
25
+ action start_field { MARK(field_start, fpc); }
26
+
27
+ action write_field {
28
+ parser->field_len = LEN(field_start, fpc);
29
+ }
30
+
31
+ action start_value { MARK(mark, fpc); }
32
+
33
+ action write_value {
34
+ parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, fpc));
35
+ }
36
+
37
+ action reason_phrase {
38
+ parser->reason_phrase(parser->data, PTR_TO(mark), LEN(mark, fpc));
39
+ }
40
+
41
+ action status_code {
42
+ parser->status_code(parser->data, PTR_TO(mark), LEN(mark, fpc));
43
+ }
44
+
45
+ action http_version {
46
+ parser->http_version(parser->data, PTR_TO(mark), LEN(mark, fpc));
47
+ }
48
+
49
+ action chunk_size {
50
+ parser->chunk_size(parser->data, PTR_TO(mark), LEN(mark, fpc));
51
+ }
52
+
53
+ action last_chunk {
54
+ parser->last_chunk(parser->data, NULL, 0);
55
+ }
56
+
57
+ action done {
58
+ parser->body_start = fpc - buffer + 1;
59
+ if(parser->header_done != NULL)
60
+ parser->header_done(parser->data, fpc + 1, pe - fpc - 1);
61
+ fbreak;
62
+ }
63
+
64
+ # line endings
65
+ CRLF = "\r\n";
66
+
67
+ # character types
68
+ CTL = (cntrl | 127);
69
+ tspecials = ("(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\\" | "\"" | "/" | "[" | "]" | "?" | "=" | "{" | "}" | " " | "\t");
70
+
71
+ # elements
72
+ token = (ascii -- (CTL | tspecials));
73
+
74
+ Reason_Phrase = (any -- CRLF)* >mark %reason_phrase;
75
+ Status_Code = digit{3} >mark %status_code;
76
+ http_number = (digit+ "." digit+) ;
77
+ HTTP_Version = ("HTTP/" http_number) >mark %http_version ;
78
+ Status_Line = HTTP_Version " " Status_Code " "? Reason_Phrase :> CRLF;
79
+
80
+ field_name = token+ >start_field %write_field;
81
+ field_value = any* >start_value %write_value;
82
+ message_header = field_name ":" " "* field_value :> CRLF;
83
+
84
+ Response = Status_Line (message_header)* (CRLF @done);
85
+
86
+ chunk_ext_val = token+;
87
+ chunk_ext_name = token+;
88
+ chunk_extension = (";" chunk_ext_name >start_field %write_field %start_value ("=" chunk_ext_val >start_value)? %write_value )*;
89
+ last_chunk = "0"? chunk_extension :> (CRLF @last_chunk @done);
90
+ chunk_size = xdigit+;
91
+ chunk = chunk_size >mark %chunk_size chunk_extension space* :> (CRLF @done);
92
+ Chunked_Header = (chunk | last_chunk);
93
+
94
+ main := Response | Chunked_Header;
95
+ }%%
96
+
97
+ /** Data **/
98
+ %% write data;
99
+
100
+ int httpclient_parser_init(httpclient_parser *parser) {
101
+ int cs = 0;
102
+ %% write init;
103
+ parser->cs = cs;
104
+ parser->body_start = 0;
105
+ parser->content_len = 0;
106
+ parser->mark = 0;
107
+ parser->nread = 0;
108
+ parser->field_len = 0;
109
+ parser->field_start = 0;
110
+
111
+ return(1);
112
+ }
113
+
114
+
115
+ /** exec **/
116
+ size_t httpclient_parser_execute(httpclient_parser *parser, const char *buffer, size_t len, size_t off) {
117
+ const char *p, *pe;
118
+ int cs = parser->cs;
119
+
120
+ assert(off <= len && "offset past end of buffer");
121
+
122
+ p = buffer+off;
123
+ pe = buffer+len;
124
+
125
+ assert(*pe == '\0' && "pointer does not end on NUL");
126
+ assert(pe - p == len - off && "pointers aren't same distance");
127
+
128
+
129
+ %% write exec;
130
+
131
+ parser->cs = cs;
132
+ parser->nread += p - (buffer + off);
133
+
134
+ assert(p <= pe && "buffer overflow after parsing execute");
135
+ assert(parser->nread <= len && "nread longer than length");
136
+ assert(parser->body_start <= len && "body starts after buffer end");
137
+ assert(parser->mark < len && "mark is after buffer end");
138
+ assert(parser->field_len <= len && "field has length longer than whole buffer");
139
+ assert(parser->field_start < len && "field starts after buffer end");
140
+
141
+ if(parser->body_start) {
142
+ /* final \r\n combo encountered so stop right here */
143
+ %%write eof;
144
+ parser->nread++;
145
+ }
146
+
147
+ return(parser->nread);
148
+ }
149
+
150
+ int httpclient_parser_finish(httpclient_parser *parser)
151
+ {
152
+ int cs = parser->cs;
153
+
154
+ %%write eof;
155
+
156
+ parser->cs = cs;
157
+
158
+ if (httpclient_parser_has_error(parser) ) {
159
+ return -1;
160
+ } else if (httpclient_parser_is_finished(parser) ) {
161
+ return 1;
162
+ } else {
163
+ return 0;
164
+ }
165
+ }
166
+
167
+ int httpclient_parser_has_error(httpclient_parser *parser) {
168
+ return parser->cs == httpclient_parser_error;
169
+ }
170
+
171
+ int httpclient_parser_is_finished(httpclient_parser *parser) {
172
+ return parser->cs == httpclient_parser_first_final;
173
+ }
data/ext/libev/Changes ADDED
@@ -0,0 +1,364 @@
1
+ Revision history for libev, a high-performance and full-featured event loop.
2
+
3
+ 4.01 Fri Nov 5 21:51:29 CET 2010
4
+ - automake fucked it up, apparently, --add-missing -f is not quite enough
5
+ to make it update its files, so 4.00 didn't install ev++.h and
6
+ event.h on make install. grrr.
7
+ - ev_loop(count|depth) didn't return anything (Robin Haberkorn).
8
+ - change EV_UNDEF to 0xffffffff to silence some overzealous compilers.
9
+ - use "(libev) " prefix for all libev error messages now.
10
+
11
+ 4.00 Mon Oct 25 12:32:12 CEST 2010
12
+ - "PORTING FROM LIBEV 3.X TO 4.X" (in ev.pod) is recommended reading.
13
+ - ev_embed_stop did not correctly stop the watcher (very good
14
+ testcase by Vladimir Timofeev).
15
+ - ev_run will now always update the current loop time - it erroneously
16
+ didn't when idle watchers were active, causing timers not to fire.
17
+ - fix a bug where a timeout of zero caused the timer not to fire
18
+ in the libevent emulation (testcase by Péter Szabó).
19
+ - applied win32 fixes by Michael Lenaghan (also James Mansion).
20
+ - replace EV_MINIMAL by EV_FEATURES.
21
+ - prefer EPOLL_CTL_ADD over EPOLL_CTL_MOD in some more cases, as it
22
+ seems the former is *much* faster than the latter.
23
+ - linux kernel version detection (for inotify bug workarounds)
24
+ did not work properly.
25
+ - reduce the number of spurious wake-ups with the ports backend.
26
+ - remove dependency on sys/queue.h on freebsd (patch by Vanilla Hsu).
27
+ - do async init within ev_async_start, not ev_async_set, which avoids
28
+ an API quirk where the set function must be called in the C++ API
29
+ even when there is nothing to set.
30
+ - add (undocumented) EV_ENABLE when adding events with kqueue,
31
+ this might help with OS X, which seems to need it despite documenting
32
+ not to need it (helpfully pointed out by Tilghman Lesher).
33
+ - do not use poll by default on freebsd, it's broken (what isn't
34
+ on freebsd...).
35
+ - allow to embed epoll on kernels >= 2.6.32.
36
+ - configure now prepends -O3, not appends it, so one can still
37
+ override it.
38
+ - ev.pod: greatly expanded the portability section, added a porting
39
+ section, a description of watcher states and made lots of minor fixes.
40
+ - disable poll backend on AIX, the poll header spams the namespace
41
+ and it's not worth working around dead platforms (reported
42
+ and analyzed by Aivars Kalvans).
43
+ - improve header file compatibility of the standalone eventfd code
44
+ in an obscure case.
45
+ - implement EV_AVOID_STDIO option.
46
+ - do not use sscanf to parse linux version number (smaller, faster,
47
+ no sscanf dependency).
48
+ - new EV_CHILD_ENABLE and EV_SIGNAL_ENABLE configurable settings.
49
+ - update libev.m4 HAVE_CLOCK_SYSCALL test for newer glibcs.
50
+ - add section on accept() problems to the manpage.
51
+ - rename EV_TIMEOUT to EV_TIMER.
52
+ - rename ev_loop_count/depth/verify/loop/unloop.
53
+ - remove ev_default_destroy and ev_default_fork.
54
+ - switch to two-digit minor version.
55
+ - work around an apparent gentoo compiler bug.
56
+ - define _DARWIN_UNLIMITED_SELECT. just so.
57
+ - use enum instead of #define for most constants.
58
+ - improve compatibility to older C++ compilers.
59
+ - (experimental) ev_run/ev_default_loop/ev_break/ev_loop_new have now
60
+ default arguments when compiled as C++.
61
+ - enable automake dependency tracking.
62
+ - ev_loop_new no longer leaks memory when loop creation failed.
63
+ - new ev_cleanup watcher type.
64
+
65
+ 3.9 Thu Dec 31 07:59:59 CET 2009
66
+ - signalfd is no longer used by default and has to be requested
67
+ explicitly - this means that easy to catch bugs become hard to
68
+ catch race conditions, but the users have spoken.
69
+ - point out the unspecified signal mask in the documentation, and
70
+ that this is a race condition regardless of EV_SIGNALFD.
71
+ - backport inotify code to C89.
72
+ - inotify file descriptors could leak into child processes.
73
+ - ev_stat watchers could keep an errornous extra ref on the loop,
74
+ preventing exit when unregistering all watchers (testcases
75
+ provided by ry@tinyclouds.org).
76
+ - implement EV_WIN32_HANDLE_TO_FD and EV_WIN32_CLOSE_FD configuration
77
+ symbols to make it easier for apps to do their own fd management.
78
+ - support EV_IDLE_ENABLE being disabled in ev++.h
79
+ (patch by Didier Spezia).
80
+ - take advantage of inotify_init1, if available, to set cloexec/nonblock
81
+ on fd creation, to avoid races.
82
+ - the signal handling pipe wasn't always initialised under windows
83
+ (analysed by lekma).
84
+ - changed minimum glibc requirement from glibc 2.9 to 2.7, for
85
+ signalfd.
86
+ - add missing string.h include (Denis F. Latypoff).
87
+ - only replace ev_stat.prev when we detect an actual difference,
88
+ so prev is (almost) always different to attr. this might
89
+ have caused the problems with 04_stat.t.
90
+ - add ev::timer->remaining () method to C++ API.
91
+
92
+ 3.8 Sun Aug 9 14:30:45 CEST 2009
93
+ - incompatible change: do not necessarily reset signal handler
94
+ to SIG_DFL when a sighandler is stopped.
95
+ - ev_default_destroy did not properly free or zero some members,
96
+ potentially causing crashes and memory corruption on repeated
97
+ ev_default_destroy/ev_default_loop calls.
98
+ - take advantage of signalfd on GNU/Linux systems.
99
+ - document that the signal mask might be in an unspecified
100
+ state when using libev's signal handling.
101
+ - take advantage of some GNU/Linux calls to set cloexec/nonblock
102
+ on fd creation, to avoid race conditions.
103
+
104
+ 3.7 Fri Jul 17 16:36:32 CEST 2009
105
+ - ev_unloop and ev_loop wrongly used a global variable to exit loops,
106
+ instead of using a per-loop variable (bug caught by accident...).
107
+ - the ev_set_io_collect_interval interpretation has changed.
108
+ - add new functionality: ev_set_userdata, ev_userdata,
109
+ ev_set_invoke_pending_cb, ev_set_loop_release_cb,
110
+ ev_invoke_pending, ev_pending_count, together with a long example
111
+ about thread locking.
112
+ - add ev_timer_remaining (as requested by Denis F. Latypoff).
113
+ - add ev_loop_depth.
114
+ - calling ev_unloop in fork/prepare watchers will no longer poll
115
+ for new events.
116
+ - Denis F. Latypoff corrected many typos in example code snippets.
117
+ - honor autoconf detection of EV_USE_CLOCK_SYSCALL, also double-
118
+ check that the syscall number is available before trying to
119
+ use it (reported by ry@tinyclouds).
120
+ - use GetSystemTimeAsFileTime instead of _timeb on windows, for
121
+ slightly higher accuracy.
122
+ - properly declare ev_loop_verify and ev_now_update even when
123
+ !EV_MULTIPLICITY.
124
+ - do not compile in any priority code when EV_MAXPRI == EV_MINPRI.
125
+ - support EV_MINIMAL==2 for a reduced API.
126
+ - actually 0-initialise struct sigaction when installing signals.
127
+ - add section on hibernate and stopped processes to ev_timer docs.
128
+
129
+ 3.6 Tue Apr 28 02:49:30 CEST 2009
130
+ - multiple timers becoming ready within an event loop iteration
131
+ will be invoked in the "correct" order now.
132
+ - do not leave the event loop early just because we have no active
133
+ watchers, fixing a problem when embedding a kqueue loop
134
+ that has active kernel events but no registered watchers
135
+ (reported by blacksand blacksand).
136
+ - correctly zero the idx values for arrays, so destroying and
137
+ reinitialising the default loop actually works (patch by
138
+ Malek Hadj-Ali).
139
+ - implement ev_suspend and ev_resume.
140
+ - new EV_CUSTOM revents flag for use by applications.
141
+ - add documentation section about priorites.
142
+ - add a glossary to the dcoumentation.
143
+ - extend the ev_fork description slightly.
144
+ - optimize a jump out of call_pending.
145
+
146
+ 3.53 Sun Feb 15 02:38:20 CET 2009
147
+ - fix a bug in event pipe creation on win32 that would cause a
148
+ failed assertion on event loop creation (patch by Malek Hadj-Ali).
149
+ - probe for CLOCK_REALTIME support at runtime as well and fall
150
+ back to gettimeofday if there is an error, to support older
151
+ operating systems with newer header files/libraries.
152
+ - prefer gettimeofday over clock_gettime with USE_CLOCK_SYSCALL
153
+ (default most everywhere), otherwise not.
154
+
155
+ 3.52 Wed Jan 7 21:43:02 CET 2009
156
+ - fix compilation of select backend in fd_set mode when NFDBITS is
157
+ missing (to get it to compile on QNX, reported by Rodrigo Campos).
158
+ - better select-nfds handling when select backend is in fd_set mode.
159
+ - diagnose fd_set overruns when select backend is in fd_set mode.
160
+ - due to a thinko, instead of disabling everything but
161
+ select on the borked OS X platform, everything but select was
162
+ allowed (reported by Emanuele Giaquinta).
163
+ - actually verify that local and remote port are matching in
164
+ libev's socketpair emulation, which makes denial-of-service
165
+ attacks harder (but not impossible - it's windows). Make sure
166
+ it even works under vista, which thinks that getpeer/sockname
167
+ should return fantasy port numbers.
168
+ - include "libev" in all assertion messages for potentially
169
+ clearer diagnostics.
170
+ - event_get_version (libevent compatibility) returned
171
+ a useless string instead of the expected version string
172
+ (patch by W.C.A. Wijngaards).
173
+
174
+ 3.51 Wed Dec 24 23:00:11 CET 2008
175
+ - fix a bug where an inotify watcher was added twice, causing
176
+ freezes on hash collisions (reported and analysed by Graham Leggett).
177
+ - new config symbol, EV_USE_CLOCK_SYSCALL, to make libev use
178
+ a direct syscall - slower, but no dependency on librt et al.
179
+ - assume negative return values != -1 signals success of port_getn
180
+ (http://cvs.epicsol.org/cgi/viewcvs.cgi/epic5/source/newio.c?rev=1.52)
181
+ (no known failure reports, but it doesn't hurt).
182
+ - fork detection in ev_embed now stops and restarts the watcher
183
+ automatically.
184
+ - EXPERIMENTAL: default the method to operator () in ev++.h,
185
+ to make it nicer to use functors (requested by Benedek László).
186
+ - fixed const object callbacks in ev++.h.
187
+ - replaced loop_ref argument of watcher.set (loop) by a direct
188
+ ev_loop * in ev++.h, to avoid clashes with functor patch.
189
+ - do not try to watch the empty string via inotify.
190
+ - inotify watchers could be leaked under certain circumstances.
191
+ - OS X 10.5 is actually even more broken than earlier versions,
192
+ so fall back to select on that piece of garbage.
193
+ - fixed some weirdness in the ev_embed documentation.
194
+
195
+ 3.49 Wed Nov 19 11:26:53 CET 2008
196
+ - ev_stat watchers will now use inotify as a mere hint on
197
+ kernels <2.6.25, or if the filesystem is not in the
198
+ "known to be good" list.
199
+ - better mingw32 compatibility (it's not as borked as native win32)
200
+ (analysed by Roger Pack).
201
+ - include stdio.h in the example program, as too many people are
202
+ confused by the weird C language otherwise. I guess the next thing
203
+ I get told is that the "..." ellipses in the examples don't compile
204
+ with their C compiler.
205
+
206
+ 3.48 Thu Oct 30 09:02:37 CET 2008
207
+ - further optimise away the EPOLL_CTL_ADD/MOD combo in the epoll
208
+ backend by assuming the kernel event mask hasn't changed if
209
+ ADD fails with EEXIST.
210
+ - work around spurious event notification bugs in epoll by using
211
+ a 32-bit generation counter. recreate kernel state if we receive
212
+ spurious notifications or unwanted events. this is very costly,
213
+ but I didn't come up with this horrible design.
214
+ - use memset to initialise most arrays now and do away with the
215
+ init functions.
216
+ - expand time-out strategies into a "Be smart about timeouts" section.
217
+ - drop the "struct" from all ev_watcher declarations in the
218
+ documentation and did other clarifications (yeah, it was a mistake
219
+ to have a struct AND a function called ev_loop).
220
+ - fix a bug where ev_default would not initialise the default
221
+ loop again after it was destroyed with ev_default_destroy.
222
+ - rename syserr to ev_syserr to avoid name clashes when embedding,
223
+ do similar changes for event.c.
224
+
225
+ 3.45 Tue Oct 21 21:59:26 CEST 2008
226
+ - disable inotify usage on linux <2.6.25, as it is broken
227
+ (reported by Yoann Vandoorselaere).
228
+ - ev_stat erroneously would try to add inotify watchers
229
+ even when inotify wasn't available (this should only
230
+ have a performance impact).
231
+ - ev_once now passes both timeout and io to the callback if both
232
+ occur concurrently, instead of giving timeouts precedence.
233
+ - disable EV_USE_INOTIFY when sys/inotify.h is too old.
234
+
235
+ 3.44 Mon Sep 29 05:18:39 CEST 2008
236
+ - embed watchers now automatically invoke ev_loop_fork on the
237
+ embedded loop when the parent loop forks.
238
+ - new function: ev_now_update (loop).
239
+ - verify_watcher was not marked static.
240
+ - improve the "associating..." manpage section.
241
+ - documentation tweaks here and there.
242
+
243
+ 3.43 Sun Jul 6 05:34:41 CEST 2008
244
+ - include more include files on windows to get struct _stati64
245
+ (reported by Chris Hulbert, but doesn't quite fix his issue).
246
+ - add missing #include <io.h> in ev.c on windows (reported by
247
+ Matt Tolton).
248
+
249
+ 3.42 Tue Jun 17 12:12:07 CEST 2008
250
+ - work around yet another windows bug: FD_SET actually adds fd's
251
+ multiple times to the fd_*SET*, despite official MSN docs claiming
252
+ otherwise. Reported and well-analysed by Matt Tolton.
253
+ - define NFDBITS to 0 when EV_SELECT_IS_WINSOCKET to make it compile
254
+ (reported any analysed by Chris Hulbert).
255
+ - fix a bug in ev_ebadf (this function is only used to catch
256
+ programming errors in the libev user). reported by Matt Tolton.
257
+ - fix a bug in fd_intern on win32 (could lead to compile errors
258
+ under some circumstances, but would work correctly if it compiles).
259
+ reported by Matt Tolton.
260
+ - (try to) work around missing lstat on windows.
261
+ - pass in the write fd set as except fd set under windows. windows
262
+ is so uncontrollably lame that it requires this. this means that
263
+ switching off oobinline is not supported (but tcp/ip doesn't
264
+ have oob, so that would be stupid anyways.
265
+ - use posix module symbol to auto-detect monotonic clock presence
266
+ and some other default values.
267
+
268
+ 3.41 Fri May 23 18:42:54 CEST 2008
269
+ - work around an obscure bug in winsocket select: if you
270
+ provide only empty fd sets then select returns WSAEINVAL. how sucky.
271
+ - improve timer scheduling stability and reduce use of time_epsilon.
272
+ - use 1-based 2-heap for EV_MINIMAL, simplifies code, reduces
273
+ codesize and makes for better cache-efficiency.
274
+ - use 3-based 4-heap for !EV_MINIMAL. this makes better use
275
+ of cpu cache lines and gives better growth behaviour than
276
+ 2-based heaps.
277
+ - cache timestamp within heap for !EV_MINIMAL, to avoid random
278
+ memory accesses.
279
+ - document/add EV_USE_4HEAP and EV_HEAP_CACHE_AT.
280
+ - fix a potential aliasing issue in ev_timer_again.
281
+ - add/document ev_periodic_at, retract direct access to ->at.
282
+ - improve ev_stat docs.
283
+ - add portability requirements section.
284
+ - fix manpage headers etc.
285
+ - normalise WSA error codes to lower range on windows.
286
+ - add consistency check code that can be called automatically
287
+ or on demand to check for internal structures (ev_loop_verify).
288
+
289
+ 3.31 Wed Apr 16 20:45:04 CEST 2008
290
+ - added last minute fix for ev_poll.c by Brandon Black.
291
+
292
+ 3.3 Wed Apr 16 19:04:10 CEST 2008
293
+ - event_base_loopexit should return 0 on success
294
+ (W.C.A. Wijngaards).
295
+ - added linux eventfd support.
296
+ - try to autodetect epoll and inotify support
297
+ by libc header version if not using autoconf.
298
+ - new symbols: EV_DEFAULT_UC and EV_DEFAULT_UC_.
299
+ - declare functions defined in ev.h as inline if
300
+ C99 or gcc are available.
301
+ - enable inlining with gcc versions 2 and 3.
302
+ - work around broken poll implementations potentially
303
+ not clearing revents field in ev_poll (Brandon Black)
304
+ (no such systems are known at this time).
305
+ - work around a bug in realloc on openbsd and darwin,
306
+ also makes the erroneous valgrind complaints
307
+ go away (noted by various people).
308
+ - fix ev_async_pending, add c++ wrapper for ev_async
309
+ (based on patch sent by Johannes Deisenhofer).
310
+ - add sensible set method to ev::embed.
311
+ - made integer constants type int in ev.h.
312
+
313
+ 3.2 Wed Apr 2 17:11:19 CEST 2008
314
+ - fix a 64 bit overflow issue in the select backend,
315
+ by using fd_mask instead of int for the mask.
316
+ - rename internal sighandler to avoid clash with very old perls.
317
+ - entering ev_loop will not clear the ONESHOT or NONBLOCKING
318
+ flags of any outer loops anymore.
319
+ - add ev_async_pending.
320
+
321
+ 3.1 Thu Mar 13 13:45:22 CET 2008
322
+ - implement ev_async watchers.
323
+ - only initialise signal pipe on demand.
324
+ - make use of sig_atomic_t configurable.
325
+ - improved documentation.
326
+
327
+ 3.0 Mon Jan 28 13:14:47 CET 2008
328
+ - API/ABI bump to version 3.0.
329
+ - ev++.h includes "ev.h" by default now, not <ev.h>.
330
+ - slightly improved documentation.
331
+ - speed up signal detection after a fork.
332
+ - only optionally return trace status changed in ev_child
333
+ watchers.
334
+ - experimental (and undocumented) loop wrappers for ev++.h.
335
+
336
+ 2.01 Tue Dec 25 08:04:41 CET 2007
337
+ - separate Changes file.
338
+ - fix ev_path_set => ev_stat_set typo.
339
+ - remove event_compat.h from the libev tarball.
340
+ - change how include files are found.
341
+ - doc updates.
342
+ - update licenses, explicitly allow for GPL relicensing.
343
+
344
+ 2.0 Sat Dec 22 17:47:03 CET 2007
345
+ - new ev_sleep, ev_set_(io|timeout)_collect_interval.
346
+ - removed epoll from embeddable fd set.
347
+ - fix embed watchers.
348
+ - renamed ev_embed.loop to other.
349
+ - added exported Symbol tables.
350
+ - undefine member wrapper macros at the end of ev.c.
351
+ - respect EV_H in ev++.h.
352
+
353
+ 1.86 Tue Dec 18 02:36:57 CET 2007
354
+ - fix memleak on loop destroy (not relevant for perl).
355
+
356
+ 1.85 Fri Dec 14 20:32:40 CET 2007
357
+ - fix some aliasing issues w.r.t. timers and periodics
358
+ (not relevant for perl).
359
+
360
+ (for historic versions refer to EV/Changes, found in the Perl interface)
361
+
362
+ 0.1 Wed Oct 31 21:31:48 CET 2007
363
+ - original version; hacked together in <24h.
364
+