summaryrefslogtreecommitdiff
path: root/cups/cups-busy-loop.patch
blob: 8c95546abbf753a91b07b6935297d4f049afbf1a (plain)
    1 diff -up cups-2.0.2/scheduler/client.c.busy-loop cups-2.0.2/scheduler/client.c
    2 --- cups-2.0.2/scheduler/client.c.busy-loop	2014-08-28 16:37:22.000000000 +0100
    3 +++ cups-2.0.2/scheduler/client.c	2015-03-16 17:24:32.506232983 +0000
    4 @@ -585,6 +585,17 @@ cupsdReadClient(cupsd_client_t *con)	/*
    5      * connection and we need to shut it down...
    6      */
    7  
    8 +    if (!httpGetReady(con->http) && recv(httpGetFd(con->http), buf, 1, MSG_PEEK) < 1)
    9 +    {
   10 +     /*
   11 +      * Connection closed...
   12 +      */
   13 +
   14 +      cupsdLogClient(con, CUPSD_LOG_DEBUG, "Closing on EOF.");
   15 +      cupsdCloseClient(con);
   16 +      return;
   17 +    }
   18 +
   19      cupsdLogClient(con, CUPSD_LOG_DEBUG, "Closing on unexpected HTTP read state %s.",
   20  		   httpStateString(httpGetState(con->http)));
   21      cupsdCloseClient(con);
   22 @@ -1979,12 +1990,6 @@ cupsdReadClient(cupsd_client_t *con)	/*
   23  
   24  	if (httpGetState(con->http) == HTTP_STATE_POST_SEND)
   25  	{
   26 -	 /*
   27 -	  * Don't listen for activity until we decide to do something with this...
   28 -	  */
   29 -
   30 -          cupsdAddSelect(httpGetFd(con->http), NULL, NULL, con);
   31 -
   32  	  if (con->file >= 0)
   33  	  {
   34  	    fstat(con->file, &filestats);

Generated by cgit