shithub: opusfile

Download patch

ref: 073fe98cbf3853bdb15ca9dd8b3b1b928240ad09
parent: 9df7ae98d0de6d368248ce7dab60a12b48ba445e
author: Timothy B. Terriberry <[email protected]>
date: Sat Sep 22 08:35:29 EDT 2012

Minor http redirect clean-ups.

Actually close the old socket.
Don't initialize SSL more than once.

--- a/src/http.c
+++ b/src/http.c
@@ -1190,7 +1190,7 @@
     last_host=host;
     last_port=port;
     /*Initialize the SSL library if necessary.*/
-    if(OP_URL_IS_SSL(&_stream->url)){
+    if(OP_URL_IS_SSL(&_stream->url)&&_stream->ssl_ctx==NULL){
       SSL_CTX *ssl_ctx;
       /*We need to establish a CONNECT tunnel to handle https proxying.
         This isn't supported yet.*/
@@ -1406,6 +1406,7 @@
       if(last_host!=_proxy_host)_ogg_free((void *)last_host);
       return ret;
     }
+    op_http_conn_close(_stream,_stream->conns+0);
   }
   /*Redirection limit reached.*/
   return OP_FALSE;