Skip to content

Commit

Permalink
evhttp_request_set_on_complete_cb to be more specific about what the …
Browse files Browse the repository at this point in the history
…function actually does and usage
  • Loading branch information
asweeney86 committed Jan 7, 2014
1 parent b083ca0 commit da86dda
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions http.c
Original file line number Diff line number Diff line change
Expand Up @@ -3846,10 +3846,10 @@ evhttp_request_set_error_cb(struct evhttp_request *req,

void
evhttp_request_set_on_complete_cb(struct evhttp_request *req,
void (*cb)(struct evhttp_request *, void *), void *arg)
void (*cb)(struct evhttp_request *, void *), void *cb_arg)
{
req->on_complete_cb = cb;
req->on_complete_cb_arg = arg;
req->on_complete_cb_arg = cb_arg;
}

/*
Expand Down
17 changes: 11 additions & 6 deletions include/event2/http.h
Original file line number Diff line number Diff line change
Expand Up @@ -555,14 +555,19 @@ void evhttp_request_set_error_cb(struct evhttp_request *,
void (*)(enum evhttp_request_error, void *));

/**
* Set a on request complete callback.
* Set a callback to be called on request completion of evhttp_send_* function.
*
* Receive a callback on request completion. This callback is triggered once
* the request is complete and all resources associated with the request will
* be released.
* The callback function will be called on the completion of the request after
* the output data has been written and before the evhttp_request object
* is destroyed. This can be useful for tracking resources associated with a
* request (ex: timing metrics).
*
* @param req a request object
* @param cb callback function that will be called on request completion
* @param cb_arg an additional context argument for the callback
*/
void evhttp_request_set_on_complete_cb(struct evhttp_request *,
void (*)(struct evhttp_request *, void *), void *);
void evhttp_request_set_on_complete_cb(struct evhttp_request *req,
void (*cb)(struct evhttp_request *, void *), void *cb_arg);

/** Frees the request object and removes associated events. */
void evhttp_request_free(struct evhttp_request *req);
Expand Down

0 comments on commit da86dda

Please sign in to comment.