diff options
author | Andreas Schneider <asn@samba.org> | 2019-11-20 11:27:10 +0100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2019-11-22 19:54:55 +0000 |
commit | e7f0e858e00a76976c3d84c8808e9296254b42a5 (patch) | |
tree | 9b40a328e30b906e5ad92dddc2b229422ffcd383 /source3/printing | |
parent | 6107c79c90fdff3fe60e0d0ef3efe57b52b21262 (diff) | |
download | samba-e7f0e858e00a76976c3d84c8808e9296254b42a5.tar.gz |
s3:printing: Use httpConnect2 from CUPS
This fixes deprecation warnings.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Nov 22 19:54:55 UTC 2019 on sn-devel-184
Diffstat (limited to 'source3/printing')
-rw-r--r-- | source3/printing/print_cups.c | 13 | ||||
-rw-r--r-- | source3/printing/print_iprint.c | 84 |
2 files changed, 90 insertions, 7 deletions
diff --git a/source3/printing/print_cups.c b/source3/printing/print_cups.c index 738307f47b4..c4704cc5831 100644 --- a/source3/printing/print_cups.c +++ b/source3/printing/print_cups.c @@ -143,7 +143,18 @@ static http_t *cups_connect(TALLOC_CTX *frame) alarm(timeout); } -#ifdef HAVE_HTTPCONNECTENCRYPT +#if defined(HAVE_HTTPCONNECT2) + http = httpConnect2(server, + port, + NULL, + AF_UNSPEC, + lp_cups_encrypt() ? + HTTP_ENCRYPTION_ALWAYS : + HTTP_ENCRYPTION_IF_REQUESTED, + 1, /* blocking */ + 30 * 1000, /* timeout */ + NULL); +#elif defined(HAVE_HTTPCONNECTENCRYPT) http = httpConnectEncrypt(server, port, lp_cups_encrypt()); #else http = httpConnect(server, port); diff --git a/source3/printing/print_iprint.c b/source3/printing/print_iprint.c index 1c9e5a25922..e57d111acd0 100644 --- a/source3/printing/print_iprint.c +++ b/source3/printing/print_iprint.c @@ -375,7 +375,19 @@ bool iprint_cache_reload(struct pcap_cache **_pcache) * Try to connect to the server... */ - if ((http = httpConnect(iprint_server(), ippPort())) == NULL) { +#ifdef HAVE_HTTPCONNECT2 + http = httpConnect2(iprint_server(), + ippPort(), + NULL, + AF_UNSPEC, + HTTP_ENCRYPTION_NEVER, + 1, /* blocking */ + 30 * 1000, /* timeout */ + NULL); +#else + http = httpConnect(iprint_server(), ippPort()); +#endif + if (http == NULL) { DEBUG(0,("Unable to connect to iPrint server %s - %s\n", iprint_server(), strerror(errno))); goto out; @@ -495,7 +507,19 @@ static int iprint_job_delete(const char *sharename, const char *lprm_command, st * Try to connect to the server... */ - if ((http = httpConnect(iprint_server(), ippPort())) == NULL) { +#ifdef HAVE_HTTPCONNECT2 + http = httpConnect2(iprint_server(), + ippPort(), + NULL, + AF_UNSPEC, + HTTP_ENCRYPTION_NEVER, + 1, /* blocking */ + 30 * 1000, /* timeout */ + NULL); +#else + http = httpConnect(iprint_server(), ippPort()); +#endif + if (http == NULL) { DEBUG(0,("Unable to connect to iPrint server %s - %s\n", iprint_server(), strerror(errno))); goto out; @@ -593,7 +617,19 @@ static int iprint_job_pause(int snum, struct printjob *pjob) * Try to connect to the server... */ - if ((http = httpConnect(iprint_server(), ippPort())) == NULL) { +#ifdef HAVE_HTTPCONNECT2 + http = httpConnect2(iprint_server(), + ippPort(), + NULL, + AF_UNSPEC, + HTTP_ENCRYPTION_NEVER, + 1, /* blocking */ + 30 * 1000, /* timeout */ + NULL); +#else + http = httpConnect(iprint_server(), ippPort()); +#endif + if (http == NULL) { DEBUG(0,("Unable to connect to iPrint server %s - %s\n", iprint_server(), strerror(errno))); goto out; @@ -693,7 +729,19 @@ static int iprint_job_resume(int snum, struct printjob *pjob) * Try to connect to the server... */ - if ((http = httpConnect(iprint_server(), ippPort())) == NULL) { +#ifdef HAVE_HTTPCONNECT2 + http = httpConnect2(iprint_server(), + ippPort(), + NULL, + AF_UNSPEC, + HTTP_ENCRYPTION_NEVER, + 1, /* blocking */ + 30 * 1000, /* timeout */ + NULL); +#else + http = httpConnect(iprint_server(), ippPort()); +#endif + if (http == NULL) { DEBUG(0,("Unable to connect to iPrint server %s - %s\n", iprint_server(), strerror(errno))); goto out; @@ -794,7 +842,19 @@ static int iprint_job_submit(int snum, struct printjob *pjob, * Try to connect to the server... */ - if ((http = httpConnect(iprint_server(), ippPort())) == NULL) { +#ifdef HAVE_HTTPCONNECT2 + http = httpConnect2(iprint_server(), + ippPort(), + NULL, + AF_UNSPEC, + HTTP_ENCRYPTION_NEVER, + 1, /* blocking */ + 30 * 1000, /* timeout */ + NULL); +#else + http = httpConnect(iprint_server(), ippPort()); +#endif + if (http == NULL) { DEBUG(0,("Unable to connect to iPrint server %s - %s\n", iprint_server(), strerror(errno))); goto out; @@ -959,7 +1019,19 @@ static int iprint_queue_get(const char *sharename, * Try to connect to the server... */ - if ((http = httpConnect(iprint_server(), ippPort())) == NULL) { +#ifdef HAVE_HTTPCONNECT2 + http = httpConnect2(iprint_server(), + ippPort(), + NULL, + AF_UNSPEC, + HTTP_ENCRYPTION_NEVER, + 1, /* blocking */ + 30 * 1000, /* timeout */ + NULL); +#else + http = httpConnect(iprint_server(), ippPort()); +#endif + if (http == NULL) { DEBUG(0,("Unable to connect to iPrint server %s - %s\n", iprint_server(), strerror(errno))); goto out; |