From: msweet Date: Thu, 30 May 2013 00:48:16 +0000 (+0000) Subject: Restore debug2 logging of cupsdAdd/RemoveSelect. X-Git-Tag: release-1.7rc1~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1bc82dd928e052bacbf8bf0d879587ee1aa95e5b;p=thirdparty%2Fcups.git Restore debug2 logging of cupsdAdd/RemoveSelect. Add higher-level debug logging of client select management. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10999 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/scheduler/client.c b/scheduler/client.c index 55bff42369..dd5eddef31 100644 --- a/scheduler/client.c +++ b/scheduler/client.c @@ -471,6 +471,9 @@ cupsdAcceptClient(cupsd_listener_t *lis)/* I - Listener socket */ cupsdAddSelect(con->http.fd, (cupsd_selfunc_t)cupsdReadClient, NULL, con); + cupsdLogMessage(CUPSD_LOG_DEBUG, "[Client %d] Waiting for request.", + con->http.fd); + /* * Temporarily suspend accept()'s until we lose a client... */ @@ -594,6 +597,9 @@ cupsdCloseClient(cupsd_client_t *con) /* I - Client to close */ shutdown(con->http.fd, 0); cupsdAddSelect(con->http.fd, (cupsd_selfunc_t)cupsdReadClient, NULL, con); + + cupsdLogMessage(CUPSD_LOG_DEBUG, "[Client %d] Waiting for socket close.", + con->http.fd); } else { @@ -2431,6 +2437,9 @@ cupsdSendCommand( cupsdAddSelect(con->file, (cupsd_selfunc_t)write_pipe, NULL, con); + cupsdLogMessage(CUPSD_LOG_DEBUG, "[Client %d] Waiting for CGI data.", + con->http.fd); + con->sent_header = 0; con->file_ready = 0; con->got_fields = 0; @@ -2859,6 +2868,9 @@ cupsdWriteClient(cupsd_client_t *con) /* I - Client connection */ cupsdAddSelect(con->file, (cupsd_selfunc_t)write_pipe, NULL, con); + cupsdLogMessage(CUPSD_LOG_DEBUG, "[Client %d] Waiting for CGI data.", + con->http.fd); + if (!con->file_ready) { /* @@ -3087,6 +3099,9 @@ cupsdWriteClient(cupsd_client_t *con) /* I - Client connection */ cupsdAddSelect(con->http.fd, (cupsd_selfunc_t)cupsdReadClient, NULL, con); + cupsdLogMessage(CUPSD_LOG_DEBUG, "[Client %d] Waiting for request.", + con->http.fd); + if (con->file >= 0) { cupsdRemoveSelect(con->file); @@ -4335,6 +4350,8 @@ write_file(cupsd_client_t *con, /* I - Client connection */ cupsdAddSelect(con->http.fd, (cupsd_selfunc_t)cupsdReadClient, (cupsd_selfunc_t)cupsdWriteClient, con); + cupsdLogMessage(CUPSD_LOG_DEBUG, "[Client %d] Sending file.", con->http.fd); + return (1); } @@ -4354,6 +4371,9 @@ write_pipe(cupsd_client_t *con) /* I - Client connection */ cupsdRemoveSelect(con->file); cupsdAddSelect(con->http.fd, NULL, (cupsd_selfunc_t)cupsdWriteClient, con); + + cupsdLogMessage(CUPSD_LOG_DEBUG, "[Client %d] CGI data ready to be sent.", + con->http.fd); } diff --git a/scheduler/select.c b/scheduler/select.c index a44ec2e3f9..44fa20b4c3 100644 --- a/scheduler/select.c +++ b/scheduler/select.c @@ -268,7 +268,7 @@ cupsdAddSelect(int fd, /* I - File descriptor */ * Range check input... */ - cupsdLogMessage(CUPSD_LOG_DEBUG, + cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdAddSelect(fd=%d, read_cb=%p, write_cb=%p, data=%p)", fd, read_cb, write_cb, data); @@ -723,7 +723,7 @@ cupsdRemoveSelect(int fd) /* I - File descriptor */ * Range check input... */ - cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdRemoveSelect(fd=%d)", fd); + cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdRemoveSelect(fd=%d)", fd); if (fd < 0) return;