diff options
Diffstat (limited to 'opentracker.c')
| -rw-r--r-- | opentracker.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/opentracker.c b/opentracker.c index b54327a..ec92fe0 100644 --- a/opentracker.c +++ b/opentracker.c | |||
| @@ -180,12 +180,11 @@ static void handle_write(const int64_t sock) { | |||
| 180 | 180 | ||
| 181 | /* In a chunked transfer, wait for the next piece once everything queued has gone out */ | 181 | /* In a chunked transfer, wait for the next piece once everything queued has gone out */ |
| 182 | if (chunked) | 182 | if (chunked) |
| 183 | http_interest_drop(sock, cookie, EVENT_OUT); | 183 | http_interest_set(sock, cookie, 0); |
| 184 | else if (keep_alive) { | 184 | else if (keep_alive) { |
| 185 | /* The reply is out and the client asked to keep the connection, so stop | 185 | /* The reply is out and the client asked to keep the connection, so go |
| 186 | waiting to write and go back to waiting for the next request */ | 186 | back to waiting for the next request */ |
| 187 | http_interest_drop(sock, cookie, EVENT_OUT); | 187 | http_interest_set(sock, cookie, EVENT_IN); |
| 188 | http_interest_add(sock, cookie, EVENT_IN); | ||
| 189 | fdstate_set_expiry(sock, time_future_seconds(OT_CLIENT_TIMEOUT)); | 188 | fdstate_set_expiry(sock, time_future_seconds(OT_CLIENT_TIMEOUT)); |
| 190 | } else | 189 | } else |
| 191 | http_close(sock); | 190 | http_close(sock); |
| @@ -340,6 +339,7 @@ static void listen_bind_one(ot_listen *entry) { | |||
| 340 | if (entry->proto == FLAG_TCP) { | 339 | if (entry->proto == FLAG_TCP) { |
| 341 | if ((entry->sock = socket_tcp_listen(entry->ip, entry->port, sharing)) == -1) | 340 | if ((entry->sock = socket_tcp_listen(entry->ip, entry->port, sharing)) == -1) |
| 342 | panic("socket_tcp_listen"); | 341 | panic("socket_tcp_listen"); |
| 342 | socket_defer_accept((int)entry->sock); | ||
| 343 | } else { | 343 | } else { |
| 344 | if ((entry->sock = socket_udp_bind(entry->ip, entry->port, sharing)) == -1) | 344 | if ((entry->sock = socket_udp_bind(entry->ip, entry->port, sharing)) == -1) |
| 345 | panic("socket_udp_bind"); | 345 | panic("socket_udp_bind"); |
