Skip to content

Commit

Permalink
uh_connection: remove api: free
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
  • Loading branch information
zhaojh329 committed Sep 8, 2020
1 parent 15c2b53 commit b77d83c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion src/uhttpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down

0 comments on commit b77d83c

Please sign in to comment.