Skip to content

Commit

Permalink
Sync up with latest libcups changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Jul 25, 2023
1 parent 5524778 commit ccc36eb
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 68 deletions.
2 changes: 1 addition & 1 deletion libcups
Submodule libcups updated 96 files
+2 −0 CHANGES.md
+68 −51 MIGRATING.md
+19 −8 SECURITY.md
+0 −1 config.h.in
+0 −6 configure
+0 −2 configure.ac
+5 −3 cups/Dependencies
+165 −279 cups/auth.c
+82 −123 cups/base.h
+149 −162 cups/cups-private.h
+11 −17 cups/cups.h
+69 −52 cups/cupspm.md
+46 −49 cups/debug-internal.h
+32 −32 cups/debug-private.h
+0 −5 cups/debug.c
+169 −224 cups/dest-job.c
+91 −105 cups/dest-localization.c
+641 −1,003 cups/dest-options.c
+1,045 −1,507 cups/dest.c
+121 −217 cups/dir.c
+25 −25 cups/dir.h
+20 −22 cups/dnssd.c
+171 −233 cups/encode.c
+24 −24 cups/file-private.h
+517 −885 cups/file.c
+28 −28 cups/file.h
+30 −40 cups/fuzzipp.c
+113 −202 cups/getputfile.c
+53 −84 cups/globals.c
+0 −5 cups/hash.c
+9 −10 cups/http-addr.c
+175 −266 cups/http-addrlist.c
+117 −110 cups/http-private.h
+36 −47 cups/http-support.c
+771 −1,268 cups/http.c
+5 −23 cups/http.h
+13 −14 cups/ipp-file.c
+2 −3 cups/ipp-support.c
+1,333 −1,721 cups/ipp.c
+3 −3 cups/ipp.h
+14 −14 cups/json.c
+3 −3 cups/jwt.c
+9 −9 cups/langprintf.c
+3 −3 cups/language.c
+13 −18 cups/libcups3.def
+55 −78 cups/notify.c
+151 −225 cups/options.c
+121 −126 cups/pwg-media.c
+2 −7 cups/raster-error.c
+38 −42 cups/raster-stream.c
+17 −51 cups/rasterbench.c
+311 −492 cups/request.c
+50 −54 cups/string-private.h
+5 −11 cups/string.c
+0 −1 cups/tempfile.c
+96 −133 cups/testarray.c
+181 −283 cups/testclient.c
+35 −35 cups/testcreds.c
+4 −4 cups/testcups.c
+127 −134 cups/testdest.c
+117 −248 cups/testfile.c
+3 −7 cups/testform.c
+2 −2 cups/testgetdests.c
+3 −3 cups/testhash.c
+118 −201 cups/testhttp.c
+63 −97 cups/testi18n.c
+243 −293 cups/testipp.c
+9 −9 cups/testjson.c
+3 −3 cups/testjwt.c
+92 −111 cups/testlang.c
+25 −32 cups/testoptions.c
+0 −4 cups/testpwg.c
+53 −63 cups/testraster.c
+1 −1 cups/testtestpage.c
+54 −70 cups/testthreads.c
+0 −4 cups/thread.c
+684 −610 cups/tls-gnutls.c
+472 −389 cups/tls-openssl.c
+17 −213 cups/tls.c
+5 −5 cups/tlscheck.c
+406 −581 cups/usersys.c
+158 −189 cups/util.c
+ doc/cupspm.epub
+528 −302 doc/cupspm.html
+14 −2 tools/dither.h
+20 −25 tools/ippevecommon.h
+121 −195 tools/ippevepcl.c
+1,421 −1,997 tools/ippeveprinter.c
+182 −258 tools/ippeveps.c
+381 −588 tools/ippfind.c
+799 −1,153 tools/ipptool.c
+4 −2 tools/printer-lg-png.h
+4 −2 tools/printer-png.h
+4 −2 tools/printer-sm-png.h
+0 −1 vcnet/config.h
+0 −1 xcode/config.h
16 changes: 8 additions & 8 deletions server/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ serverCreateClient(int sock) /* I - Listen socket */

