/*
- * "$Id: listen.c 6123 2006-11-21 15:36:04Z mike $"
+ * "$Id: listen.c 6788 2007-08-13 17:20:14Z mike $"
*
* Server listening routines for the Common UNIX Printing System (CUPS)
* scheduler.
*
+ * Copyright 2007 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
- * property of Easy Software Products and are protected by Federal
- * copyright law. Distribution and use rights are outlined in the file
- * "LICENSE.txt" which should have been included with this file. If this
- * file is missing or damaged please contact Easy Software Products
- * at:
- *
- * Attn: CUPS Licensing Information
- * Easy Software Products
- * 44141 Airport View Drive, Suite 204
- * Hollywood, Maryland 20636 USA
- *
- * Voice: (301) 373-9600
- * EMail: cups-info@cups.org
- * WWW: http://www.cups.org
+ * property of Apple Inc. and are protected by Federal copyright
+ * law. Distribution and use rights are outlined in the file "LICENSE.txt"
+ * which should have been included with this file. If this file is
+ * file is missing or damaged, see the license at "http://www.cups.org/".
*
* Contents:
*
if (cupsArrayCount(Clients) == MaxClients)
cupsdLogMessage(CUPSD_LOG_WARN,
"Max clients reached, holding new connections...");
+ else if (errno == ENFILE || errno == EMFILE)
+ cupsdLogMessage(CUPSD_LOG_WARN,
+ "Too many open files, holding new connections for "
+ "30 seconds...");
cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdPauseListening: Clearing input bits...");
lis;
lis = (cupsd_listener_t *)cupsArrayNext(Listeners))
cupsdRemoveSelect(lis->fd);
+
+ ListeningPaused = time(NULL) + 30;
}
if (cupsArrayCount(Listeners) < 1)
return;
- if (cupsArrayCount(Clients) >= (MaxClients - 1))
- cupsdLogMessage(CUPSD_LOG_WARN, "Resuming new connection processing...");
-
+ cupsdLogMessage(CUPSD_LOG_INFO, "Resuming new connection processing...");
cupsdLogMessage(CUPSD_LOG_DEBUG2,
"cupsdResumeListening: Setting input bits...");
lis;
lis = (cupsd_listener_t *)cupsArrayNext(Listeners))
cupsdAddSelect(lis->fd, (cupsd_selfunc_t)cupsdAcceptClient, NULL, lis);
+
+ ListeningPaused = 0;
}
/*
- * End of "$Id: listen.c 6123 2006-11-21 15:36:04Z mike $".
+ * End of "$Id: listen.c 6788 2007-08-13 17:20:14Z mike $".
*/