diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-30 13:17:39 +0100 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-30 13:17:39 +0100 |
| commit | cbf4b60df6c6c8c7208dc29708677d24b2724deb (patch) | |
| tree | 8b4cec720c1fe6464309b1de6ba441fc4e2191c3 /opentracker.c | |
| parent | 4b1264cb26a481faf8448322ebb19b8993ae6aaf (diff) | |
Enforce the invariant that each socket is only ever expected to be read from or written to, never both
Diffstat (limited to 'opentracker.c')
| -rw-r--r-- | opentracker.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/opentracker.c b/opentracker.c index b54327a..27b2570 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); |
