--- cups/http.c.orig 2012-10-01 11:51:02.000000000 +0200 +++ cups/http.c 2012-10-01 11:58:07.000000000 +0200 @@ -2250,6 +2250,19 @@ int /* O - 0 on success, non-zero on failure */ httpReconnect(http_t *http) /* I - Connection to server */ { + return httpReconnectWithWait(http, 0); +} + + +/* + * 'httpReconnect()' - Reconnect to a HTTP server. + */ + +int /* O - 0 on success, non-zero on failure */ +httpReconnectWithWait( + http_t *http, /* I - Connection to server */ + unsigned int seconds) /* I - Number of seconds to wait between reconnect */ +{ http_addrlist_t *addr; /* Connected address */ #ifdef DEBUG http_addrlist_t *current; /* Current address */ @@ -2305,6 +2318,12 @@ http->wused = 0; /* + * Wait... + */ + if (seconds > 0) + sleep(seconds); + + /* * Connect to the server... */ --- cups/http.h.orig 2012-10-01 12:02:42.000000000 +0200 +++ cups/http.h 2012-10-01 12:03:07.000000000 +0200 @@ -364,6 +364,7 @@ extern int httpPut(http_t *http, const char *uri); extern int httpRead(http_t *http, char *buffer, int length) _CUPS_DEPRECATED; extern int httpReconnect(http_t *http); +extern int httpReconnectWithWait(http_t *http, unsigned int seconds); extern void httpSeparate(const char *uri, char *method, char *username, char *host, int *port, char *resource) _CUPS_DEPRECATED; --- backend/ipp.c.orig 2012-10-01 11:59:32.000000000 +0200 +++ backend/ipp.c 2012-10-01 12:00:14.000000000 +0200 @@ -1705,7 +1705,6 @@ * Do the request... */ - httpReconnect(http); response = cupsDoRequest(http, request, resource); ipp_status = cupsLastError(); @@ -1799,7 +1798,7 @@ * Wait before polling again... */ - sleep(delay); + httpReconnectWithWait(http, delay); delay = _cupsNextDelay(delay, &prev_delay); }