From: msweet Date: Thu, 8 May 2014 23:01:48 +0000 (+0000) Subject: Mirror fix from trunk. X-Git-Tag: release-2.1.4~16^2~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf5fce9867f84f4dde33a9aef5a66b182ac9c5c9;p=thirdparty%2Fcups.git Mirror fix from trunk. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.7@11862 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/CHANGES.txt b/CHANGES.txt index afe3a78cfe..8aa5370665 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,10 +1,14 @@ -CHANGES.txt - 1.7.3 - 2014-04-24 +CHANGES.txt - 1.7.3 - 2014-05-08 -------------------------------- CHANGES IN CUPS V1.7.3 - Fixed mapping of OutputBin values such as "Tray1" () + - Several ippGet* functions incorrectly returned -1 instead of 0 on + error. + - The cupsGetResponse function did not work properly with + CUPS_HTTP_DEFAULT () CHANGES IN CUPS V1.7.2 diff --git a/cups/request.c b/cups/request.c index 0152620564..df96b81e25 100644 --- a/cups/request.c +++ b/cups/request.c @@ -350,17 +350,31 @@ cupsGetResponse(http_t *http, /* I - Connection to server or @code CUPS_HTTP DEBUG_printf(("cupsGetResponse(http=%p, resource=\"%s\")", http, resource)); + DEBUG_printf(("1cupsGetResponse: http->state=%d", http ? http->state : HTTP_STATE_ERROR)); /* * Connect to the default server as needed... */ if (!http) - http = _cupsConnect(); + { + _cups_globals_t *cg = _cupsGlobals(); + /* Pointer to library globals */ - if (!http || (http->state != HTTP_STATE_POST_RECV && - http->state != HTTP_STATE_POST_SEND)) + if ((http = cg->http) == NULL) + { + _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("No active connection."), 1); + DEBUG_puts("1cupsGetResponse: No active connection - returning NULL."); + return (NULL); + } + } + + if (http->state != HTTP_STATE_POST_RECV && http->state != HTTP_STATE_POST_SEND) + { + _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("No request sent."), 1); + DEBUG_puts("1cupsGetResponse: Not in POST state - returning NULL."); return (NULL); + } /* * Check for an unfinished chunked request...