- Fix encryption support (new httpSetEncryption function returns true on success)
- Demote many developer messages to debug2 log level.
- Adopt cupsdLogPrinter in a few places.
- Normalize a few other messages.
/*
* Client routines for the CUPS scheduler.
*
- * Copyright © 2020-2024 by OpenPrinting.
+ * Copyright © 2020-2025 by OpenPrinting.
* Copyright © 2007-2021 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
char auth_str[1024]; /* Authorization string */
- cupsdLogClient(con, CUPSD_LOG_DEBUG, "cupsdSendHeader: code=%d, type=\"%s\", auth_type=%d", code, type, auth_type);
+ cupsdLogClient(con, CUPSD_LOG_DEBUG2, "cupsdSendHeader: code=%d, type=\"%s\", auth_type=%d", code, type, auth_type);
/*
* Send the HTTP status header...
ipp_state_t ipp_state; /* IPP state value */
- cupsdLogClient(con, CUPSD_LOG_DEBUG, "con->http=%p", (void *)con->http);
- cupsdLogClient(con, CUPSD_LOG_DEBUG,
+ cupsdLogClient(con, CUPSD_LOG_DEBUG2, "con->http=%p", (void *)con->http);
+ cupsdLogClient(con, CUPSD_LOG_DEBUG2,
"cupsdWriteClient "
"error=%d, "
"used=%d, "
}
while (ipp_state != IPP_STATE_DATA && ipp_state != IPP_STATE_ERROR);
- cupsdLogClient(con, CUPSD_LOG_DEBUG,
+ cupsdLogClient(con, CUPSD_LOG_DEBUG2,
"Writing IPP response, ipp_state=%s, old "
"wused=" CUPS_LLFMT ", new wused=" CUPS_LLFMT,
ippStateString(ipp_state),
bytes = ipp_state != IPP_STATE_ERROR &&
(con->file >= 0 || ipp_state != IPP_STATE_DATA);
- cupsdLogClient(con, CUPSD_LOG_DEBUG,
+ cupsdLogClient(con, CUPSD_LOG_DEBUG2,
"bytes=%d, http_state=%d, data_remaining=" CUPS_LLFMT,
(int)bytes, httpGetState(con->http),
CUPS_LLCAST httpGetLength2(con->http));
}
}
- cupsdLogClient(con, CUPSD_LOG_DEBUG, "Flushing write buffer.");
+ cupsdLogClient(con, CUPSD_LOG_DEBUG2, "Flushing write buffer.");
httpFlushWrite(con->http);
- cupsdLogClient(con, CUPSD_LOG_DEBUG, "New state is %s", httpStateString(httpGetState(con->http)));
+ cupsdLogClient(con, CUPSD_LOG_DEBUG2, "New state is %s", httpStateString(httpGetState(con->http)));
}
cupsdAddSelect(httpGetFd(con->http), (cupsd_selfunc_t)cupsdReadClient, NULL, con);
cupsd_start_tls(cupsd_client_t *con, /* I - Client connection */
http_encryption_t e) /* I - Encryption mode */
{
- if (httpSetEncryption(con->http, e))
+ if (!httpSetEncryption(con->http, e))
{
cupsdLogClient(con, CUPSD_LOG_ERROR, "Unable to encrypt connection: %s",
cupsGetErrorString());
*/
if (uri)
- cupsdLogMessage(CUPSD_LOG_DEBUG, "%s %s", ippOpString(con->request->request.op.operation_id), uri->values[0].string.text);
+ cupsdLogClient(con, CUPSD_LOG_DEBUG, "%s %s", ippOpString(con->request->request.op.operation_id), uri->values[0].string.text);
else
- cupsdLogMessage(CUPSD_LOG_DEBUG, "%s", ippOpString(con->request->request.op.operation_id));
+ cupsdLogClient(con, CUPSD_LOG_DEBUG, "%s", ippOpString(con->request->request.op.operation_id));
switch (con->request->request.op.operation_id)
{
length += (size_t)fileinfo.st_size;
}
- cupsdLogClient(con, CUPSD_LOG_DEBUG, "Content-Length: " CUPS_LLFMT, CUPS_LLCAST length);
+ cupsdLogClient(con, CUPSD_LOG_DEBUG2, "Content-Length: " CUPS_LLFMT, CUPS_LLCAST length);
httpSetLength(con->http, length);
}
//
// Select abstraction functions for the CUPS scheduler.
//
-// Copyright © 2020-2024 by OpenPrinting.
+// Copyright © 2020-2025 by OpenPrinting.
// Copyright © 2007-2016 by Apple Inc.
// Copyright © 2006-2007 by Easy Software Products.
//
else
nfds = poll(cupsd_pollfds, (nfds_t)count, -1);
- cupsdLogMessage(CUPSD_LOG_DEBUG, "poll(nfds=%d, timeout=%ld) returned %d", count, timeout < 86400 ? timeout * 1000 : -1, nfds);
+ cupsdLogMessage(CUPSD_LOG_DEBUG2, "poll(nfds=%d, timeout=%ld) returned %d", count, timeout < 86400 ? timeout * 1000 : -1, nfds);
if (nfds > 0)
{
if ((fdptr = find_fd(pfd->fd)) == NULL)
{
- cupsdLogMessage(CUPSD_LOG_DEBUG, "cups_pollfds[%d] not found", pfd->fd);
+ cupsdLogMessage(CUPSD_LOG_DEBUG2, "cups_pollfds[%d] not found", pfd->fd);
continue;
}
- cupsdLogMessage(CUPSD_LOG_DEBUG, "cups_pollfds[%d].revents=%d", pfd->fd, pfd->revents);
+ cupsdLogMessage(CUPSD_LOG_DEBUG2, "cups_pollfds[%d].revents=%d", pfd->fd, pfd->revents);
retain_fd(fdptr);
* information.
*/
-/*
- * Include necessary headers...
- */
-
#include "cupsd.h"
#ifdef HAVE_DBUS
# include <dbus/dbus.h>
ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_TEXT,
"notify-text", NULL, ftext);
+ if (job)
+ cupsdLogJob(job, CUPSD_LOG_DEBUG, "%s: %s", cupsdEventName(event), ftext);
+ else
+ cupsdLogPrinter(dest, CUPSD_LOG_DEBUG, "%s: %s", cupsdEventName(event), ftext);
+
if (dest)
{
/*
cupsd_subscription_t *temp; /* New subscription object */
- cupsdLogMessage(CUPSD_LOG_DEBUG,
+ cupsdLogMessage(CUPSD_LOG_DEBUG2,
"cupsdAddSubscription(mask=%x, dest=%p(%s), job=%p(%d), "
"uri=\"%s\")",
mask, (void *)dest, dest ? dest->name : "", (void *)job, job ? job->id : 0,
/*
* System management functions for the CUPS scheduler.
*
- * Copyright © 2020-2024 by OpenPrinting.
+ * Copyright © 2020-2025 by OpenPrinting.
* Copyright @ 2007-2018 by Apple Inc.
* Copyright @ 2006 by Easy Software Products.
*
* information.
*/
-
-/*
- * Include necessary headers...
- */
-
#include "cupsd.h"
#ifdef __APPLE__
# include <IOKit/pwr_mgt/IOPMLib.h>
void
cupsdMarkDirty(int what) /* I - What file(s) are dirty? */
{
- cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdMarkDirty(%c%c%c%c%c)",
+ cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdMarkDirty(%c%c%c%c%c)",
(what & CUPSD_DIRTY_PRINTERS) ? 'P' : '-',
(what & CUPSD_DIRTY_CLASSES) ? 'C' : '-',
(what & CUPSD_DIRTY_PRINTCAP) ? 'p' : '-',
if (job)
newbusy |= 2;
- cupsdLogMessage(CUPSD_LOG_DEBUG,
+ cupsdLogMessage(CUPSD_LOG_DEBUG2,
"cupsdSetBusyState: newbusy=\"%s\", busy=\"%s\"",
busy_text[newbusy], busy_text[busy]);
}
else if (cupsArrayCount(PrintingJobs) == 0 && keep_awake)
{
- cupsdLogMessage(CUPSD_LOG_DEBUG, "Releasing power assertion.");
+ cupsdLogMessage(CUPSD_LOG_DEBUG, "Releasing NetworkClientActive.");
IOPMAssertionRelease(keep_awake);
keep_awake = 0;
}