kgio 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +4 -0
- data/GIT-VERSION-GEN +1 -1
- data/GNUmakefile +1 -1
- data/ext/kgio/accept.c +3 -2
- data/ext/kgio/connect.c +2 -1
- data/ext/kgio/kgio.h +4 -4
- data/ext/kgio/kgio_ext.c +4 -6
- data/ext/kgio/missing/accept4.h +6 -2
- data/ext/kgio/read_write.c +2 -1
- data/ext/kgio/wait.c +3 -1
- metadata +8 -4
data/.document
CHANGED
data/GIT-VERSION-GEN
CHANGED
data/GNUmakefile
CHANGED
@@ -155,7 +155,7 @@ ext := ext/kgio/kgio_ext.$(DLEXT)
|
|
155
155
|
ext/kgio/Makefile: ext/kgio/extconf.rb
|
156
156
|
cd $(@D) && $(RUBY) extconf.rb
|
157
157
|
|
158
|
-
$(ext): ext/kgio/
|
158
|
+
$(ext): $(wildcard ext/kgio/*.[ch] ext/kgio/*/*.h) ext/kgio/Makefile
|
159
159
|
$(MAKE) -C $(@D)
|
160
160
|
|
161
161
|
all:: test
|
data/ext/kgio/accept.c
CHANGED
@@ -283,7 +283,7 @@ static VALUE get_nonblock(VALUE mod)
|
|
283
283
|
* call-seq:
|
284
284
|
*
|
285
285
|
* Kgio.accept_cloexec = true
|
286
|
-
* Kgio.
|
286
|
+
* Kgio.accept_cloexec = false
|
287
287
|
*
|
288
288
|
* Sets whether or not Kgio::Socket objects created by
|
289
289
|
* TCPServer#kgio_accept,
|
@@ -341,9 +341,10 @@ static VALUE set_nonblock(VALUE mod, VALUE boolean)
|
|
341
341
|
return Qnil;
|
342
342
|
}
|
343
343
|
|
344
|
-
void init_kgio_accept(
|
344
|
+
void init_kgio_accept(void)
|
345
345
|
{
|
346
346
|
VALUE cUNIXServer, cTCPServer;
|
347
|
+
VALUE mKgio = rb_define_module("Kgio");
|
347
348
|
|
348
349
|
localhost = rb_const_get(mKgio, rb_intern("LOCALHOST"));
|
349
350
|
cKgio_Socket = rb_const_get(mKgio, rb_intern("Socket"));
|
data/ext/kgio/connect.c
CHANGED
@@ -223,8 +223,9 @@ static VALUE kgio_start(VALUE klass, VALUE addr)
|
|
223
223
|
return stream_connect(klass, addr, 0);
|
224
224
|
}
|
225
225
|
|
226
|
-
void init_kgio_connect(
|
226
|
+
void init_kgio_connect(void)
|
227
227
|
{
|
228
|
+
VALUE mKgio = rb_define_module("Kgio");
|
228
229
|
VALUE cSocket = rb_const_get(rb_cObject, rb_intern("Socket"));
|
229
230
|
VALUE mSocketMethods = rb_const_get(mKgio, rb_intern("SocketMethods"));
|
230
231
|
VALUE cKgio_Socket, cTCPSocket, cUNIXSocket;
|
data/ext/kgio/kgio.h
CHANGED
@@ -29,10 +29,10 @@ struct io_args {
|
|
29
29
|
int fd;
|
30
30
|
};
|
31
31
|
|
32
|
-
void init_kgio_wait(
|
33
|
-
void init_kgio_read_write(
|
34
|
-
void init_kgio_accept(
|
35
|
-
void init_kgio_connect(
|
32
|
+
void init_kgio_wait(void);
|
33
|
+
void init_kgio_read_write(void);
|
34
|
+
void init_kgio_accept(void);
|
35
|
+
void init_kgio_connect(void);
|
36
36
|
|
37
37
|
void kgio_wait_writable(VALUE io, int fd);
|
38
38
|
void kgio_wait_readable(VALUE io, int fd);
|
data/ext/kgio/kgio_ext.c
CHANGED
@@ -2,10 +2,8 @@
|
|
2
2
|
|
3
3
|
void Init_kgio_ext(void)
|
4
4
|
{
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
init_kgio_connect(mKgio);
|
10
|
-
init_kgio_accept(mKgio);
|
5
|
+
init_kgio_wait();
|
6
|
+
init_kgio_read_write();
|
7
|
+
init_kgio_connect();
|
8
|
+
init_kgio_accept();
|
11
9
|
}
|
data/ext/kgio/missing/accept4.h
CHANGED
@@ -33,8 +33,12 @@ accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags)
|
|
33
33
|
if ((flags & SOCK_NONBLOCK) == SOCK_NONBLOCK) {
|
34
34
|
int fl = fcntl(fd, F_GETFL);
|
35
35
|
|
36
|
-
|
37
|
-
|
36
|
+
/*
|
37
|
+
* unconditional, OSX 10.4 (and maybe other *BSDs)
|
38
|
+
* F_GETFL returns a false O_NONBLOCK with TCP sockets
|
39
|
+
* (but not UNIX sockets) [ruby-talk:274079]
|
40
|
+
*/
|
41
|
+
(void)fcntl(fd, F_SETFL, fl | O_NONBLOCK);
|
38
42
|
}
|
39
43
|
|
40
44
|
/*
|
data/ext/kgio/read_write.c
CHANGED
@@ -340,9 +340,10 @@ static VALUE kgio_trysend(VALUE io, VALUE str)
|
|
340
340
|
# define kgio_trysend kgio_trywrite
|
341
341
|
#endif /* ! USE_MSG_DONTWAIT */
|
342
342
|
|
343
|
-
void init_kgio_read_write(
|
343
|
+
void init_kgio_read_write(void)
|
344
344
|
{
|
345
345
|
VALUE mPipeMethods, mSocketMethods;
|
346
|
+
VALUE mKgio = rb_define_module("Kgio");
|
346
347
|
|
347
348
|
mKgio_WaitReadable = rb_const_get(mKgio, rb_intern("WaitReadable"));
|
348
349
|
mKgio_WaitWritable = rb_const_get(mKgio, rb_intern("WaitWritable"));
|
data/ext/kgio/wait.c
CHANGED
@@ -106,8 +106,10 @@ static VALUE wait_rd(VALUE mod)
|
|
106
106
|
return io_wait_rd ? ID2SYM(io_wait_rd) : Qnil;
|
107
107
|
}
|
108
108
|
|
109
|
-
void init_kgio_wait(
|
109
|
+
void init_kgio_wait(void)
|
110
110
|
{
|
111
|
+
VALUE mKgio = rb_define_module("Kgio");
|
112
|
+
|
111
113
|
rb_define_singleton_method(mKgio, "wait_readable=", set_wait_rd, 1);
|
112
114
|
rb_define_singleton_method(mKgio, "wait_writable=", set_wait_wr, 1);
|
113
115
|
rb_define_singleton_method(mKgio, "wait_readable", wait_rd, 0);
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kgio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 1
|
10
|
+
version: 1.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- kgio hackers
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-10-
|
18
|
+
date: 2010-10-07 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -38,7 +38,11 @@ extra_rdoc_files:
|
|
38
38
|
- ISSUES
|
39
39
|
- HACKING
|
40
40
|
- lib/kgio.rb
|
41
|
+
- ext/kgio/accept.c
|
42
|
+
- ext/kgio/connect.c
|
41
43
|
- ext/kgio/kgio_ext.c
|
44
|
+
- ext/kgio/read_write.c
|
45
|
+
- ext/kgio/wait.c
|
42
46
|
files:
|
43
47
|
- .document
|
44
48
|
- .gitignore
|