diff options
author | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2013-10-17 16:44:47 +0000 |
---|---|---|
committer | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2013-10-17 16:44:47 +0000 |
commit | d3d894744ded84a4f1d9cae41601b1a2e766acaa (patch) | |
tree | 043949cda2294e7d6f18320478a4ab7bae5bfca7 /cups/http.c | |
parent | 2c85b7523922528d3f6d66a8ed1d454e9dbb221a (diff) | |
download | cups-d3d894744ded84a4f1d9cae41601b1a2e766acaa.tar.gz |
Get builds working again (still need to fill in the server-side stuff for TLS)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11340 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'cups/http.c')
-rw-r--r-- | cups/http.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/cups/http.c b/cups/http.c index 752706978..36729b122 100644 --- a/cups/http.c +++ b/cups/http.c @@ -538,15 +538,29 @@ httpEncryption(http_t *http, /* I - HTTP connection */ if (!http) return (0); - http->encryption = e; + if (http->mode == _HTTP_MODE_CLIENT) + { + http->encryption = e; - if ((http->encryption == HTTP_ENCRYPTION_ALWAYS && !http->tls) || - (http->encryption == HTTP_ENCRYPTION_NEVER && http->tls)) - return (httpReconnect2(http, 30000, NULL)); - else if (http->encryption == HTTP_ENCRYPTION_REQUIRED && !http->tls) - return (http_tls_upgrade(http)); + if ((http->encryption == HTTP_ENCRYPTION_ALWAYS && !http->tls) || + (http->encryption == HTTP_ENCRYPTION_NEVER && http->tls)) + return (httpReconnect2(http, 30000, NULL)); + else if (http->encryption == HTTP_ENCRYPTION_REQUIRED && !http->tls) + return (http_tls_upgrade(http)); + else + return (0); + } else - return (0); + { + if (e == HTTP_ENCRYPTION_NEVER && http->tls) + return (-1); + + http->encryption = e; + if (e != HTTP_ENCRYPTION_IF_REQUESTED && !http->tls) + return (http_tls_start(http)); + else + return (0); + } #else if (e == HTTP_ENCRYPTION_ALWAYS || e == HTTP_ENCRYPTION_REQUIRED) return (-1); @@ -2860,7 +2874,7 @@ httpShutdown(http_t *http) /* I - HTTP connection */ return; if (http->tls) - http_shutdown_ssl(http); + http_tls_stop(http); shutdown(http->fd, SHUT_RD); } |