From b77d83c60b04c26183330b8e3b0b05fc416bab1c Mon Sep 17 00:00:00 2001 From: Jianhui Zhao Date: Tue, 8 Sep 2020 22:45:21 +0800 Subject: [PATCH] uh_connection: remove api: free Signed-off-by: Jianhui Zhao --- src/connection.c | 3 +-- src/connection.h | 1 - src/uhttpd.c | 4 +++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/connection.c b/src/connection.c index b96aa53..b005735 100644 --- a/src/connection.c +++ b/src/connection.c @@ -373,7 +373,7 @@ static struct http_parser_settings settings = { .on_message_complete = on_message_complete_cb }; -static void conn_free(struct uh_connection *conn) +void conn_free(struct uh_connection *conn) { struct ev_loop *loop = conn->srv->loop; struct sockaddr_in *addr = &conn->addr; @@ -589,7 +589,6 @@ struct uh_connection *uh_new_connection(struct uh_server *srv, int sock, struct conn->parser.data = conn; - conn->free = conn_free; conn->done = conn_done; conn->send = conn_send; conn->send_file = conn_send_file; diff --git a/src/connection.h b/src/connection.h index 288d7e6..7603be7 100644 --- a/src/connection.h +++ b/src/connection.h @@ -94,7 +94,6 @@ struct uh_connection { struct http_parser_url url_parser; struct uh_connection *prev; struct uh_connection *next; - void (*free)(struct uh_connection *conn); void (*done)(struct uh_connection *conn); /* Must be called at last, if not call 'error', 'redirect' and 'serve_file' */ void (*send)(struct uh_connection *conn, const void *data, ssize_t len); void (*send_file)(struct uh_connection *conn, const char *path); diff --git a/src/uhttpd.c b/src/uhttpd.c index 9306637..5c23599 100644 --- a/src/uhttpd.c +++ b/src/uhttpd.c @@ -37,6 +37,8 @@ #include "ssl.h" #include "log.h" +void conn_free(struct uh_connection *conn); + static void uh_server_free(struct uh_server *srv) { struct uh_connection *conn = srv->conns; @@ -48,7 +50,7 @@ static void uh_server_free(struct uh_server *srv) while (conn) { struct uh_connection *next = conn->next; - conn->free(conn); + conn_free(conn); conn = next; }