]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Rename SessionClose to SessionSendGoodbye
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 16 Jan 2017 15:18:07 +0000 (04:18 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 16 Jan 2017 15:18:07 +0000 (04:18 +1300)
... and remove FD related things, which are no longer needed

src/comm.cc
src/security/PeerConnector.cc
src/security/Session.cc
src/security/Session.h
src/tests/stub_libsecurity.cc

index dee504e1f273f76f9e7e91e63adb79f92c780029..56f3965f177b0ab085e3b65596a543e7c3764c9e 100644 (file)
@@ -764,7 +764,7 @@ commLingerTimeout(const FdeCbParams &params)
 void
 comm_lingering_close(int fd)
 {
-    Security::SessionClose(fd_table[fd].ssl);
+    Security::SessionSendGoodbye(fd_table[fd].ssl);
 
     if (shutdown(fd, 1) < 0) {
         comm_close(fd);
@@ -825,7 +825,7 @@ old_comm_reset_close(int fd)
 void
 commStartTlsClose(const FdeCbParams &params)
 {
-    Security::SessionClose(fd_table[params.fd].ssl);
+    Security::SessionSendGoodbye(fd_table[params.fd].ssl);
 }
 
 void
index 194a1bb032fd47278ebba1e5b02b57849583f6a0..9580891598a38085a4f01cc0df5880704c2c531d 100644 (file)
@@ -551,10 +551,6 @@ Security::PeerConnector::bail(ErrorState *error)
     // the recepient before the fd-closure notification), but we would rather
     // minimize the number of fd-closure notifications and let the recepient
     // manage the TCP state of the connection.
-
-    // but we should release the TLS session (if any)
-    const int fd = serverConnection()->fd;
-    Security::SessionClose(fd_table[fd].ssl, fd);
 }
 
 void
index 615a6a935adb0ad5e0bc70d93ae6450d2ac0fdc8..b5f2a6d9055fa976227cfc7820e706794bde4344 100644 (file)
@@ -180,23 +180,14 @@ Security::CreateServerSession(const Security::ContextPointer &ctx, const Comm::C
 }
 
 void
-Security::SessionClose(const Security::SessionPointer &s, const int fdOnError)
+Security::SessionSendGoodbye(const Security::SessionPointer &s)
 {
     debugs(83, 5, "session=" << (void*)s.get());
-    if (s && fdOnError == -1) {
+    if (s) {
 #if USE_OPENSSL
         SSL_shutdown(s.get());
 #elif USE_GNUTLS
         gnutls_bye(s.get(), GNUTLS_SHUT_RDWR);
-    }
-
-    // XXX: should probably be done for OpenSSL too, but that needs testing.
-    if (fdOnError != -1) {
-        debugs(83, 5, "unlink FD " << fdOnError << " from TLS session=" << (void*)fd_table[fdOnError].ssl.get());
-        fd_table[fdOnError].ssl.reset();
-        fd_table[fdOnError].read_method = &default_read_method;
-        fd_table[fdOnError].write_method = &default_write_method;
-        fd_note(fdOnError, "TLS error");
 #endif
     }
 }
index be778ddbdcdc71bd3b144bc1c86e047bc70f493f..6574743679044014657b115f7a516bc666230eaa 100644 (file)
@@ -56,10 +56,8 @@ typedef std::unique_ptr<int> SessionStatePointer;
 
 #endif
 
-/// close an active TLS session.
-/// set fdOnError to the connection FD when the session is being closed
-/// due to an encryption error, otherwise omit.
-void SessionClose(const Security::SessionPointer &, int fdOnError = -1);
+/// send the shutdown/bye notice for an active TLS session.
+void SessionSendGoodbye(const Security::SessionPointer &);
 
 /// whether the session is a resumed one
 bool SessionIsResumed(const Security::SessionPointer &);
index 1c9ec75e17ba997f3d41c4413811edb69b255170..046656874e2f8cafd3bd3c89010eae977de85906 100644 (file)
@@ -91,8 +91,7 @@ void Security::ServerOptions::updateContextEecdh(Security::ContextPointer &) STU
 namespace Security {
 bool CreateClientSession(const Security::ContextPointer &, const Comm::ConnectionPointer &, const char *) STUB_RETVAL(false)
 bool CreateServerSession(const Security::ContextPointer &, const Comm::ConnectionPointer &, const char *) STUB_RETVAL(false)
-void SessionClose(const Security::SessionPointer &) STUB
-void SessionClose(const Security::SessionPointer &, int) STUB
+void SessionSendGoodbye(const Security::SessionPointer &) STUB
 bool SessionIsResumed(const Security::SessionPointer &) STUB_RETVAL(false)
 void MaybeGetSessionResumeData(const Security::SessionPointer &, Security::SessionStatePointer &) STUB
 void SetSessionResumeData(const Security::SessionPointer &, const Security::SessionStatePointer &) STUB