]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The scheduler could get caught in a busy loop (STR #4605)
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 6 May 2015 18:01:04 +0000 (18:01 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 6 May 2015 18:01:04 +0000 (18:01 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12613 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES-2.0.txt
scheduler/client.c

index 93e4070ddf6721bb7cbce88386c5a4b6d36057fd..3fa315d885efcf48d68d279fcd3ce215e177caef 100644 (file)
@@ -17,6 +17,7 @@ CHANGES IN CUPS V2.0.3
        - The rastertopwg filter did not check for truncated input (STR #4597)
        - The cups-lpd mini-daemon did not check for request parameters
          (STR #4603)
+       - The scheduler could get caught in a busy loop (STR #4605)
        - Added Russian translation (STR #4577)
 
 
index c5a99608814548b9947e77bd6dcfc412660f71f2..50464a524a3372bc6705f5c82c402e3efab43179 100644 (file)
@@ -585,6 +585,17 @@ cupsdReadClient(cupsd_client_t *con)       /* I - Client to read from */
     * connection and we need to shut it down...
     */
 
+    if (!httpGetReady(con->http) && recv(httpGetFd(con->http), buf, 1, MSG_PEEK) < 1)
+    {
+     /*
+      * Connection closed...
+      */
+
+      cupsdLogClient(con, CUPSD_LOG_DEBUG, "Closing on EOF.");
+      cupsdCloseClient(con);
+      return;
+    }
+
     cupsdLogClient(con, CUPSD_LOG_DEBUG, "Closing on unexpected HTTP read state %s.",
                   httpStateString(httpGetState(con->http)));
     cupsdCloseClient(con);
@@ -1979,12 +1990,6 @@ cupsdReadClient(cupsd_client_t *con)     /* I - Client to read from */
 
        if (httpGetState(con->http) == HTTP_STATE_POST_SEND)
        {
-        /*
-         * Don't listen for activity until we decide to do something with this...
-         */
-
-          cupsdAddSelect(httpGetFd(con->http), NULL, NULL, con);
-
          if (con->file >= 0)
          {
            fstat(con->file, &filestats);