diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-12-31 19:29:44 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-12-31 19:29:44 +0100 |
commit | 38801a320d3f10de1f8ebfffd8964a1ad6d511f4 (patch) | |
tree | 22fa0a21e55677b57f477e001c549fd3b506adf4 /client.c | |
parent | 1fc5ad7f4fa30abc636680acd5e170198dfb6c32 (diff) |
move dispatch cbs and data to one place
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -60,10 +60,8 @@ static void uh_connection_close(struct client *cl) static void uh_dispatch_done(struct client *cl) { - if (cl->dispatch_free) - cl->dispatch_free(cl); - cl->dispatch_free = NULL; - cl->dispatch_close_fds = NULL; + if (cl->dispatch.free) + cl->dispatch.free(cl); } void uh_request_done(struct client *cl) @@ -71,7 +69,7 @@ void uh_request_done(struct client *cl) uh_chunk_eof(cl); uh_dispatch_done(cl); cl->us->notify_write = NULL; - memset(&cl->data, 0, sizeof(cl->data)); + memset(&cl->dispatch, 0, sizeof(cl->dispatch)); if (cl->request.version != UH_HTTP_VER_1_1 || !conf.http_keepalive) { uh_connection_close(cl); @@ -281,8 +279,8 @@ static void client_ustream_write_cb(struct ustream *s, int bytes) { struct client *cl = container_of(s, struct client, sfd); - if (cl->dispatch_write_cb) - cl->dispatch_write_cb(cl); + if (cl->dispatch.write_cb) + cl->dispatch.write_cb(cl); } static void client_notify_state(struct ustream *s) @@ -339,7 +337,7 @@ void uh_close_fds(void) uh_close_listen_fds(); list_for_each_entry(cl, &clients, list) { close(cl->sfd.fd.fd); - if (cl->dispatch_close_fds) - cl->dispatch_close_fds(cl); + if (cl->dispatch.close_fds) + cl->dispatch.close_fds(cl); } } |