The branch, master has been updated
       via  e7f0e858e00 s3:printing: Use httpConnect2 from CUPS
      from  6107c79c90f build: Do not build selftest binaries for builds 
without --enable-selftest

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit e7f0e858e00a76976c3d84c8808e9296254b42a5
Author: Andreas Schneider <[email protected]>
Date:   Wed Nov 20 11:27:10 2019 +0100

    s3:printing: Use httpConnect2 from CUPS
    
    This fixes deprecation warnings.
    
    Signed-off-by: Andreas Schneider <[email protected]>
    Reviewed-by: Andrew Bartlett <[email protected]>
    
    Autobuild-User(master): Andrew Bartlett <[email protected]>
    Autobuild-Date(master): Fri Nov 22 19:54:55 UTC 2019 on sn-devel-184

-----------------------------------------------------------------------

Summary of changes:
 source3/printing/print_cups.c   | 13 ++++++-
 source3/printing/print_iprint.c | 84 ++++++++++++++++++++++++++++++++++++++---
 source3/wscript                 |  2 +-
 3 files changed, 91 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

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;
diff --git a/source3/wscript b/source3/wscript
index 28f43fa72b9..f3d0c7d7f34 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -650,7 +650,7 @@ msg.msg_accrightslen = sizeof(fd);
             conf.CHECK_CFG(path=conf.env.CUPS_CONFIG, args="--cflags 
--ldflags",
                            package="", uselib_store="CUPS")
         conf.CHECK_HEADERS('cups/cups.h cups/language.h', lib='cups')
-        conf.CHECK_FUNCS_IN('httpConnect httpConnectEncrypt', 'cups')
+        conf.CHECK_FUNCS_IN('httpConnect httpConnect2 httpConnectEncrypt', 
'cups')
         if conf.CONFIG_SET('HAVE_CUPS_CUPS_H') and 
conf.CONFIG_SET('HAVE_CUPS_LANGUAGE_H'):
             conf.DEFINE('HAVE_CUPS', '1')
         else:


-- 
Samba Shared Repository

Reply via email to