Permalink
Browse files

Migrate from select to rb_thread_fd_select

  • Loading branch information...
1 parent ea4712f commit 0f68ea7dfa6ea3a25b619aa8ba49c2826eb33cbb @Pikrass Pikrass committed Jan 27, 2014
Showing with 4 additions and 8 deletions.
  1. +0 −4 TODO
  2. +4 −4 ext/fcgi/fcgi.c
View
4 TODO
@@ -1,4 +0,0 @@
-* move from select() to rb_thread_fd_select(),
- since rb_thread_select() is deprecated
- (and I have no time to do that now, unfortunately)
- any help is welcomed.
View
@@ -78,7 +78,7 @@ static VALUE fcgi_s_accept(VALUE self)
{
int status;
FCGX_Request *req;
- fd_set readfds;
+ rb_fdset_t readfds;
req = ALLOC(FCGX_Request);
@@ -88,9 +88,9 @@ static VALUE fcgi_s_accept(VALUE self)
return Qnil;
}
- FD_ZERO(&readfds);
- FD_SET(req->listen_sock, &readfds);
- if (select(req->listen_sock+1, &readfds, NULL, NULL, NULL) < 1) {
+ rb_fd_init(&readfds);
+ rb_fd_set(req->listen_sock, &readfds);
+ if (rb_thread_fd_select(readfds.maxfd, &readfds, NULL, NULL, NULL) < 1) {
return Qnil;
}

0 comments on commit 0f68ea7

Please sign in to comment.