summaryrefslogtreecommitdiff
path: root/ot_http.c
diff options
context:
space:
mode:
Diffstat (limited to 'ot_http.c')
-rw-r--r--ot_http.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/ot_http.c b/ot_http.c
index 1d4497a..c5d553a 100644
--- a/ot_http.c
+++ b/ot_http.c
@@ -144,8 +144,6 @@ ssize_t http_sendiovecdata( const int64 sock, struct ot_workstruct *ws, int iove
144 cookie->flag &= ~STRUCT_HTTP_FLAG_WAITINGFORTASK; 144 cookie->flag &= ~STRUCT_HTTP_FLAG_WAITINGFORTASK;
145 } 145 }
146 146
147fprintf(stderr, "http_sendiovecdata sending %d iovec entries found cookie->batch == %p\n", iovec_entries, cookie->batch);
148
149 if( iovec_entries ) { 147 if( iovec_entries ) {
150 148
151 if( cookie->flag & STRUCT_HTTP_FLAG_GZIP ) 149 if( cookie->flag & STRUCT_HTTP_FLAG_GZIP )
@@ -184,7 +182,6 @@ fprintf(stderr, "http_sendiovecdata sending %d iovec entries found cookie->batch
184 for( i=0; i<iovec_entries; ++i ) { 182 for( i=0; i<iovec_entries; ++i ) {
185 /* If the current batch's limit is reached, try to reallocate a new batch to work on */ 183 /* If the current batch's limit is reached, try to reallocate a new batch to work on */
186 if( current->bytesleft > OT_BATCH_LIMIT ) { 184 if( current->bytesleft > OT_BATCH_LIMIT ) {
187fprintf(stderr, "http_sendiovecdata found batch above limit: %llu\n", current->bytesleft);
188 io_batch * new_batch = realloc( cookie->batch, (cookie->batches + 1) * sizeof(io_batch) ); 185 io_batch * new_batch = realloc( cookie->batch, (cookie->batches + 1) * sizeof(io_batch) );
189 if( new_batch ) { 186 if( new_batch ) {
190 cookie->batch = new_batch; 187 cookie->batch = new_batch;
@@ -192,7 +189,6 @@ fprintf(stderr, "http_sendiovecdata found batch above limit: %llu\n", current->b
192 iob_init_autofree(current ,0); 189 iob_init_autofree(current ,0);
193 } 190 }
194 } 191 }
195fprintf(stderr, "http_sendiovecdata calling iob_addbuf_free with %zd\n", iovector[i].iov_len);
196 iob_addbuf_free( current, iovector[i].iov_base, iovector[i].iov_len ); 192 iob_addbuf_free( current, iovector[i].iov_base, iovector[i].iov_len );
197 } 193 }
198 free( iovector ); 194 free( iovector );
@@ -201,7 +197,6 @@ fprintf(stderr, "http_sendiovecdata calling iob_addbuf_free with %zd\n", iovecto
201 } 197 }
202 198
203 if ((cookie->flag & STRUCT_HTTP_FLAG_CHUNKED_IN_TRANSFER) && cookie->batch && !is_partial) { 199 if ((cookie->flag & STRUCT_HTTP_FLAG_CHUNKED_IN_TRANSFER) && cookie->batch && !is_partial) {
204fprintf(stderr, "http_sendiovecdata adds a terminating 0 size buffer to batch\n");
205 current = cookie->batch + cookie->batches - 1; 200 current = cookie->batch + cookie->batches - 1;
206 iob_addbuf(current, "0\r\n\r\n", 5); 201 iob_addbuf(current, "0\r\n\r\n", 5);
207 cookie->flag &= ~STRUCT_HTTP_FLAG_CHUNKED_IN_TRANSFER; 202 cookie->flag &= ~STRUCT_HTTP_FLAG_CHUNKED_IN_TRANSFER;
@@ -210,7 +205,6 @@ fprintf(stderr, "http_sendiovecdata adds a terminating 0 size buffer to batch\n"
210 /* writeable sockets timeout after 10 minutes */ 205 /* writeable sockets timeout after 10 minutes */
211 taia_now( &t ); taia_addsec( &t, &t, OT_CLIENT_TIMEOUT_SEND ); 206 taia_now( &t ); taia_addsec( &t, &t, OT_CLIENT_TIMEOUT_SEND );
212 io_timeout( sock, t ); 207 io_timeout( sock, t );
213fprintf (stderr, "http_sendiovecdata marks socket %lld as wantwrite\n", sock);
214 io_wantwrite( sock ); 208 io_wantwrite( sock );
215 return 0; 209 return 0;
216} 210}