/*
- * "$Id$"
+ * "$Id: listen.c 6123 2006-11-21 15:36:04Z mike $"
*
* Server listening routines for the Common UNIX Printing System (CUPS)
* scheduler.
for (lis = (cupsd_listener_t *)cupsArrayFirst(Listeners);
lis;
lis = (cupsd_listener_t *)cupsArrayNext(Listeners))
- if (lis->fd >= 0)
- {
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdPauseListening: Removing fd %d from InputSet...",
- lis->fd);
-
- FD_CLR(lis->fd, InputSet);
- }
+ cupsdRemoveSelect(lis->fd);
}
for (lis = (cupsd_listener_t *)cupsArrayFirst(Listeners);
lis;
lis = (cupsd_listener_t *)cupsArrayNext(Listeners))
- if (lis->fd >= 0)
- {
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "cupsdResumeListening: Adding fd %d to InputSet...",
- lis->fd);
- FD_SET(lis->fd, InputSet);
- }
+ cupsdAddSelect(lis->fd, (cupsd_selfunc_t)cupsdAcceptClient, NULL, lis);
}
* "any" address...
*/
- if (!LocalPort && p > 0 &&
+ if ((!LocalPort || LocalEncryption == HTTP_ENCRYPT_ALWAYS) && p > 0 &&
(httpAddrLocalhost(&(lis->address)) ||
httpAddrAny(&(lis->address))))
{
if (!LocalPort && !have_domain)
{
cupsdLogMessage(CUPSD_LOG_EMERG,
- "No Listen or Port lines were found to allow access via localhost!");
+ "No Listen or Port lines were found to allow access via "
+ "localhost!");
/*
* Commit suicide...
*/
cupsdSetEnv("CUPS_SERVER", have_domain);
+
+ LocalEncryption = HTTP_ENCRYPT_IF_REQUESTED;
}
else
{
}
cupsdSetEnv("CUPS_ENCRYPTION", encryptions[LocalEncryption]);
- cupsdSetEnvf("IPP_PORT", "%d", LocalPort);
+
+ if (LocalPort)
+ cupsdSetEnvf("IPP_PORT", "%d", LocalPort);
/*
* Resume listening for connections...
/*
- * End of "$Id$".
+ * End of "$Id: listen.c 6123 2006-11-21 15:36:04Z mike $".
*/