summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2024-04-14 05:12:42 +0200
committerDirk Engling <erdgeist@erdgeist.org>2024-04-14 05:12:42 +0200
commitfceffdefba11bb924c323af0a1c15eaeb027beca (patch)
tree6c7fc51146d524bcf7b70f1f8ca2e940ee9d950a
parentf4a389da3ffa7e7a4bafbe9c73d1319262ec2035 (diff)
Call io_dontwantread only once on a socket
-rw-r--r--ot_http.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ot_http.c b/ot_http.c
index cce6dc2..1d4497a 100644
--- a/ot_http.c
+++ b/ot_http.c
@@ -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
144fprintf(stderr, "http_sendiovecdata sending %d iovec entries found cookie->batch == %p\n", iovec_entries, cookie->batch); 147fprintf(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 );
211fprintf (stderr, "http_sendiovecdata marks socket %lld as wantwrite\n", sock); 213fprintf (stderr, "http_sendiovecdata marks socket %lld as wantwrite\n", sock);
212 io_wantwrite( sock ); 214 io_wantwrite( sock );
213 return 0; 215 return 0;