You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 10, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 10, 2026. It is now read-only.
I found this while looking for a cure for bug #3325. I get my stuff working without the following fix, but it might be worth considering for inclusion anyway.
The code in cupsDoIORequest in the send/response loop
which determines whether an HTTP error has occurred specifically inores the status code HTTP_ERROR.
HTTP_ERROR is returned, among other things, whenever the server returns bad data, e.g. HTML code where HTTP headers are expected.
As the loop ignores HTTP_ERROR, this may cause an infinite loop or at least bad behavior.
Side note: HTTP_ERROR is not caught by the expression
status >= HTTP_BAD_REQUEST because the value of HTTP_ERROR is set to -1, which causes the compiler to generate signed comparisons.
IPP utilities for the Common UNIX Printing System (CUPS).
* Copyright 2007-2009 by Apple Inc.
* Copyright 2007-2010 by Apple Inc.
Copyright 1997-2007 by Easy Software Products.
These coded instructions, statements, and computer programs are the
@@ -263,14 +263,15 @@
response = cupsGetResponse(http, resource);
status = http->status;
}
Activity
michaelrsweet commentedon Mar 3, 2010
CUPS.org User: mike
I've updated your patch to do the httpFlush on any error, which should also fix STR #3325. See attached.
michaelrsweet commentedon Mar 4, 2010
CUPS.org User: bernerus
OK. I retrofitted your patch into my code and it seems to work.
michaelrsweet commentedon Mar 30, 2010
CUPS.org User: mike
Fixed in Subversion repository.
michaelrsweet commentedon Mar 30, 2010
"str3519.patch":
Index: cups/request.c
--- cups/request.c (revision 9016)
+++ cups/request.c (working copy)
@@ -3,7 +3,7 @@
*
These coded instructions, statements, and computer programs are the
@@ -263,14 +263,15 @@
response = cupsGetResponse(http, resource);
status = http->status;
}
else
DEBUG_printf(("2cupsDoIORequest: status=%d", status));
if (status >= HTTP_BAD_REQUEST &&
status != HTTP_UNAUTHORIZED &&
status != HTTP_UPGRADE_REQUIRED)
if (status == HTTP_ERROR ||
status != HTTP_UPGRADE_REQUIRED))
{
_cupsSetHTTPError(status);
break;
}