@@ -175,10 +175,11 @@ int client_create(client_t **c_ptr, connection_t *con, http_parser_t *parser)
175175
176176 listener_real = listensocket_get_listener (con -> listensocket_real );
177177 listener_effective = listensocket_get_listener (con -> listensocket_effective );
178- ICECAST_LOG_DEBUG ("Client %p created on connection %p (connection ID: %llu, socket real: %p \"%H\" , socket effective: %p \"%H\" )" ,
179- client , con , (long long unsigned int )con -> id ,
178+ ICECAST_LOG_DEBUG ("Client %p created on connection %p (connection ID: %llu, sock=%R, socket real: %p (%#H) , socket effective: %p (%#H); global: %d of %d )" ,
179+ client , con , (long long unsigned int )con -> id , con -> sock ,
180180 con -> listensocket_real , con -> listensocket_real ? listener_real -> id : NULL ,
181- con -> listensocket_effective , con -> listensocket_effective ? listener_effective -> id : NULL
181+ con -> listensocket_effective , con -> listensocket_effective ? listener_effective -> id : NULL ,
182+ global .clients , config -> client_limit
182183 );
183184 listensocket_release_listener (con -> listensocket_effective );
184185 listensocket_release_listener (con -> listensocket_real );
@@ -260,8 +261,9 @@ static inline void client_reuseconnection(client_t *client) {
260261 return ;
261262 }
262263
264+ ICECAST_LOG_DEBUG ("Reusing connection %p (connection ID: %llu, sock=%R) of old client %p" , con , (long long unsigned int )con -> id , con -> sock , client );
263265 con = connection_create (con -> sock , con -> listensocket_real , con -> listensocket_effective , strdup (con -> ip ));
264- client -> con -> sock = -1 ; /* TODO: do not use magic */
266+ client -> con -> sock = SOCK_ERROR ;
265267
266268 /* handle to keep the TLS connection */
267269 if (client -> con -> tls ) {
@@ -294,9 +296,12 @@ static inline void client_reuseconnection(client_t *client) {
294296
295297void client_destroy (client_t * client )
296298{
297- ICECAST_LOG_DEBUG ( "Called to destory client %p" , client );
298- if ( client == NULL )
299+ if ( client == NULL ) {
300+ ICECAST_LOG_ERROR ( "Called with client= NULL. This is a BUG." );
299301 return ;
302+ }
303+
304+ ICECAST_LOG_DEBUG ("Called to destory client %p on connection %p (connection ID: %llu, sock=%R)" , client , client -> con , (long long unsigned int )client -> con -> id , client -> con -> sock );
300305
301306 fastevent_emit (FASTEVENT_TYPE_CLIENT_DESTROY , FASTEVENT_FLAG_MODIFICATION_ALLOWED , FASTEVENT_DATATYPE_CLIENT , client );
302307
0 commit comments