status of the job that was sent. This caused
remote queues to stop on client machines when
the server had job history disabled.
+ - Added httpConnectEncrypt() function to avoid
+ performance penalty for setting up encrypted
+ connections initially.
+ - Use httpConnectEncrypt() in all client apps
+ and in the CUPS API to ensure consistent usage
+ of encryption throughout.
CHANGES IN CUPS V1.1.7
/*
- * "$Id: lpc.c,v 1.11 2001/02/13 20:37:42 mike Exp $"
+ * "$Id: lpc.c,v 1.12 2001/05/06 00:11:22 mike Exp $"
*
* "lpc" command for the Common UNIX Printing System (CUPS).
*
* Connect to the scheduler...
*/
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption());
if (argc > 1)
{
/*
- * End of "$Id: lpc.c,v 1.11 2001/02/13 20:37:42 mike Exp $".
+ * End of "$Id: lpc.c,v 1.12 2001/05/06 00:11:22 mike Exp $".
*/
/*
- * "$Id: lpq.c,v 1.17 2001/02/13 20:37:42 mike Exp $"
+ * "$Id: lpq.c,v 1.18 2001/05/06 00:11:22 mike Exp $"
*
* "lpq" command for the Common UNIX Printing System (CUPS).
*
* Connect to the scheduler...
*/
- if ((http = httpConnect(cupsServer(), ippPort())) == NULL)
+ if ((http = httpConnectEncrypt(cupsServer(), ippPort(),
+ cupsEncryption())) == NULL)
{
fputs("lpq: Unable to contact server!\n", stderr);
return (1);
/*
- * End of "$Id: lpq.c,v 1.17 2001/02/13 20:37:42 mike Exp $".
+ * End of "$Id: lpq.c,v 1.18 2001/05/06 00:11:22 mike Exp $".
*/
/*
- * "$Id: lprm.c,v 1.15 2001/03/02 17:35:03 mike Exp $"
+ * "$Id: lprm.c,v 1.16 2001/05/06 00:11:22 mike Exp $"
*
* "lprm" command for the Common UNIX Printing System (CUPS).
*
* Open a connection to the server...
*/
- if ((http = httpConnect(cupsServer(), ippPort())) == NULL)
+ if ((http = httpConnectEncrypt(cupsServer(), ippPort(), encryption)) == NULL)
{
fputs("lprm: Unable to contact server!\n", stderr);
cupsFreeDests(num_dests, dests);
return (1);
}
- httpEncryption(http, encryption);
-
/*
* Process command-line arguments...
*/
/*
- * End of "$Id: lprm.c,v 1.15 2001/03/02 17:35:03 mike Exp $".
+ * End of "$Id: lprm.c,v 1.16 2001/05/06 00:11:22 mike Exp $".
*/
/*
- * "$Id: admin.c,v 1.22 2001/03/05 21:37:33 mike Exp $"
+ * "$Id: admin.c,v 1.23 2001/05/06 00:11:23 mike Exp $"
*
* Administration CGI for the Common UNIX Printing System (CUPS).
*
* Connect to the HTTP server...
*/
- http = httpConnect("localhost", ippPort());
+ http = httpConnectEncrypt("localhost", ippPort(), cupsEncryption());
/*
* Do the operation...
/*
- * End of "$Id: admin.c,v 1.22 2001/03/05 21:37:33 mike Exp $".
+ * End of "$Id: admin.c,v 1.23 2001/05/06 00:11:23 mike Exp $".
*/
/*
- * "$Id: classes.c,v 1.18 2001/01/22 15:03:22 mike Exp $"
+ * "$Id: classes.c,v 1.19 2001/05/06 00:11:23 mike Exp $"
*
* Class status CGI for the Common UNIX Printing System (CUPS).
*
* Connect to the HTTP server...
*/
- http = httpConnect("localhost", ippPort());
+ http = httpConnectEncrypt("localhost", ippPort(), cupsEncryption());
/*
* Tell the client to expect HTML...
/*
- * End of "$Id: classes.c,v 1.18 2001/01/22 15:03:22 mike Exp $".
+ * End of "$Id: classes.c,v 1.19 2001/05/06 00:11:23 mike Exp $".
*/
/*
- * "$Id: jobs.c,v 1.15 2001/01/22 15:03:22 mike Exp $"
+ * "$Id: jobs.c,v 1.16 2001/05/06 00:11:23 mike Exp $"
*
* Job status CGI for the Common UNIX Printing System (CUPS).
*
* Connect to the HTTP server...
*/
- http = httpConnect("localhost", ippPort());
+ http = httpConnectEncrypt("localhost", ippPort(), cupsEncryption());
/*
* Tell the client to expect HTML...
/*
- * End of "$Id: jobs.c,v 1.15 2001/01/22 15:03:22 mike Exp $".
+ * End of "$Id: jobs.c,v 1.16 2001/05/06 00:11:23 mike Exp $".
*/
/*
- * "$Id: printers.c,v 1.21 2001/01/22 15:03:22 mike Exp $"
+ * "$Id: printers.c,v 1.22 2001/05/06 00:11:24 mike Exp $"
*
* Printer status CGI for the Common UNIX Printing System (CUPS).
*
* Connect to the HTTP server...
*/
- http = httpConnect("localhost", ippPort());
+ http = httpConnectEncrypt("localhost", ippPort(), cupsEncryption());
/*
* Tell the client to expect HTML...
/*
- * End of "$Id: printers.c,v 1.21 2001/01/22 15:03:22 mike Exp $".
+ * End of "$Id: printers.c,v 1.22 2001/05/06 00:11:24 mike Exp $".
*/
/*
- * "$Id: http.c,v 1.82 2001/03/06 14:57:00 mike Exp $"
+ * "$Id: http.c,v 1.83 2001/05/06 00:11:24 mike Exp $"
*
* HTTP routines for the Common UNIX Printing System (CUPS) scheduler.
*
*
* Contents:
*
- * httpInitialize() - Initialize the HTTP interface library and set the
- * default HTTP proxy (if any).
- * httpCheck() - Check to see if there is a pending response from
- * the server.
- * httpClose() - Close an HTTP connection...
- * httpConnect() - Connect to a HTTP server.
- * httpEncryption() - Set the required encryption on the link.
- * httpReconnect() - Reconnect to a HTTP server...
- * httpSeparate() - Separate a Universal Resource Identifier into its
- * components.
- * httpSetField() - Set the value of an HTTP header.
- * httpDelete() - Send a DELETE request to the server.
- * httpGet() - Send a GET request to the server.
- * httpHead() - Send a HEAD request to the server.
- * httpOptions() - Send an OPTIONS request to the server.
- * httpPost() - Send a POST request to the server.
- * httpPut() - Send a PUT request to the server.
- * httpTrace() - Send an TRACE request to the server.
- * httpFlush() - Flush data from a HTTP connection.
- * httpRead() - Read data from a HTTP connection.
- * httpWrite() - Write data to a HTTP connection.
- * httpGets() - Get a line of text from a HTTP connection.
- * httpPrintf() - Print a formatted string to a HTTP connection.
- * httpStatus() - Return a short string describing a HTTP status code.
- * httpGetDateString() - Get a formatted date/time string from a time value.
- * httpGetDateTime() - Get a time value from a formatted date/time string.
- * httpUpdate() - Update the current HTTP state for incoming data.
- * httpDecode64() - Base64-decode a string.
- * httpEncode64() - Base64-encode a string.
- * httpGetLength() - Get the amount of data remaining from the
- * content-length or transfer-encoding fields.
- * http_field() - Return the field index for a field name.
- * http_send() - Send a request with all fields and the trailing
- * blank line.
- * http_upgrade() - Force upgrade to TLS encryption.
+ * httpInitialize() - Initialize the HTTP interface library and set the
+ * default HTTP proxy (if any).
+ * httpCheck() - Check to see if there is a pending response from
+ * the server.
+ * httpClose() - Close an HTTP connection...
+ * httpConnect() - Connect to a HTTP server.
+ * httpConnectEncrypt() - Connect to a HTTP server using encryption.
+ * httpEncryption() - Set the required encryption on the link.
+ * httpReconnect() - Reconnect to a HTTP server...
+ * httpSeparate() - Separate a Universal Resource Identifier into its
+ * components.
+ * httpSetField() - Set the value of an HTTP header.
+ * httpDelete() - Send a DELETE request to the server.
+ * httpGet() - Send a GET request to the server.
+ * httpHead() - Send a HEAD request to the server.
+ * httpOptions() - Send an OPTIONS request to the server.
+ * httpPost() - Send a POST request to the server.
+ * httpPut() - Send a PUT request to the server.
+ * httpTrace() - Send an TRACE request to the server.
+ * httpFlush() - Flush data from a HTTP connection.
+ * httpRead() - Read data from a HTTP connection.
+ * httpWrite() - Write data to a HTTP connection.
+ * httpGets() - Get a line of text from a HTTP connection.
+ * httpPrintf() - Print a formatted string to a HTTP connection.
+ * httpStatus() - Return a short string describing a HTTP status code.
+ * httpGetDateString() - Get a formatted date/time string from a time value.
+ * httpGetDateTime() - Get a time value from a formatted date/time string.
+ * httpUpdate() - Update the current HTTP state for incoming data.
+ * httpDecode64() - Base64-decode a string.
+ * httpEncode64() - Base64-encode a string.
+ * httpGetLength() - Get the amount of data remaining from the
+ * content-length or transfer-encoding fields.
+ * http_field() - Return the field index for a field name.
+ * http_send() - Send a request with all fields and the trailing
+ * blank line.
+ * http_upgrade() - Force upgrade to TLS encryption.
*/
/*
http_t * /* O - New HTTP connection */
httpConnect(const char *host, /* I - Host to connect to */
int port) /* I - Port number */
+{
+ http_encryption_t encrypt;/* Type of encryption to use */
+
+
+ /*
+ * Set the default encryption status...
+ */
+
+ if (port == 443)
+ encrypt = HTTP_ENCRYPT_ALWAYS;
+ else
+ encrypt = HTTP_ENCRYPT_IF_REQUESTED;
+
+ return (httpConnectEncrypt(host, port, encrypt));
+}
+
+
+/*
+ * 'httpConnectEncrypt()' - Connect to a HTTP server using encryption.
+ */
+
+http_t * /* O - New HTTP connection */
+httpConnectEncrypt(const char *host, /* I - Host to connect to */
+ int port, /* I - Port number */
+ http_encryption_t encrypt)
+ /* I - Type of encryption to use */
{
http_t *http; /* New HTTP connection */
struct hostent *hostaddr; /* Host address data */
#endif /* WIN32 */
/*
- * Set the default encryption status...
+ * Set the encryption status...
*/
- if (port == 443)
- http->encryption = HTTP_ENCRYPT_ALWAYS;
+ http->encryption = encrypt;
/*
* Connect to the remote system...
/*
- * End of "$Id: http.c,v 1.82 2001/03/06 14:57:00 mike Exp $".
+ * End of "$Id: http.c,v 1.83 2001/05/06 00:11:24 mike Exp $".
*/
/*
- * "$Id: http.h,v 1.33 2001/01/22 15:03:25 mike Exp $"
+ * "$Id: http.h,v 1.34 2001/05/06 00:11:24 mike Exp $"
*
* Hyper-Text Transport Protocol definitions for the Common UNIX Printing
* System (CUPS).
httpSetField((http), HTTP_FIELD_HOST, (http)->hostname)
extern void httpClose(http_t *http);
extern http_t *httpConnect(const char *host, int port);
+extern http_t *httpConnectEncrypt(const char *host, int port,
+ http_encryption_t encrypt);
extern int httpDelete(http_t *http, const char *uri);
extern int httpEncryption(http_t *http, http_encryption_t e);
# define httpError(http) ((http)->error)
#endif /* !_CUPS_HTTP_H_ */
/*
- * End of "$Id: http.h,v 1.33 2001/01/22 15:03:25 mike Exp $".
+ * End of "$Id: http.h,v 1.34 2001/05/06 00:11:24 mike Exp $".
*/
/*
- * "$Id: util.c,v 1.84 2001/04/30 15:34:04 mike Exp $"
+ * "$Id: util.c,v 1.85 2001/05/06 00:11:25 mike Exp $"
*
* Printing utilities for the Common UNIX Printing System (CUPS).
*
{
httpClose(cups_server);
- if ((cups_server = httpConnect(hostname, ippPort())) == NULL)
+ if ((cups_server = httpConnectEncrypt(hostname, ippPort(),
+ cupsEncryption())) == NULL)
{
last_error = IPP_SERVICE_UNAVAILABLE;
return (NULL);
DEBUG_printf(("connecting to %s on port %d...\n", hostname, ippPort()));
- if ((cups_server = httpConnect(hostname, ippPort())) == NULL)
+ if ((cups_server = httpConnectEncrypt(hostname, ippPort(),
+ cupsEncryption())) == NULL)
{
last_error = IPP_SERVICE_UNAVAILABLE;
return (NULL);
}
else
- {
- httpEncryption(cups_server, cupsEncryption());
return (printer);
- }
}
/*
- * End of "$Id: util.c,v 1.84 2001/04/30 15:34:04 mike Exp $".
+ * End of "$Id: util.c,v 1.85 2001/05/06 00:11:25 mike Exp $".
*/
/*
- * "$Id: cups-lpd.c,v 1.24 2001/03/30 15:23:29 mike Exp $"
+ * "$Id: cups-lpd.c,v 1.25 2001/05/06 00:11:25 mike Exp $"
*
* Line Printer Daemon interface for the Common UNIX Printing System (CUPS).
*
* Setup a connection and request data...
*/
- if ((http = httpConnect(cupsServer(), ippPort())) == NULL)
+ if ((http = httpConnectEncrypt(cupsServer(), ippPort(),
+ cupsEncryption())) == NULL)
{
syslog(LOG_ERR, "Unable to connect to server: %s", strerror(errno));
return (0);
* Try connecting to the local server...
*/
- if ((http = httpConnect(cupsServer(), ippPort())) == NULL)
+ if ((http = httpConnectEncrypt(cupsServer(), ippPort(),
+ cupsEncryption())) == NULL)
return (1);
language = cupsLangDefault();
* Try connecting to the local server...
*/
- if ((http = httpConnect(cupsServer(), ippPort())) == NULL)
+ if ((http = httpConnectEncrypt(cupsServer(), ippPort(),
+ cupsEncryption())) == NULL)
return (1);
/*
/*
- * End of "$Id: cups-lpd.c,v 1.24 2001/03/30 15:23:29 mike Exp $".
+ * End of "$Id: cups-lpd.c,v 1.25 2001/05/06 00:11:25 mike Exp $".
*/
/*
- * "$Id: cups-polld.c,v 1.5 2001/01/22 15:03:59 mike Exp $"
+ * "$Id: cups-polld.c,v 1.6 2001/05/06 00:11:25 mike Exp $"
*
* Polling daemon for the Common UNIX Printing System (CUPS).
*
* Open a connection to the server...
*/
- if ((http = httpConnect(argv[1], atoi(argv[2]))) == NULL)
+ if ((http = httpConnectEncrypt(argv[1], atoi(argv[2]),
+ cupsEncryption())) == NULL)
{
perror("cups-polld");
return (1);
/*
- * End of "$Id: cups-polld.c,v 1.5 2001/01/22 15:03:59 mike Exp $".
+ * End of "$Id: cups-polld.c,v 1.6 2001/05/06 00:11:25 mike Exp $".
*/
/*
- * "$Id: accept.c,v 1.11 2001/01/23 17:36:22 mike Exp $"
+ * "$Id: accept.c,v 1.12 2001/05/06 00:11:26 mike Exp $"
*
* "accept", "disable", "enable", and "reject" commands for the Common
* UNIX Printing System (CUPS).
httpClose(http);
if (argv[i][2] != '\0')
- http = httpConnect(argv[i] + 2, ippPort());
+ http = httpConnectEncrypt(argv[i] + 2, ippPort(), encryption);
else
{
i ++;
return (1);
}
- http = httpConnect(argv[i], ippPort());
+ http = httpConnectEncrypt(argv[i], ippPort(), encryption);
}
if (http == NULL)
}
if (http == NULL)
- http = httpConnect(hostname, ippPort());
+ http = httpConnectEncrypt(hostname, ippPort(), encryption);
if (http == NULL)
{
* Do the request and get back a response...
*/
- httpEncryption(http, encryption);
-
if ((response = cupsDoRequest(http, request, "/admin/")) != NULL)
{
if (response->request.status.status_code > IPP_OK_CONFLICT)
/*
- * End of "$Id: accept.c,v 1.11 2001/01/23 17:36:22 mike Exp $".
+ * End of "$Id: accept.c,v 1.12 2001/05/06 00:11:26 mike Exp $".
*/
/*
- * "$Id: cancel.c,v 1.19 2001/03/02 17:35:04 mike Exp $"
+ * "$Id: cancel.c,v 1.20 2001/05/06 00:11:26 mike Exp $"
*
* "cancel" command for the Common UNIX Printing System (CUPS).
*
httpClose(http);
if (argv[i][2] != '\0')
- http = httpConnect(argv[i] + 2, ippPort());
+ http = httpConnectEncrypt(argv[i] + 2, ippPort(), encryption);
else
{
i ++;
return (1);
}
else
- http = httpConnect(argv[i], ippPort());
+ http = httpConnectEncrypt(argv[i], ippPort(), encryption);
}
if (http == NULL)
*host++ = '\0';
- if ((http = httpConnect(host, ippPort())) == NULL)
+ if ((http = httpConnectEncrypt(host, ippPort(), encryption)) == NULL)
{
perror("cancel: Unable to connect to server");
return (1);
*/
if (http == NULL)
- if ((http = httpConnect(cupsServer(), ippPort())) == NULL)
+ if ((http = httpConnectEncrypt(cupsServer(), ippPort(),
+ encryption)) == NULL)
{
fputs("cancel: Unable to contact server!\n", stderr);
return (1);
* Do the request and get back a response...
*/
- httpEncryption(http, encryption);
-
if (op == IPP_PURGE_JOBS)
response = cupsDoRequest(http, request, "/admin/");
else
/*
- * End of "$Id: cancel.c,v 1.19 2001/03/02 17:35:04 mike Exp $".
+ * End of "$Id: cancel.c,v 1.20 2001/05/06 00:11:26 mike Exp $".
*/
/*
- * "$Id: lp.c,v 1.29 2001/03/09 14:26:54 mike Exp $"
+ * "$Id: lp.c,v 1.30 2001/05/06 00:11:26 mike Exp $"
*
* "lp" command for the Common UNIX Printing System (CUPS).
*
char uri[HTTP_MAX_URI]; /* URI for job */
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption());
language = cupsLangDefault();
/*
- * End of "$Id: lp.c,v 1.29 2001/03/09 14:26:54 mike Exp $".
+ * End of "$Id: lp.c,v 1.30 2001/05/06 00:11:26 mike Exp $".
*/
/*
- * "$Id: lpadmin.c,v 1.22 2001/02/07 00:33:55 mike Exp $"
+ * "$Id: lpadmin.c,v 1.23 2001/05/06 00:11:27 mike Exp $"
*
* "lpadmin" command for the Common UNIX Printing System (CUPS).
*
case 'c' : /* Add printer to class */
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpadmin: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
if (printer == NULL)
case 'd' : /* Set as default destination */
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpadmin: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
if (argv[i][2])
httpClose(http);
if (argv[i][2] != '\0')
- http = httpConnect(argv[i] + 2, ippPort());
+ http = httpConnectEncrypt(argv[i] + 2, ippPort(), encryption);
else
{
i ++;
return (1);
}
else
- http = httpConnect(argv[i], ippPort());
+ http = httpConnectEncryption(argv[i], ippPort(), encryption);
}
if (http == NULL)
return (1);
}
else
- {
- httpEncryption(http, encryption);
cupsSetServer(http->hostname);
- }
break;
case 'i' : /* Use the specified interface script */
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpadmin: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
if (printer == NULL)
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpadmin: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
enable_printer(http, printer);
case 'm' : /* Use the specified standard script/PPD file */
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpadmin: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
if (printer == NULL)
case 'p' : /* Add/modify a printer */
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpadmin: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
if (argv[i][2])
httpClose(http);
*host++ = '\0';
- if ((http = httpConnect(host, ippPort())) == NULL)
+ if ((http = httpConnectEncrypt(host, ippPort(), encryption)) == NULL)
{
perror("lpadmin: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
break;
case 'r' : /* Remove printer from class */
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpadmin: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
if (printer == NULL)
case 'v' : /* Set the device-uri attribute */
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpadmin: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
if (printer == NULL)
case 'x' : /* Delete a printer */
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpadmin: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
if (argv[i][2])
httpClose(http);
*host++ = '\0';
- if ((http = httpConnect(host, ippPort())) == NULL)
+ if ((http = httpConnectEncrypt(host, ippPort(), encryption)) == NULL)
{
perror("lpadmin: Unable to connect to server");
return (1);
case 'D' : /* Set the printer-info attribute */
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpadmin: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
if (printer == NULL)
case 'L' : /* Set the printer-location attribute */
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpadmin: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
if (printer == NULL)
case 'P' : /* Use the specified PPD file */
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpadmin: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
if (printer == NULL)
{
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpadmin: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
if (printer == NULL)
/*
- * End of "$Id: lpadmin.c,v 1.22 2001/02/07 00:33:55 mike Exp $".
+ * End of "$Id: lpadmin.c,v 1.23 2001/05/06 00:11:27 mike Exp $".
*/
/*
- * "$Id: lpinfo.c,v 1.3 2001/01/23 17:36:23 mike Exp $"
+ * "$Id: lpinfo.c,v 1.4 2001/05/06 00:11:27 mike Exp $"
*
* "lpinfo" command for the Common UNIX Printing System (CUPS).
*
case 'm' : /* Show models */
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpinfo: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
show_models(http, long_status);
case 'v' : /* Show available devices */
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpinfo: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
show_devices(http, long_status);
httpClose(http);
if (argv[i][2] != '\0')
- http = httpConnect(argv[i] + 2, ippPort());
+ http = httpConnectEncrypt(argv[i] + 2, ippPort(), encryption);
else
{
i ++;
return (1);
}
- http = httpConnect(argv[i], ippPort());
+ http = httpConnectEncrypt(argv[i], ippPort(), encryption);
}
if (http == NULL)
perror("lpinfo: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
break;
default :
/*
- * End of "$Id: lpinfo.c,v 1.3 2001/01/23 17:36:23 mike Exp $".
+ * End of "$Id: lpinfo.c,v 1.4 2001/05/06 00:11:27 mike Exp $".
*/
/*
- * "$Id: lpmove.c,v 1.5 2001/01/23 17:36:24 mike Exp $"
+ * "$Id: lpmove.c,v 1.6 2001/05/06 00:11:27 mike Exp $"
*
* "lpmove" command for the Common UNIX Printing System (CUPS).
*
httpClose(http);
if (argv[i][2] != '\0')
- http = httpConnect(argv[i] + 2, ippPort());
+ http = httpConnectEncrypt(argv[i] + 2, ippPort(), encryption);
else
{
i ++;
return (1);
}
- http = httpConnect(argv[i], ippPort());
+ http = httpConnectEncrypt(argv[i], ippPort(), encryption);
}
if (http == NULL)
perror("lpmove: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
break;
default :
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpmove: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
move_job(http, atoi(job), dest);
/*
- * End of "$Id: lpmove.c,v 1.5 2001/01/23 17:36:24 mike Exp $".
+ * End of "$Id: lpmove.c,v 1.6 2001/05/06 00:11:27 mike Exp $".
*/
/*
- * "$Id: lpstat.c,v 1.37 2001/01/26 15:29:59 mike Exp $"
+ * "$Id: lpstat.c,v 1.38 2001/05/06 00:11:27 mike Exp $"
*
* "lpstat" command for the Common UNIX Printing System (CUPS).
*
case 'a' : /* Show acceptance status */
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpstat: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
if (num_dests == 0)
case 'c' : /* Show classes and members */
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpstat: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
if (argv[i][2] != '\0')
if (argv[i][2] != '\0')
{
- http = httpConnect(argv[i] + 2, ippPort());
- snprintf(server, sizeof(server), "CUPS_SERVER=%s", argv[i] + 2);
+ http = httpConnectEncrypt(argv[i] + 2, ippPort(), encryption);
+ cupsSetServer(argv[i] + 2);
}
else
{
return (1);
}
- http = httpConnect(argv[i], ippPort());
- snprintf(server, sizeof(server), "CUPS_SERVER=%s", argv[i] + 2);
+ http = httpConnectEncrypt(argv[i], ippPort(), encryption);
+ cupsSetServer(argv[i]);
}
- putenv(server);
if (http == NULL)
{
perror("lpstat: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
break;
case 'l' : /* Long status */
case 'o' : /* Show jobs by destination */
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpstat: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
if (argv[i][2] != '\0')
case 'p' : /* Show printers */
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpstat: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
if (num_dests == 0)
case 'r' : /* Show scheduler status */
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpstat: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
show_scheduler(http);
case 's' : /* Show summary */
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpstat: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
if (num_dests == 0)
case 't' : /* Show all info */
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpstat: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
if (num_dests == 0)
case 'u' : /* Show jobs by user */
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpstat: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
if (argv[i][2] != '\0')
case 'v' : /* Show printer devices */
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpstat: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
if (num_dests == 0)
{
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpstat: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
show_jobs(http, argv[i], NULL, long_status, ranking);
{
if (!http)
{
- http = httpConnect(cupsServer(), ippPort());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), encryption);
if (http == NULL)
{
perror("lpstat: Unable to connect to server");
return (1);
}
-
- httpEncryption(http, encryption);
}
show_jobs(http, NULL, cupsUser(), long_status, ranking);
{
httpSeparate(printer_uri, method, username, server, &port, resource);
- if ((http2 = httpConnect(server, port)) != NULL)
+ if ((http2 = httpConnectEncrypt(server, port, encryption)) != NULL)
{
/*
* Build an IPP_GET_PRINTER_ATTRIBUTES request, which requires the
/*
- * End of "$Id: lpstat.c,v 1.37 2001/01/26 15:29:59 mike Exp $".
+ * End of "$Id: lpstat.c,v 1.38 2001/05/06 00:11:27 mike Exp $".
*/