if ((client->http = httpAcceptConnection(sock, 1)) == NULL)
{
serverLogClient(SERVER_LOGLEVEL_ERROR, client, "Unable to accept client connection: %s", cupsLastErrorString());
serverLogClient(SERVER_LOGLEVEL_ERROR, client, "Unable to accept client connection: %s", cupsGetErrorString());

free(client);

Expand Down Expand Up @@ -95,7 +95,7 @@ serverCreateListeners(const char *host, /* I - Hostname, IP address, or NULL for
snprintf(service, sizeof(service), "%d", port);
if ((addrlist = httpAddrGetList(host, AF_UNSPEC, service)) == NULL)
{
serverLog(SERVER_LOGLEVEL_ERROR, "Unable to resolve Listen address \"%s\": %s", host ? host : "*", cupsLastErrorString());
serverLog(SERVER_LOGLEVEL_ERROR, "Unable to resolve Listen address \"%s\": %s", host ? host : "*", cupsGetErrorString());
return (0);
}

Expand Down Expand Up @@ -192,7 +192,7 @@ serverProcessClient(

if (!httpSetEncryption(client->http, HTTP_ENCRYPTION_ALWAYS))
{
serverLogClient(SERVER_LOGLEVEL_ERROR, client, "Unable to encrypt connection: %s", cupsLastErrorString());
serverLogClient(SERVER_LOGLEVEL_ERROR, client, "Unable to encrypt connection: %s", cupsGetErrorString());
break;
}

Expand Down Expand Up @@ -264,10 +264,10 @@ serverProcessHTTP(

if (http_state == HTTP_STATE_ERROR)
{
if (httpError(client->http) == EPIPE || httpError(client->http) == ETIMEDOUT || httpError(client->http) == 0)
if (httpGetError(client->http) == EPIPE || httpGetError(client->http) == ETIMEDOUT || httpGetError(client->http) == 0)
serverLogClient(SERVER_LOGLEVEL_INFO, client, "Client closed connection.");
else
serverLogClient(SERVER_LOGLEVEL_ERROR, client, "Bad request line (%s).", strerror(httpError(client->http)));
serverLogClient(SERVER_LOGLEVEL_ERROR, client, "Bad request line (%s).", strerror(httpGetError(client->http)));

return (0);
}
Expand Down Expand Up @@ -365,7 +365,7 @@ serverProcessHTTP(
if (!httpSetEncryption(client->http, HTTP_ENCRYPTION_REQUIRED))
{
serverLogClient(SERVER_LOGLEVEL_ERROR, client,
"Unable to encrypt connection: %s", cupsLastErrorString());
"Unable to encrypt connection: %s", cupsGetErrorString());
return (0);
}

Expand Down Expand Up @@ -651,7 +651,7 @@ serverProcessHTTP(
{
if (ipp_state == IPP_STATE_ERROR)
{
serverLogClient(SERVER_LOGLEVEL_ERROR, client, "IPP read error (%s).", cupsLastErrorString());
serverLogClient(SERVER_LOGLEVEL_ERROR, client, "IPP read error (%s).", cupsGetErrorString());
serverRespondHTTP(client, HTTP_STATUS_BAD_REQUEST, NULL, NULL, 0);
return (0);
}
Expand Down Expand Up @@ -764,7 +764,7 @@ serverRespondHTTP(
* Send an IPP response...
*/

serverLogClient(SERVER_LOGLEVEL_DEBUG, client, "serverRespondHTTP: Sending %d bytes of IPP response (Content-Length=%d)", (int)ippLength(client->response), (int)length);
serverLogClient(SERVER_LOGLEVEL_DEBUG, client, "serverRespondHTTP: Sending %d bytes of IPP response (Content-Length=%d)", (int)ippGetLength(client->response), (int)length);

ippSetState(client->response, IPP_STATE_IDLE);

Expand Down
2 changes: 1 addition & 1 deletion server/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2772,7 +2772,7 @@ load_system(const char *conf) /* I - Configuration file */

if (!status)
{
serverLog(SERVER_LOGLEVEL_ERROR, "Unable to listen on address \"%s\": %s", host, cupsLastErrorString());
serverLog(SERVER_LOGLEVEL_ERROR, "Unable to listen on address \"%s\": %s", host, cupsGetErrorString());
break;
}
}
Expand Down
12 changes: 6 additions & 6 deletions server/ipp.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ apply_template_attributes(

if (ippReadFile(fd, from) != IPP_STATE_DATA)
{
serverLog(SERVER_LOGLEVEL_ERROR, "Unable to read resource %d file \"%s\": %s", template->id, template->filename, cupsLastErrorString());
serverLog(SERVER_LOGLEVEL_ERROR, "Unable to read resource %d file \"%s\": %s", template->id, template->filename, cupsGetErrorString());
close(fd);
ippDelete(from);
return (false);
Expand Down Expand Up @@ -788,7 +788,7 @@ copy_document_uri(

if ((http = httpConnect(hostname, port, NULL, AF_UNSPEC, encryption, 1, 30000, NULL)) == NULL)
{
serverRespondIPP(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS, "Unable to connect to %s: %s", hostname, cupsLastErrorString());
serverRespondIPP(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS, "Unable to connect to %s: %s", hostname, cupsGetErrorString());
job->state = IPP_JSTATE_ABORTED;

return (0);
Expand Down Expand Up @@ -2607,7 +2607,7 @@ ipp_create_printer(

if (!apply_template_attributes(client->request, IPP_TAG_PRINTER, resource, supported, sizeof(printer_values) / sizeof(printer_values[0]), printer_values))
{
serverRespondIPP(client, IPP_STATUS_ERROR_INTERNAL, "Unable to apply template-printer resource #%d: %s", resource_id, cupsLastErrorString());
serverRespondIPP(client, IPP_STATUS_ERROR_INTERNAL, "Unable to apply template-printer resource #%d: %s", resource_id, cupsGetErrorString());
return;
}
}
Expand Down Expand Up @@ -3758,7 +3758,7 @@ ipp_fetch_document(
if (!httpWriteResponse(client->http, HTTP_STATUS_OK))
return;

serverLogClient(SERVER_LOGLEVEL_DEBUG, client, "ipp_fetch_document: Sending %d bytes of IPP response.", (int)ippLength(client->response));
serverLogClient(SERVER_LOGLEVEL_DEBUG, client, "ipp_fetch_document: Sending %d bytes of IPP response.", (int)ippGetLength(client->response));

ippSetState(client->response, IPP_STATE_IDLE);

Expand Down Expand Up @@ -9365,7 +9365,7 @@ serverProcessIPP(

serverLogAttributes(client, "Response:", client->response, 2);

return (serverRespondHTTP(client, HTTP_STATUS_OK, NULL, "application/ipp", client->fetch_file >= 0 ? 0 : ippLength(client->response)));
return (serverRespondHTTP(client, HTTP_STATUS_OK, NULL, "application/ipp", client->fetch_file >= 0 ? 0 : ippGetLength(client->response)));
}
else
return (1);
Expand Down Expand Up @@ -9681,7 +9681,7 @@ valid_job_attributes(
{
if (!apply_template_attributes(client->request, IPP_TAG_JOB, resource, supported, sizeof(job_values) / sizeof(job_values[0]), job_values))
{
serverRespondIPP(client, IPP_STATUS_ERROR_INTERNAL, "Unable to apply template-job resource #%d: %s", resource_id, cupsLastErrorString());
serverRespondIPP(client, IPP_STATUS_ERROR_INTERNAL, "Unable to apply template-job resource #%d: %s", resource_id, cupsGetErrorString());
cupsRWUnlock(&client->printer->rwlock);
return (false);
}
Expand Down
18 changes: 9 additions & 9 deletions tools/ipp3dprinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -2066,7 +2066,7 @@ finish_document_uri(

if ((http = httpConnect(hostname, port, NULL, AF_UNSPEC, encryption, 1, 30000, NULL)) == NULL)
{
respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS, "Unable to connect to %s: %s", hostname, cupsLastErrorString());
respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS, "Unable to connect to %s: %s", hostname, cupsGetErrorString());

close(job->fd);
job->fd = -1;
Expand Down Expand Up @@ -3543,7 +3543,7 @@ process_client(ipp3d_client_t *client) /* I - Client */

if (httpSetEncryption(client->http, HTTP_ENCRYPTION_ALWAYS))
{
fprintf(stderr, "%s Unable to encrypt connection: %s\n", client->hostname, cupsLastErrorString());
fprintf(stderr, "%s Unable to encrypt connection: %s\n", client->hostname, cupsGetErrorString());
break;
}

Expand Down Expand Up @@ -3610,10 +3610,10 @@ process_http(ipp3d_client_t *client) /* I - Client connection */

if (http_state == HTTP_STATE_ERROR)
{
if (httpError(client->http) == EPIPE)
if (httpGetError(client->http) == EPIPE)
fprintf(stderr, "%s Client closed connection.\n", client->hostname);
else
fprintf(stderr, "%s Bad request line (%s).\n", client->hostname, strerror(httpError(client->http)));
fprintf(stderr, "%s Bad request line (%s).\n", client->hostname, strerror(httpGetError(client->http)));

return (0);
}
Expand Down Expand Up @@ -3696,7 +3696,7 @@ process_http(ipp3d_client_t *client) /* I - Client connection */

if (httpSetEncryption(client->http, HTTP_ENCRYPTION_REQUIRED))
{
fprintf(stderr, "%s Unable to encrypt connection: %s\n", client->hostname, cupsLastErrorString());
fprintf(stderr, "%s Unable to encrypt connection: %s\n", client->hostname, cupsGetErrorString());
return (0);
}

Expand Down Expand Up @@ -3840,7 +3840,7 @@ process_http(ipp3d_client_t *client) /* I - Client connection */
{
if (ipp_state == IPP_STATE_ERROR)
{
fprintf(stderr, "%s IPP read error (%s).\n", client->hostname, cupsLastErrorString());
fprintf(stderr, "%s IPP read error (%s).\n", client->hostname, cupsGetErrorString());
respond_http(client, HTTP_STATUS_BAD_REQUEST, NULL, NULL, 0);
return (0);
}
Expand Down Expand Up @@ -4090,7 +4090,7 @@ process_ipp(ipp3d_client_t *client) /* I - Client */
httpFlush(client->http); /* Flush trailing (junk) data */

return (respond_http(client, HTTP_STATUS_OK, NULL, "application/ipp",
ippLength(client->response)));
ippGetLength(client->response)));
}


Expand Down Expand Up @@ -4315,9 +4315,9 @@ process_job(ipp3d_job_t *job) /* I - Job */
snprintf(service, sizeof(service), "%d", port);

if ((addrlist = httpAddrGetList(host, AF_UNSPEC, service)) == NULL)
fprintf(stderr, "[Job %d] Unable to find \"%s\": %s\n", job->id, host, cupsLastErrorString());
fprintf(stderr, "[Job %d] Unable to find \"%s\": %s\n", job->id, host, cupsGetErrorString());
else if (!httpAddrConnect(addrlist, &mystdout, 30000, &(job->cancel)))
fprintf(stderr, "[Job %d] Unable to connect to \"%s\": %s\n", job->id, host, cupsLastErrorString());
fprintf(stderr, "[Job %d] Unable to connect to \"%s\": %s\n", job->id, host, cupsGetErrorString());

httpAddrFreeList(addrlist);
}
Expand Down
4 changes: 2 additions & 2 deletions tools/ippdoclint.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ lint_jpeg(const char *filename, /* I - File to check */

if ((fp = cupsFileOpen(filename, "rb")) == NULL)
{
fprintf(stderr, "ERROR: Unable to open \"%s\": %s\n", filename, cupsLastErrorString());
fprintf(stderr, "ERROR: Unable to open \"%s\": %s\n", filename, cupsGetErrorString());
return (0);
}

Expand Down Expand Up @@ -657,7 +657,7 @@ lint_raster(const char *filename, /* I - File to check */

if ((fp = cupsFileOpen(filename, "rb")) == NULL)
{
fprintf(stderr, "ERROR: Unable to open \"%s\": %s\n", filename, cupsLastErrorString());
fprintf(stderr, "ERROR: Unable to open \"%s\": %s\n", filename, cupsGetErrorString());
return (0);
}

Expand Down
Loading

0 comments on commit ccc36eb

Please sign in to comment.