[go: nahoru, domu]

Skip to content

Commit

Permalink
all output parameters must be set by the callback (cherry-picked from…
Browse files Browse the repository at this point in the history
… kazuho/quic)
  • Loading branch information
kazuho committed Mar 6, 2019
1 parent 9a72b2d commit 1503b3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/libh2o/httpclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ h2o_httpclient_head_cb on_connect(h2o_httpclient_t *client, const char *errstr,
*headers = NULL;
*num_headers = 0;
*body = h2o_iovec_init(NULL, 0);
*proceed_req_cb = NULL;

if (cur_body_size > 0) {
char *clbuf = h2o_mem_alloc_pool(&pool, char, sizeof(H2O_UINT32_LONGEST_STR) - 1);
Expand Down
5 changes: 5 additions & 0 deletions include/h2o/httpclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ typedef int (*h2o_httpclient_body_cb)(h2o_httpclient_t *client, const char *errs
typedef h2o_httpclient_body_cb (*h2o_httpclient_head_cb)(h2o_httpclient_t *client, const char *errstr, int version, int status,
h2o_iovec_t msg, h2o_header_t *headers, size_t num_headers,
int header_requires_dup);
/**
* Called when the protocol stack is ready to issue a request. Application must set all the output parameters (i.e. all except
* `client`, `errstr`, `origin`) and return a callback that will be called when the protocol stack receives the response headers
* from the server.
*/
typedef h2o_httpclient_head_cb (*h2o_httpclient_connect_cb)(h2o_httpclient_t *client, const char *errstr, h2o_iovec_t *method,
h2o_url_t *url, const h2o_header_t **headers, size_t *num_headers,
h2o_iovec_t *body, h2o_httpclient_proceed_req_cb *proceed_req_cb,
Expand Down

0 comments on commit 1503b3c

Please sign in to comment.