[go: nahoru, domu]

Skip to content

Commit

Permalink
example: 'max_buffer_size' should NOT be 0 for http client context
Browse files Browse the repository at this point in the history
Or else, on_body only called back once
  • Loading branch information
chenbd authored and Baodong Chen committed Feb 27, 2019
1 parent 531ca30 commit 8602879
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions examples/libh2o/httpclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,18 @@ int main(int argc, char **argv)
{
h2o_multithread_queue_t *queue;
h2o_multithread_receiver_t getaddr_receiver;
uint64_t io_timeout = 5000; /* 5 seconds */
h2o_httpclient_ctx_t ctx = {NULL, &getaddr_receiver, io_timeout, io_timeout, io_timeout};
ctx.max_buffer_size = SIZE_MAX;

const uint64_t timeout = 5000; /* 5 seconds */
h2o_httpclient_ctx_t ctx = {
NULL, /* loop */
&getaddr_receiver,
timeout, /* io_timeout */
timeout, /* connect_timeout */
timeout, /* first_byte_timeout */
NULL, /* websocket_timeout */
0, /* keepalive_timeout */
H2O_SOCKET_INITIAL_INPUT_BUFFER_SIZE * 2 /* max_buffer_size */
};
int opt;

SSL_load_error_strings();
Expand Down

0 comments on commit 8602879

Please sign in to comment.