From: msweet Date: Thu, 3 Jul 2014 19:15:31 +0000 (+0000) Subject: Make sure we send a 0-length chunk for CGI output, even for things like "Status". X-Git-Tag: v2.2b1~577 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f3211b6d64b6af0abfbd448934204b5c3cb32eb9;p=thirdparty%2Fcups.git Make sure we send a 0-length chunk for CGI output, even for things like "Status". git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11999 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/scheduler/client.c b/scheduler/client.c index 73617eb709..d7491cbbde 100644 --- a/scheduler/client.c +++ b/scheduler/client.c @@ -2292,6 +2292,8 @@ cupsdSendHeader( char auth_str[1024]; /* Authorization string */ + cupsdLogClient(con, CUPSD_LOG_DEBUG, "cupsdSendHeader: code=%d, type=\"%s\", auth_type=%d", code, type, auth_type); + /* * Send the HTTP status header... */ @@ -2662,6 +2664,8 @@ cupsdWriteClient(cupsd_client_t *con) /* I - Client connection */ !httpGetField(con->http, HTTP_FIELD_CONTENT_LENGTH)[0]) httpSetLength(con->http, 0); + cupsdLogClient(con, CUPSD_LOG_DEBUG, "Sending status %d for CGI.", con->pipe_status); + if (!cupsdSendHeader(con, con->pipe_status, NULL, CUPSD_AUTH_NONE)) { cupsdCloseClient(con); @@ -2713,7 +2717,7 @@ cupsdWriteClient(cupsd_client_t *con) /* I - Client connection */ { cupsdLogRequest(con, HTTP_STATUS_OK); - if (httpIsChunked(con->http) && (!con->pipe_pid || con->sent_header == 1)) + if (httpIsChunked(con->http) && (!con->pipe_pid || con->sent_header > 0)) { cupsdLogClient(con, CUPSD_LOG_DEBUG, "Sending 0-length chunk.");