]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Squid BIO related fixes
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Mon, 4 Feb 2013 17:17:38 +0000 (19:17 +0200)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Mon, 4 Feb 2013 17:17:38 +0000 (19:17 +0200)
- Do not close the filedescriptor inside Ssl::Bio::~Bio() destructor
  The callers do conn->close()
- Fix the BIO_CTRL_DUP control command to return 0. This command
  duplicates the current bio. It should be implemented if the SSL_dup
  OpenSSL function used anywhere inside squid.

src/ssl/bio.cc

index f7a7be80868e0a6975a02272c14f86973392e1cf..1bee31cbb9d693f690f0e157a58f4edd92f1e9a3 100644 (file)
@@ -75,8 +75,6 @@ Ssl::Bio::Bio(const int anFd): fd_(anFd)
 Ssl::Bio::~Bio()
 {
     debugs(83, 7, "Bio destructing, this=" << this << " FD " << fd_);
-    // XXX: seems wrong: we do not own this fd and callers do conn->close()!
-    comm_close(fd_); 
 }
 
 int Ssl::Bio::write(const char *buf, int size, BIO *table)
@@ -215,7 +213,11 @@ squid_bio_ctrl(BIO *table, int cmd, long arg1, void *arg2)
         }
         return -1;
 
-    case BIO_CTRL_DUP: // XXX: Should this really do what FLUSH does?
+    case BIO_CTRL_DUP:
+        // Should implemented if the SSL_dup openSSL API function 
+        // used anywhere in squid.
+        return 0;
+
     case BIO_CTRL_FLUSH:
         if (table->init) {
             Ssl::Bio *bio = static_cast<Ssl::Bio*>(table->ptr);