X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fsysdep.c;h=c547f9772be4cff4c5fee27c84291bfb8d93817a;hb=27014176ee36ef29b80da016f3fd5772189f8377;hp=8f0a124669c0ebca9dca77e2a080c3456f0879aa;hpb=3b8d1155415cd1b45dbd3303ffc68a6c00e6b28a;p=citadel.git diff --git a/citadel/sysdep.c b/citadel/sysdep.c index 8f0a12466..c547f9772 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -4,7 +4,7 @@ * Here's where we (hopefully) have most parts of the Citadel server that * might need tweaking when run on different operating system variants. * - * Copyright (c) 1987-2017 by the citadel.org team + * Copyright (c) 1987-2019 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 3. @@ -86,14 +86,14 @@ void init_sysdep(void) { init_ssl(); #endif - /* - * Set up a place to put thread-specific data. - * We only need a single pointer per thread - it points to the - * CitContext structure (in the ContextList linked list) of the - * session to which the calling thread is currently bound. - */ - if (pthread_key_create(&MyConKey, NULL) != 0) { + if (pthread_key_create(&ThreadKey, NULL) != 0) { // TSD for threads + syslog(LOG_ERR, "pthread_key_create() : %m"); + abort(); + } + + if (pthread_key_create(&MyConKey, NULL) != 0) { // TSD for sessions syslog(LOG_CRIT, "sysdep: can't create TSD key: %m"); + abort(); } /* @@ -1109,12 +1109,12 @@ void HuntBadSession(void) { /* Gotcha! */ syslog(LOG_ERR, - "sysdep: killing session CC[%d] bad FD: [%d:%d] User[%s] Host[%s:%s]", - ptr->cs_pid, - ptr->client_socket, - ptr->is_local_socket, - ptr->curr_user, - ptr->cs_host,ptr->cs_addr + "sysdep: killing session CC[%d] bad FD: [%d] User[%s] Host[%s:%s]", + ptr->cs_pid, + ptr->client_socket, + ptr->curr_user, + ptr->cs_host, + ptr->cs_addr ); ptr->kill_me = 1; ptr->client_socket = -1; @@ -1292,9 +1292,9 @@ do_select: force_purge = 0; con->h_greeting_function = serviceptr->h_greeting_function; con->ServiceName = serviceptr->ServiceName; - /* Determine whether it's a local socket */ + /* Connections on a local client are always from the same host */ if (serviceptr->sockpath != NULL) { - con->is_local_socket = 1; + con->is_local_client = 1; } /* Set the SO_REUSEADDR socket option */