diff options
author | Dirk Engling <erdgeist@erdgeist.org> | 2024-04-13 16:54:44 +0200 |
---|---|---|
committer | Dirk Engling <erdgeist@erdgeist.org> | 2024-04-13 16:54:44 +0200 |
commit | 57f859728d789400de0cd04a13d3d22c2b27ba6f (patch) | |
tree | bb98878ac9b9caa30a78949561e8293a0351a22e | |
parent | a3d27dff8c5eeff4b9ad56f0d54646d9bb5026d7 (diff) |
Initialise io_batches with their appropiate init function
-rw-r--r-- | ot_http.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -77,7 +77,7 @@ static void http_senddata( const int64 sock, struct ot_workstruct *ws ) { | |||
77 | memcpy( outbuf, ws->reply + written_size, ws->reply_size - written_size ); | 77 | memcpy( outbuf, ws->reply + written_size, ws->reply_size - written_size ); |
78 | if ( !cookie->batch ) { | 78 | if ( !cookie->batch ) { |
79 | cookie->batch = malloc( sizeof(io_batch) ); | 79 | cookie->batch = malloc( sizeof(io_batch) ); |
80 | memset( cookie->batch, 0, sizeof(io_batch) ); | 80 | iob_init_autofree(cookie->batch, 0); |
81 | cookie->batches = 1; | 81 | cookie->batches = 1; |
82 | } | 82 | } |
83 | 83 | ||
@@ -171,7 +171,7 @@ fprintf(stderr, "http_sendiovecdata sending %d iovec entries found cookie->batch | |||
171 | iovec_free( &iovec_entries, &iovector ); | 171 | iovec_free( &iovec_entries, &iovector ); |
172 | HTTPERROR_500; | 172 | HTTPERROR_500; |
173 | } | 173 | } |
174 | memset( cookie->batch, 0, sizeof(io_batch) ); | 174 | iob_init_autofree(cookie->batch, 0); |
175 | cookie->batches = 1; | 175 | cookie->batches = 1; |
176 | } | 176 | } |
177 | current = cookie->batch + cookie->batches - 1; | 177 | current = cookie->batch + cookie->batches - 1; |
@@ -186,7 +186,7 @@ fprintf(stderr, "http_sendiovecdata found batch above limit: %llu\n", current->b | |||
186 | if( new_batch ) { | 186 | if( new_batch ) { |
187 | cookie->batch = new_batch; | 187 | cookie->batch = new_batch; |
188 | current = cookie->batch + cookie->batches++; | 188 | current = cookie->batch + cookie->batches++; |
189 | memset( current, 0, sizeof(io_batch) ); | 189 | iob_init_autofree(current ,0); |
190 | } | 190 | } |
191 | } | 191 | } |
192 | fprintf(stderr, "http_sendiovecdata calling iob_addbuf_free with %zd\n", iovector[i].iov_len); | 192 | fprintf(stderr, "http_sendiovecdata calling iob_addbuf_free with %zd\n", iovector[i].iov_len); |