@@ -242,7 +242,7 @@ int connection_open_listener(struct scache_bind ibind) {
242242 return -1 ;
243243}
244244
245- static scache_connection* connection_add (int fd, scache_connection_node* ctable ) {
245+ static scache_connection* connection_add (int fd) {
246246 scache_connection_node* node = &ctable[CONNECTION_HASH_KEY (fd)];
247247 if (node->connection .client_sock != -1 ) {
248248 while (node->next != NULL ) {
@@ -263,7 +263,7 @@ static scache_connection* connection_add(int fd, scache_connection_node* ctable)
263263 return &(node->connection );
264264}
265265
266- static scache_connection* connection_get (int fd, scache_connection_node* ctable ) {
266+ static scache_connection* connection_get (int fd) {
267267 scache_connection_node* node = &ctable[CONNECTION_HASH_KEY (fd)];
268268 if (node->connection .client_sock == -1 ) {
269269 return NULL ;
@@ -281,7 +281,7 @@ static scache_connection* connection_get(int fd, scache_connection_node* ctable)
281281 return &(node->connection );
282282}
283283
284- static bool connection_remove (int fd, scache_connection_node* ctable ) {
284+ bool connection_remove (int fd) {
285285 scache_connection_node* temp = NULL ;
286286 scache_connection_node* node = &ctable[CONNECTION_HASH_KEY (fd)];
287287 if (node->connection .client_sock == -1 ) {
@@ -321,7 +321,7 @@ static bool connection_remove(int fd, scache_connection_node* ctable) {
321321 return true ;
322322}
323323
324- static unsigned int connection_count (scache_connection_node* ctable ) {
324+ static unsigned int connection_count () {
325325 unsigned count = 0 ;
326326 for (unsigned int i = 0 ; i < CONNECTION_HASH_ENTRIES; i++) {
327327 scache_connection_node* target = &ctable[i];
@@ -337,7 +337,7 @@ static unsigned int connection_count(scache_connection_node* ctable) {
337337 return count;
338338}
339339
340- static unsigned int connection_any (scache_connection_node* ctable ) {\
340+ static unsigned int connection_any () {\
341341 for (unsigned int i = 0 ; i < CONNECTION_HASH_ENTRIES; i++) {
342342 scache_connection_node* target = &ctable[i];
343343 if (target->connection .client_sock != -1 ) return true ;
@@ -547,7 +547,7 @@ void connection_event_loop(void (*connection_handler)(scache_connection* connect
547547
548548 // Handle connection
549549 DEBUG (" [#%d] A new %s socket was accepted %d\n " , fd, listener_type_string (client_type), client_sock);
550- scache_connection* connection = connection_add (client_sock, ctable );
550+ scache_connection* connection = connection_add (client_sock);
551551 assert (connection->client_sock == client_sock);
552552 connection->ltype = client_type;
553553 connection_handler (connection);
@@ -569,7 +569,7 @@ void connection_event_loop(void (*connection_handler)(scache_connection* connect
569569 if (fd != efd)
570570 {
571571 DEBUG (" [#%d] Got socket event %d (in=%d, out=%d, hup=%d)\n " , fd, events[n].events , events[n].events & EPOLLIN ? 1 : 0 , events[n].events & EPOLLOUT ? 1 : 0 , events[n].events & EPOLLHUP ? 1 : 0 );
572- scache_connection* connection = connection_get (fd, ctable );
572+ scache_connection* connection = connection_get (fd);
573573 if (connection != NULL ) {
574574 assert (connection->client_sock == fd);
575575 bool do_close = events[n].events & (EPOLLERR | EPOLLHUP | EPOLLRDHUP);
@@ -589,10 +589,10 @@ void connection_event_loop(void (*connection_handler)(scache_connection* connect
589589 DEBUG (" [#%d] Closing connection due to err:%d hup:%d rdhup:%d\n " , fd, !! (events[n].events &EPOLLERR), !! (events[n].events &EPOLLHUP), !! (events[n].events &EPOLLRDHUP));
590590 http_cleanup (connection);
591591 assert (fd != 0 || (settings.daemon_mode && fd >= 0 ));
592- if (connection_remove (fd, ctable )){
593- assert (connection_get (fd, ctable ) == NULL );
592+ if (connection_remove (fd)){
593+ assert (connection_get (fd) == NULL );
594594 #ifdef DEBUG_BUILD
595- if (!connection_any (ctable )) {
595+ if (!connection_any ()) {
596596 db_check_table_refs ();
597597 }
598598 #endif
0 commit comments