Skip to content
Browse files

Merge commit 'origin/master' into writev

  • Loading branch information...
2 parents 56af470 + 2be787c commit 0cc3309adb8d792232f47ca073854ec2dad76530 @stash committed Jun 22, 2010
Showing with 20 additions and 10 deletions.
  1. +5 −9 Feersum.xs
  2. +9 −1 README
  3. +4 −0 example/hello.pl
  4. +2 −0 lib/Feersum.pm
View
14 Feersum.xs
@@ -383,6 +383,7 @@ new_feer_conn (EV_P_ int conn_fd)
ev_init(&c->read_ev_timer, conn_read_timeout);
c->read_ev_timer.repeat = read_timeout;
c->read_ev_timer.data = (void *)c;
+ ev_timer_again(EV_A, &c->read_ev_timer);
trace("made conn fd=%d self=%p, c=%p, cur=%d, len=%d\n",
c->fd, self, c, SvCUR(self), SvLEN(self));
@@ -659,18 +660,20 @@ try_conn_read(EV_P_ ev_io *w, int revents)
try_read_error:
trace("try read error %d\n", w->fd);
- ev_io_stop(EV_A, w);
c->receiving = RECEIVE_SHUTDOWN;
c->responding = RESPOND_SHUTDOWN;
+ ev_io_stop(EV_A, w);
+ ev_timer_stop(EV_A, &c->read_ev_timer);
shutdown(c->fd, SHUT_RDWR);
SvREFCNT_dec(c->self);
return;
dont_read_again:
+ trace("done reading %d\n", w->fd);
c->receiving = RECEIVE_SHUTDOWN;
- shutdown(c->fd, SHUT_RD); // TODO: respect keep-alive
ev_io_stop(EV_A, w);
ev_timer_stop(EV_A, &c->read_ev_timer);
+ shutdown(c->fd, SHUT_RD); // TODO: respect keep-alive
return;
try_read_again_reset_timer:
@@ -750,8 +753,6 @@ accept_cb (EV_P_ ev_io *w, int revents)
// XXX: good idea to read right away?
// try_conn_read(EV_A, &c->read_ev_io, EV_READ);
ev_io_start(EV_A, &c->read_ev_io);
- // alternative to ev_timer_start, from the libev man-page
- ev_timer_again(EV_A, &c->read_ev_timer);
}
}
@@ -1562,11 +1563,6 @@ DESTROY (struct feer_conn *c)
if (c->fd) close(c->fd);
- if (ev_is_active(&c->read_ev_timer)) {
- trace("... hmm, read timer was still active");
- ev_timer_stop(c->loop, &c->read_ev_timer);
- }
-
active_conns--;
if (shutting_down && active_conns <= 0) {
View
10 README
@@ -1,12 +1,20 @@
INSTALLATION
+If you downloaded this module from a git repository, be sure to run:
+
+ git submodule init
+ git submodule update
+
To install this module type the following:
perl Makefile.PL
- make
make test
make install
+Please report any bugs using the github issue tracker:
+
+ http://github.com/stash/Feersum/issues/
+
COPYRIGHT AND LICENCE
Copyright (C) 2010 by Jeremy Stashewsky & Socialtext Inc.
View
4 example/hello.pl
@@ -30,4 +30,8 @@
], "Hello customer number $n\n");
});
+my $t = EV::timer 1, 1, sub {
+ print "served $counter\n";
+};
+
EV::loop;
View
2 lib/Feersum.pm
@@ -289,6 +289,8 @@ __END__
=head1 BUGS
+Please report bugs using http://github.com/stash/Feersum/issues/
+
Keep-alive is ignored completely.
Chunked-encoding responses can be sent to HTTP/1.0 clients, which is only part

0 comments on commit 0cc3309

Please sign in to comment.
Something went wrong with that request. Please try again.