diff options
author | Dirk Engling <erdgeist@erdgeist.org> | 2024-04-14 05:12:42 +0200 |
---|---|---|
committer | Dirk Engling <erdgeist@erdgeist.org> | 2024-04-14 05:12:42 +0200 |
commit | fceffdefba11bb924c323af0a1c15eaeb027beca (patch) | |
tree | 6c7fc51146d524bcf7b70f1f8ca2e940ee9d950a | |
parent | f4a389da3ffa7e7a4bafbe9c73d1319262ec2035 (diff) |
Call io_dontwantread only once on a socket
-rw-r--r-- | ot_http.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -139,7 +139,10 @@ ssize_t http_sendiovecdata( const int64 sock, struct ot_workstruct *ws, int iove | |||
139 | array_reset( &cookie->request ); | 139 | array_reset( &cookie->request ); |
140 | 140 | ||
141 | /* If we came here, wait for the answer is over */ | 141 | /* If we came here, wait for the answer is over */ |
142 | cookie->flag &= ~STRUCT_HTTP_FLAG_WAITINGFORTASK; | 142 | if (cookie->flag & STRUCT_HTTP_FLAG_WAITINGFORTASK) { |
143 | io_dontwantread( sock ); | ||
144 | cookie->flag &= ~STRUCT_HTTP_FLAG_WAITINGFORTASK; | ||
145 | } | ||
143 | 146 | ||
144 | fprintf(stderr, "http_sendiovecdata sending %d iovec entries found cookie->batch == %p\n", iovec_entries, cookie->batch); | 147 | fprintf(stderr, "http_sendiovecdata sending %d iovec entries found cookie->batch == %p\n", iovec_entries, cookie->batch); |
145 | 148 | ||
@@ -207,7 +210,6 @@ fprintf(stderr, "http_sendiovecdata adds a terminating 0 size buffer to batch\n" | |||
207 | /* writeable sockets timeout after 10 minutes */ | 210 | /* writeable sockets timeout after 10 minutes */ |
208 | taia_now( &t ); taia_addsec( &t, &t, OT_CLIENT_TIMEOUT_SEND ); | 211 | taia_now( &t ); taia_addsec( &t, &t, OT_CLIENT_TIMEOUT_SEND ); |
209 | io_timeout( sock, t ); | 212 | io_timeout( sock, t ); |
210 | io_dontwantread( sock ); | ||
211 | fprintf (stderr, "http_sendiovecdata marks socket %lld as wantwrite\n", sock); | 213 | fprintf (stderr, "http_sendiovecdata marks socket %lld as wantwrite\n", sock); |
212 | io_wantwrite( sock ); | 214 | io_wantwrite( sock ); |
213 | return 0; | 215 | return 0; |