diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2001-10-25 16:58:50 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2001-10-25 16:58:50 +0000 |
commit | d3b099140fa2d221479c67b2be921abac8481798 (patch) | |
tree | ae396afaf4229aaa06e94bf028e5eafc35b9e599 /src/reqs.c | |
parent | f8ad0dced37cb3b2b4402d12ac654bc27beaa8e4 (diff) |
Some code clean up due to the creation of the conns.{c,h} files which now
store the creation/destruction and definition of the connection structure.
Diffstat (limited to 'src/reqs.c')
-rw-r--r-- | src/reqs.c | 35 |
1 files changed, 2 insertions, 33 deletions
@@ -1,4 +1,4 @@ -/* $Id: reqs.c,v 1.34 2001-10-25 05:12:46 rjkaes Exp $ +/* $Id: reqs.c,v 1.35 2001-10-25 16:58:50 rjkaes Exp $ * * This is where all the work in tinyproxy is actually done. Incoming * connections have a new thread created for them. The thread then @@ -28,6 +28,7 @@ #include "acl.h" #include "anonymous.h" #include "buffer.h" +#include "conns.h" #include "filter.h" #include "log.h" #include "regexp.h" @@ -688,38 +689,6 @@ static void relay_connection(struct conn_s *connptr) return; } -static void initialize_conn(struct conn_s *connptr) -{ - connptr->client_fd = connptr->server_fd = -1; - connptr->cbuffer = new_buffer(); - connptr->sbuffer = new_buffer(); - - connptr->send_message = FALSE; - connptr->simple_req = FALSE; - - connptr->ssl = FALSE; - connptr->upstream = FALSE; - - update_stats(STAT_OPEN); -} - -static void destroy_conn(struct conn_s *connptr) -{ - if (connptr->client_fd != -1) - close(connptr->client_fd); - if (connptr->server_fd != -1) - close(connptr->server_fd); - - if (connptr->cbuffer) - delete_buffer(connptr->cbuffer); - if (connptr->sbuffer) - delete_buffer(connptr->sbuffer); - - safefree(connptr); - - update_stats(STAT_CLOSE); -} - #ifdef UPSTREAM_SUPPORT /* * Establish a connection to the upstream proxy server. |