cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdAcceptClient(lis=%p) %d Clients = %d",
+ "cupsdAcceptClient(lis=%p(%d)) Clients=%d",
lis, lis->fd, cupsArrayCount(Clients));
/*
* Can't have an unresolved IP address with double-lookups enabled...
*/
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdAcceptClient: Closing connection %d...",
- con->http.fd);
-
#ifdef WIN32
closesocket(con->http.fd);
#else
* with double-lookups enabled...
*/
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdAcceptClient: Closing connection %d...",
- con->http.fd);
-
#ifdef WIN32
closesocket(con->http.fd);
#else
if (!hosts_access(&wrap_req))
{
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdAcceptClient: Closing connection %d...",
- con->http.fd);
-
#ifdef WIN32
closesocket(con->http.fd);
#else
cupsArrayAdd(Clients, con);
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdAcceptClient: %d connected to server on %s:%d",
- con->http.fd, con->servername, con->serverport);
-
/*
- * Using TCP_NODELAY improves responsiveness, especially on systems
- * with a slow loopback interface... Since we write large buffers
- * when sending print files and requests, there shouldn't be any
- * performance penalty for this...
+ * Using TCP_NODELAY improves responsiveness, especially on systems with a slow
+ * loopback interface. Since we write large buffers when sending print files
+ * and requests there shouldn't be any performance penalty for this...
*/
val = 1;
fcntl(con->http.fd, F_SETFD, fcntl(con->http.fd, F_GETFD) | FD_CLOEXEC);
/*
- * Add the socket to the select() input mask.
+ * Add the socket to the server select.
*/
cupsdAddSelect(con->http.fd, (cupsd_selfunc_t)cupsdReadClient, NULL, con);
cupsd_client_t *con; /* Current client */
+ cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdCloseAllClients() Clients=%d",
+ cupsArrayCount(Clients));
+
for (con = (cupsd_client_t *)cupsArrayFirst(Clients);
con;
con = (cupsd_client_t *)cupsArrayNext(Clients))
#endif /* HAVE_LIBSSL */
- cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdCloseClient: %d", con->http.fd);
+ cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdCloseClient(con=%p(%d))", con,
+ con->http.fd);
/*
* Flush pending writes before closing...
* Stop any CGI process...
*/
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdCloseClient: %d Killing process ID %d...",
- con->http.fd, con->pipe_pid);
cupsdEndProcess(con->pipe_pid, 1);
con->pipe_pid = 0;
}
{
cupsdRemoveSelect(con->file);
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdCloseClient: %d Closing data file %d.",
- con->http.fd, con->file);
-
close(con->file);
con->file = -1;
}
status = HTTP_CONTINUE;
cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdReadClient: %d, used=%d, file=%d state=%d",
- con->http.fd, con->http.used, con->file, con->http.state);
+ "cupsdReadClient(con=%p(%d)) "
+ "con->http.error=%d "
+ "con->http.used=%d, "
+ "con->http.state=%d "
+ "con->data_encoding=HTTP_ENCODE_%s, "
+ "con->data_remaining=" CUPS_LLFMT ", "
+ "con->file=%d",
+ con, con->http.fd, con->http.error, con->http.used,
+ con->http.state,
+ con->http.data_encoding == HTTP_ENCODE_CHUNKED ?
+ "CHUNKED" : "LENGTH",
+ CUPS_LLCAST con->http.data_remaining, con->file);
if (con->http.error)
{
- cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdReadClient: http error seen...");
cupsdCloseClient(con);
return;
}
*/
cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdReadClient: Saw first byte %02X, auto-negotiating SSL/TLS session...",
- buf[0] & 255);
+ "cupsdReadClient: Saw first byte %02X, auto-negotiating "
+ "SSL/TLS session...", buf[0] & 255);
if (!encrypt_client(con))
cupsdCloseClient(con);
if (httpGets(line, sizeof(line) - 1, HTTP(con)) == NULL)
{
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdReadClient: httpGets returned EOF...");
cupsdCloseClient(con);
return;
}
snprintf(locale, sizeof(locale), "%s.%s",
con->http.fields[HTTP_FIELD_ACCEPT_LANGUAGE], DefaultCharset);
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdReadClient: %d Browser asked for language \"%s\"...",
- con->http.fd, locale);
-
con->language = cupsLangGet(locale);
}
else
if ((status = cupsdIsAuthorized(con, NULL)) != HTTP_OK)
{
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdReadClient: Unauthorized request for %s...",
- con->uri);
cupsdSendError(con, status, CUPSD_AUTH_NONE);
cupsdCloseClient(con);
return;
* so check the length against any limits that are set...
*/
- cupsdLogMessage(CUPSD_LOG_DEBUG2, "POST %s", con->uri);
- cupsdLogMessage(CUPSD_LOG_DEBUG2, "CONTENT_TYPE = %s",
- con->http.fields[HTTP_FIELD_CONTENT_TYPE]);
-
if (con->http.fields[HTTP_FIELD_CONTENT_LENGTH][0] &&
MaxRequestSize > 0 &&
con->http.data_remaining > MaxRequestSize)
cupsdSetString(&con->options, NULL);
}
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdReadClient: %d command=\"%s\", "
- "options = \"%s\"",
- con->http.fd, con->command,
- con->options ? con->options : "(null)");
-
if (con->http.version <= HTTP_1_0)
con->http.keep_alive = HTTP_KEEPALIVE_OFF;
}
* so check the length against any limits that are set...
*/
- cupsdLogMessage(CUPSD_LOG_DEBUG2, "PUT %s", con->uri);
- cupsdLogMessage(CUPSD_LOG_DEBUG2, "CONTENT_TYPE = %s",
- con->http.fields[HTTP_FIELD_CONTENT_TYPE]);
-
if (con->http.fields[HTTP_FIELD_CONTENT_LENGTH][0] &&
MaxRequestSize > 0 &&
con->http.data_remaining > MaxRequestSize)
}
}
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdReadClient: %d REQUEST %s=%d", con->http.fd,
- con->filename, con->file);
-
fchmod(con->file, 0640);
fchown(con->file, RunUser, Group);
fcntl(con->file, F_SETFD, fcntl(con->file, F_GETFD) | FD_CLOEXEC);
switch (con->http.state)
{
case HTTP_PUT_RECV :
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdReadClient: %d con->data_encoding=HTTP_ENCODE_%s, "
- "con->data_remaining=" CUPS_LLFMT ", con->file=%d",
- con->http.fd,
- con->http.data_encoding == HTTP_ENCODE_CHUNKED ?
- "CHUNKED" : "LENGTH",
- CUPS_LLCAST con->http.data_remaining, con->file);
-
do
{
if ((bytes = httpRead2(HTTP(con), line, sizeof(line))) < 0)
{
con->bytes += bytes;
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdReadClient: %d writing %d bytes to %d",
- con->http.fd, bytes, con->file);
-
if (write(con->file, line, bytes) < bytes)
{
cupsdLogMessage(CUPSD_LOG_ERROR,
"cupsdReadClient: Unable to write %d bytes to %s: %s",
bytes, con->filename, strerror(errno));
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdReadClient: Closing data file %d...",
- con->file);
-
close(con->file);
con->file = -1;
unlink(con->filename);
fstat(con->file, &filestats);
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdReadClient: %d Closing data file %d, size="
- CUPS_LLFMT ".",
- con->http.fd, con->file,
- CUPS_LLCAST filestats.st_size);
-
close(con->file);
con->file = -1;
* Request is too big; remove it and send an error...
*/
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdReadClient: %d Removing temp file %s",
- con->http.fd, con->filename);
unlink(con->filename);
cupsdClearString(&con->filename);
break;
case HTTP_POST_RECV :
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdReadClient: %d con->data_encoding=HTTP_ENCODE_"
- "%s, con->data_remaining=" CUPS_LLFMT ", con->file=%d",
- con->http.fd,
- con->http.data_encoding == HTTP_ENCODE_CHUNKED ?
- "CHUNKED" : "LENGTH",
- CUPS_LLCAST con->http.data_remaining, con->file);
-
do
{
if (con->request)
}
}
- cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdReadClient: %d REQUEST %s=%d", con->http.fd,
- con->filename, con->file);
-
fchmod(con->file, 0640);
fchown(con->file, RunUser, Group);
fcntl(con->file, F_SETFD, fcntl(con->file, F_GETFD) | FD_CLOEXEC);
{
con->bytes += bytes;
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdReadClient: %d writing %d bytes to %d",
- con->http.fd, bytes, con->file);
-
if (write(con->file, line, bytes) < bytes)
{
cupsdLogMessage(CUPSD_LOG_ERROR,
"cupsdReadClient: Unable to write %d bytes to %s: %s",
bytes, con->filename, strerror(errno));
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdReadClient: Closing file %d...",
- con->file);
-
close(con->file);
con->file = -1;
unlink(con->filename);
{
fstat(con->file, &filestats);
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdReadClient: %d Closing data file %d, "
- "size=" CUPS_LLFMT ".",
- con->http.fd, con->file,
- CUPS_LLCAST filestats.st_size);
-
close(con->file);
con->file = -1;
* Request is too big; remove it and send an error...
*/
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdReadClient: %d Removing temp file %s",
- con->http.fd, con->filename);
unlink(con->filename);
cupsdClearString(&con->filename);
if (con->filename)
{
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdReadClient: %d Removing temp file %s",
- con->http.fd, con->filename);
unlink(con->filename);
cupsdClearString(&con->filename);
}
http_status_t code, /* I - Error code */
int auth_type)/* I - Authentication type */
{
+ cupsdLogMessage(CUPSD_LOG_DEBUG2,
+ "cupsdSendError(con=%p(%d), code=%d, auth_type=%d", con,
+ con->http.fd, code, auth_type);
+
#ifdef HAVE_SSL
/*
* Force client to upgrade for authentication if that is how the
strcasecmp(con->http.hostname, "localhost") &&
!con->http.tls)
{
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdSendError: Encryption before authentication!");
code = HTTP_UPGRADE_REQUIRED;
}
#endif /* HAVE_SSL */
cupsdLogRequest(con, code);
- cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdSendError: %d code=%d (%s)",
- con->http.fd, code, httpStatus(code));
-
/*
* To work around bugs in some proxies, don't use Keep-Alive for some
* error messages...
ipp_state_t ipp_state; /* IPP state value */
-#ifdef DEBUG
cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdWriteClient(con=%p) %d response=%p(%d), file=%d "
+ "cupsdWriteClient(con=%p(%d)) response=%p(%d), file=%d "
"pipe_pid=%d state=%d",
con, con->http.fd, con->response,
con->response ? con->response->state : -1,
con->file, con->pipe_pid, con->http.state);
-#endif /* DEBUG */
if (con->http.state != HTTP_GET_SEND &&
con->http.state != HTTP_POST_SEND)
}
else if ((bytes = read(con->file, buf, sizeof(buf) - 1)) > 0)
{
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdWriteClient: Read %d bytes from file %d...",
- bytes, con->file);
-
if (con->pipe_pid && !con->got_fields)
{
/*
if (strncasecmp(buf, "Status:", 7))
httpPrintf(HTTP(con), "%s\r\n", buf);
- cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdWriteClient: %d %s",
- con->http.fd, buf);
-
/*
* Update buffer...
*/
con->field_col ++;
}
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdWriteClient: %d bytes=%d, got_fields=%d",
- con->http.fd, bytes, con->got_fields);
-
if (bytes > 0 && !con->got_fields)
{
/*
{
if (httpWrite2(HTTP(con), buf, bytes) < 0)
{
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdWriteClient: %d Write of %d bytes failed!",
- con->http.fd, bytes);
-
cupsdCloseClient(con);
return;
}
if (bytes <= 0)
{
- cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdWriteClient: %d bytes < 0",
- con->http.fd);
-
cupsdLogRequest(con, HTTP_OK);
httpFlushWrite(HTTP(con));
if (con->pipe_pid)
cupsdEndProcess(con->pipe_pid, 0);
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdWriteClient: %d Closing data file %d.",
- con->http.fd, con->file);
-
close(con->file);
con->file = -1;
con->pipe_pid = 0;
if (con->filename)
{
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdWriteClient: %d Removing temp file %s",
- con->http.fd, con->filename);
unlink(con->filename);
cupsdClearString(&con->filename);
}
return (1);
cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "check_if_modified: %d If-Modified-Since=\"%s\"",
- con->http.fd, ptr);
+ "check_if_modified(con=%p(%d), "
+ "filestats=%p(" CUPS_LLFMT ", %d)) If-Modified-Since=\"%s\"",
+ con, con->http.fd, filestats, CUPS_LLCAST filestats->st_size,
+ (int)filestats->st_mtime, ptr);
while (*ptr != '\0')
{
ptr ++;
}
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "check_if_modified: %d sizes=" CUPS_LLFMT ","
- CUPS_LLFMT " dates=%d,%d",
- con->http.fd, CUPS_LLCAST size,
- CUPS_LLCAST filestats->st_size, (int)date,
- (int)filestats->st_mtime);
-
return ((size != filestats->st_size && size != 0) ||
(date < filestats->st_mtime && date != 0) ||
(size == 0 && date == 0));
unsigned long error; /* Error code */
+ cupsdLogMessage(CUPSD_LOG_DEBUG2, "encrypt_client(con=%p(%d))", con,
+ con->http.fd);
+
/*
* Verify that we have a certificate...
*/
if (SSL_accept(conn) != 1)
{
- cupsdLogMessage(CUPSD_LOG_ERROR,
- "encrypt_client: Unable to encrypt connection from %s!",
+ cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to encrypt connection from %s!",
con->http.hostname);
while ((error = ERR_get_error()) != 0)
- cupsdLogMessage(CUPSD_LOG_ERROR, "encrypt_client: %s",
- ERR_error_string(error, NULL));
+ cupsdLogMessage(CUPSD_LOG_ERROR, "%s", ERR_error_string(error, NULL));
SSL_CTX_free(context);
SSL_free(conn);
return (0);
}
- cupsdLogMessage(CUPSD_LOG_DEBUG,
- "encrypt_client: %d Connection from %s now encrypted.",
- con->http.fd, con->http.hostname);
+ cupsdLogMessage(CUPSD_LOG_DEBUG, "Connection from %s now encrypted.",
+ con->http.hostname);
con->http.tls = conn;
return (1);
/* TLS credentials */
+ cupsdLogMessage(CUPSD_LOG_DEBUG2, "encrypt_client(con=%p(%d))", con,
+ con->http.fd);
+
/*
* Verify that we have a certificate...
*/
if (credentials == NULL)
{
cupsdLogMessage(CUPSD_LOG_ERROR,
- "encrypt_client: Unable to encrypt connection from %s!",
- con->http.hostname);
- cupsdLogMessage(CUPSD_LOG_ERROR, "encrypt_client: %s", strerror(errno));
+ "Unable to encrypt connection from %s - %s",
+ con->http.hostname, strerror(errno));
free(conn);
return (0);
if (error != GNUTLS_E_SUCCESS)
{
cupsdLogMessage(CUPSD_LOG_ERROR,
- "encrypt_client: Unable to encrypt connection from %s!",
- con->http.hostname);
- cupsdLogMessage(CUPSD_LOG_ERROR, "encrypt_client: %s",
- gnutls_strerror(error));
+ "Unable to encrypt connection from %s - %s",
+ con->http.hostname, gnutls_strerror(error));
gnutls_deinit(conn->session);
gnutls_certificate_free_credentials(*credentials);
return (0);
}
- cupsdLogMessage(CUPSD_LOG_DEBUG,
- "encrypt_client: %d Connection from %s now encrypted.",
- con->http.fd, con->http.hostname);
+ cupsdLogMessage(CUPSD_LOG_DEBUG, "Connection from %s now encrypted.",
+ con->http.hostname);
conn->credentials = credentials;
con->http.tls = conn;
http_tls_t *conn; /* CDSA connection information */
+ cupsdLogMessage(CUPSD_LOG_DEBUG2, "encrypt_client(con=%p(%d))", con,
+ con->http.fd);
+
if ((conn = (http_tls_t *)malloc(sizeof(http_tls_t))) == NULL)
return (0);
if (!conn->certsArray)
{
cupsdLogMessage(CUPSD_LOG_ERROR,
- "encrypt_client: Could not find signing key in keychain "
- "\"%s\"", ServerCertificate);
+ "Could not find signing key in keychain \"%s\"",
+ ServerCertificate);
error = errSSLBadCert; /* errSSLBadConfiguration is a better choice, but not available on 10.2.x */
}
if (error)
{
cupsdLogMessage(CUPSD_LOG_ERROR,
- "encrypt_client: Unable to encrypt connection from %s!",
- con->http.hostname);
-
- cupsdLogMessage(CUPSD_LOG_ERROR, "encrypt_client: %s (%d)",
- cssmErrorString(error), (int)error);
+ "Unable to encrypt connection from %s - %s (%d)",
+ con->http.hostname, cssmErrorString(error), (int)error);
con->http.error = error;
con->http.status = HTTP_ERROR;
return (0);
}
- cupsdLogMessage(CUPSD_LOG_DEBUG,
- "encrypt_client: %d Connection from %s now encrypted.",
- con->http.fd, con->http.hostname);
+ cupsdLogMessage(CUPSD_LOG_DEBUG, "Connection from %s now encrypted.",
+ con->http.hostname);
con->http.tls = conn;
return (1);
if ((err = SecKeychainOpen(ServerCertificate, &keychain)))
{
- cupsdLogMessage(CUPSD_LOG_ERROR, "Cannot open keychain \"%s\", %s",
- ServerCertificate, cssmErrorString(err));
+ cupsdLogMessage(CUPSD_LOG_ERROR, "Cannot open keychain \"%s\" - %s (%d)",
+ ServerCertificate, cssmErrorString(err), (int)err);
return (NULL);
}
if (SecPolicySearchCopyNext(policy_search, &policy))
{
- cupsdLogMessage(CUPSD_LOG_ERROR,
+ cupsdLogMessage(CUPSD_LOG_ERROR,
"Cannot find a policy to use for searching");
CFRelease(keychain);
CFRelease(policy_search);
if (SecPolicySetValue(policy, &options))
{
- cupsdLogMessage(CUPSD_LOG_ERROR,
+ cupsdLogMessage(CUPSD_LOG_ERROR,
"Cannot set policy value to use for searching");
CFRelease(keychain);
CFRelease(policy_search);
if (err)
cupsdLogMessage(CUPSD_LOG_DEBUG,
- "Cannot create keychain search reference: %s",
- cssmErrorString(err));
+ "Cannot create keychain search reference: %s (%d)",
+ cssmErrorString(err), (int)err);
else
{
if ((err = SecIdentitySearchCopyNext(search, &identity)))
{
cupsdLogMessage(CUPSD_LOG_DEBUG,
- "Cannot find signing key in keychain \"%s\", error %d",
- ServerCertificate, (int)err);
+ "Cannot find signing key in keychain \"%s\": %s (%d)",
+ ServerCertificate, cssmErrorString(err), (int)err);
}
else
{
while (status && language[0]);
}
- cupsdLogMessage(CUPSD_LOG_DEBUG2, "get_file: %d filename=%s size=%d",
- con->http.fd, filename,
- status ? -1 : (int)filestats->st_size);
+ cupsdLogMessage(CUPSD_LOG_DEBUG2,
+ "get_file(con=%p(%d), filestats=%p, filename=%p, len=%d) = "
+ "%s", con, con->http.fd, filestats, filename, len,
+ status ? "(null)" : filename);
if (!status)
con->http.data_remaining = (int)filestats->st_size;
const char *options; /* Options on URL */
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "is_cgi(con=%p, filename=\"%s\", filestats=%p, type=%s/%s)",
- con, filename, filestats, type ? type->super : "unknown",
- type ? type->type : "unknown");
-
/*
* Get the options, if any...
*/
if (!type || strcasecmp(type->super, "application"))
{
- cupsdLogMessage(CUPSD_LOG_DEBUG2, "is_cgi: Returning 0...");
+ cupsdLogMessage(CUPSD_LOG_DEBUG2,
+ "is_cgi(con=%p(%d), filename=\"%s\", filestats=%p, "
+ "type=%s/%s) = 0", con, con->http.fd, filename, filestats,
+ type ? type->super : "unknown",
+ type ? type->type : "unknown");
return (0);
}
cupsdSetStringf(&con->options, " %s", options);
cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "is_cgi: Returning 1 with command=\"%s\" and options=\"%s\"",
- con->command, con->options);
-
+ "is_cgi(con=%p(%d), filename=\"%s\", filestats=%p, "
+ "type=%s/%s) = 1", con, con->http.fd, filename, filestats,
+ type ? type->super : "unknown",
+ type ? type->type : "unknown");
return (1);
}
#ifdef HAVE_JAVA
cupsdSetStringf(&con->options, " %s", filename);
cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "is_cgi: Returning 1 with command=\"%s\" and options=\"%s\"",
- con->command, con->options);
-
+ "is_cgi(con=%p(%d), filename=\"%s\", filestats=%p, "
+ "type=%s/%s) = 1", con, con->http.fd, filename, filestats,
+ type ? type->super : "unknown",
+ type ? type->type : "unknown");
return (1);
}
#endif /* HAVE_JAVA */
cupsdSetStringf(&con->options, " %s", filename);
cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "is_cgi: Returning 1 with command=\"%s\" and options=\"%s\"",
- con->command, con->options);
-
+ "is_cgi(con=%p(%d), filename=\"%s\", filestats=%p, "
+ "type=%s/%s) = 1", con, con->http.fd, filename, filestats,
+ type ? type->super : "unknown",
+ type ? type->type : "unknown");
return (1);
}
#endif /* HAVE_PERL */
cupsdSetStringf(&con->options, " %s", filename);
cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "is_cgi: Returning 1 with command=\"%s\" and options=\"%s\"",
- con->command, con->options);
-
+ "is_cgi(con=%p(%d), filename=\"%s\", filestats=%p, "
+ "type=%s/%s) = 1", con, con->http.fd, filename, filestats,
+ type ? type->super : "unknown",
+ type ? type->type : "unknown");
return (1);
}
#endif /* HAVE_PHP */
cupsdSetStringf(&con->options, " %s", filename);
cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "is_cgi: Returning 1 with command=\"%s\" and options=\"%s\"",
- con->command, con->options);
-
+ "is_cgi(con=%p(%d), filename=\"%s\", filestats=%p, "
+ "type=%s/%s) = 1", con, con->http.fd, filename, filestats,
+ type ? type->super : "unknown",
+ type ? type->type : "unknown");
return (1);
}
#endif /* HAVE_PYTHON */
- cupsdLogMessage(CUPSD_LOG_DEBUG2, "is_cgi: Returning 0...");
-
+ cupsdLogMessage(CUPSD_LOG_DEBUG2,
+ "is_cgi(con=%p(%d), filename=\"%s\", filestats=%p, "
+ "type=%s/%s) = 0", con, con->http.fd, filename, filestats,
+ type ? type->super : "unknown",
+ type ? type->type : "unknown");
return (0);
}
envp[envc++] = home;
envp[envc] = NULL;
- if (!cupsdStartProcess(command, argv, envp, -1, -1, -1, -1, -1, 1, NULL,
+ if (!cupsdStartProcess(command, argv, envp, -1, -1, -1, -1, -1, 1, NULL, 0,
&pid))
{
unlink(seedfile);
break;
}
- cupsdFinishProcess(pid, command, sizeof(command));
+ cupsdFinishProcess(pid, command, sizeof(command), NULL);
/*
* Remove the seed file, as it is no longer needed...
infofd = open(infofile, O_RDONLY);
if (!cupsdStartProcess(command, argv, envp, infofd, -1, -1, -1, -1, 1, NULL,
- &pid))
+ 0, &pid))
{
close(infofd);
unlink(infofile);
break;
}
- cupsdFinishProcess(pid, command, sizeof(command));
+ cupsdFinishProcess(pid, command, sizeof(command), NULL);
if (status)
{
infofd = open(infofile, O_RDONLY);
if (!cupsdStartProcess(command, argv, envp, infofd, -1, -1, -1, -1, 1, NULL,
- &pid))
+ 0, &pid))
{
close(infofd);
unlink(infofile);
break;
}
- cupsdFinishProcess(pid, command, sizeof(command));
+ cupsdFinishProcess(pid, command, sizeof(command), NULL);
if (status)
{
*/
cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "pipe_command: command=\"%s\", options=\"%s\"",
- command, options ? options : "(null)");
+ "pipe_command(con=%p(%d), infile=%d, outfile=%p, "
+ "command=\"%s\", options=\"%s\", root=%d)",
+ con, con->http.fd, infile, outfile, command,
+ options ? options : "(null)", root);
argv[0] = command;
{
KerberosContext = NULL;
- cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to initialize Kerberos context");
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Unable to initialize Kerberos context");
}
}
principal)))
{
cupsdLogMessage(CUPSD_LOG_ERROR,
- "Unable to initialize credentials cache (%d/%s)", error,
- strerror(errno));
+ "Unable to initialize credentials cache (%d/%s)",
+ error, strerror(errno));
krb5_cc_destroy(KerberosContext, ccache);
krb5_free_principal(KerberosContext, principal);
ccache = NULL;
*/
if (cupsdStartProcess(command, argv, envp, infile, fds[1], CGIPipes[1],
- -1, -1, root, DefaultProfile, &pid) < 0)
+ -1, -1, root, DefaultProfile, 0, &pid) < 0)
{
/*
* Error - can't fork!
{
con->file = open(filename, O_RDONLY);
- cupsdLogMessage(CUPSD_LOG_DEBUG2, "write_file: %d file=%d", con->http.fd,
- con->file);
+ cupsdLogMessage(CUPSD_LOG_DEBUG2,
+ "write_file(con=%p(%d), code=%d, filename=\"%s\" (%d), "
+ "type=\"%s\", filestats=%p)", con, con->http.fd,
+ code, filename, con->file, type ? type : "(null)", filestats);
if (con->file < 0)
return (0);
static void
write_pipe(cupsd_client_t *con) /* I - Client connection */
{
- cupsdLogMessage(CUPSD_LOG_DEBUG2, "write_pipe: CGI output on fd %d...",
- con->file);
+ cupsdLogMessage(CUPSD_LOG_DEBUG2,
+ "write_pipe(con=%p(%d)) CGI output on fd %d",
+ con, con->http.fd, con->file);
con->file_ready = 1;