From: Tatsuo Ishii Date: Sat, 19 Jun 2010 01:56:11 +0000 (+0000) Subject: Remove unnecessary variable. X-Git-Tag: V3_0_0_BETA1~154 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=2f29899c8f9f6d610e8dd9759963455b438d7660;p=pgpool2.git Remove unnecessary variable. Tweak comments. --- diff --git a/child.c b/child.c index 6ecdc1a1e..ae065f313 100644 --- a/child.c +++ b/child.c @@ -100,7 +100,7 @@ void do_child(int unix_fd, int inet_fd) struct timezone tz; int child_idle_sec; struct timeval timeout; - static int connected; + static int connected; /* non 0 if has been accepted connections from frontend */ int connections_count = 0; /* used if child_max_connections > 0 */ int found; char psbuf[NI_MAXHOST + 128]; @@ -155,7 +155,6 @@ void do_child(int unix_fd, int inet_fd) for (;;) { - int connection_reuse = 1; StartupPacket *sp; idle = 1; @@ -252,7 +251,10 @@ void do_child(int unix_fd, int inet_fd) } /* - * Ok, negotiaton with frontend has been done. Let's go to the next step. + * Ok, negotiaton with frontend has been done. Let's go to the + * next step. Connect to backend if there's no existing + * connection which can be reused by this frontend. + * Authentication is also done in this step. */ /* @@ -294,8 +296,6 @@ void do_child(int unix_fd, int inet_fd) if (backend == NULL) { /* create a new connection to backend */ - connection_reuse = 0; - if ((backend = connect_backend(sp, frontend)) == NULL) { connection_count_down(); @@ -377,11 +377,6 @@ void do_child(int unix_fd, int inet_fd) /* error occured. discard backend connection pool and disconnect connection to the frontend */ case POOL_ERROR: -#ifdef NOT_USED - pool_discard_cp(sp->user, sp->database); - pool_close(frontend); - notice_backend_error(); -#endif pool_log("do_child: exits with status 1 due to error"); child_exit(1); break;