Merge branch 'release/1.1.0' Conflicts: evhtp.c
diff --git a/evhtp.c b/evhtp.c index 280a284..66a149c 100644 --- a/evhtp.c +++ b/evhtp.c
@@ -185,6 +185,20 @@ scode_tree_initialized = 1; } /* status_code_init */ +static void +status_code_deinit(void) { + struct status_code *c; + struct status_code *nxt; + + for(c = RB_MIN(status_code_tree, &status_code_head); c != NULL; c = nxt) { + nxt = RB_NEXT(status_code_tree, &status_code_head, c); + RB_REMOVE(status_code_tree, &status_code_head, c); + free(c); + } + + scode_tree_initialized = 0; +} + const char * status_code_to_str(evhtp_res code) { struct status_code c; @@ -2502,6 +2516,15 @@ } /* evhtp_bind_socket */ void +evhtp_unbind_socket(evhtp_t * htp, int deinit_status_codes) { + if (deinit_status_codes) { + status_code_deinit(); + } + + evconnlistener_free(htp->server); +} + +void evhtp_callbacks_free(evhtp_callbacks_t * callbacks) { /* XXX TODO */ }
diff --git a/evhtp.h b/evhtp.h index 081d94a..e826a4a 100644 --- a/evhtp.h +++ b/evhtp.h
@@ -651,6 +651,7 @@ * @return */ int evhtp_bind_sockaddr(evhtp_t * htp, struct sockaddr *, size_t sin_len, int backlog); +void evhtp_unbind_socket(evhtp_t * htp, int deinit_status_codes); int evhtp_use_threads(evhtp_t * htp, evhtp_thread_init_cb init_cb, int nthreads, void * arg); void evhtp_send_reply(evhtp_request_t * request, evhtp_res code);