[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 02/03: Replace usage of MHD_Connection::tls
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 02/03: Replace usage of MHD_Connection::tls_closed with MHD_Connection::tls_state |
Date: |
Mon, 05 Jun 2017 21:21:53 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 730134054bb94b499adf4164c29d5346ff1fdec1
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Mon Jun 5 21:00:39 2017 +0300
Replace usage of MHD_Connection::tls_closed with MHD_Connection::tls_state
---
src/microhttpd/connection_https.c | 21 +++++++++++++++++----
src/microhttpd/internal.h | 5 -----
2 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/src/microhttpd/connection_https.c
b/src/microhttpd/connection_https.c
index 08f569f0..9fe62b08 100644
--- a/src/microhttpd/connection_https.c
+++ b/src/microhttpd/connection_https.c
@@ -246,12 +246,25 @@ MHD_set_https_callbacks (struct MHD_Connection
*connection)
bool
MHD_tls_connection_shutdown (struct MHD_Connection *connection)
{
- if (! connection->tls_closed)
+ if (MHD_TLS_CONN_WR_CLOSED > connection->tls_state)
{
- connection->tls_closed =
- (GNUTLS_E_SUCCESS == gnutls_bye(connection->tls_session,
GNUTLS_SHUT_WR));
+ const int res =
+ gnutls_bye(connection->tls_session, GNUTLS_SHUT_WR);
+ if (GNUTLS_E_SUCCESS == ret)
+ {
+ connection->tls_state = MHD_TLS_CONN_WR_CLOSED;
+ return true;
+ }
+ if ((GNUTLS_E_AGAIN == ret) ||
+ (GNUTLS_E_INTERRUPTED == ret))
+ {
+ connection->tls_state = MHD_TLS_CONN_WR_CLOSING;
+ return true;
+ }
+ else
+ connection->tls_state = MHD_TLS_CONN_TLS_FAILED;
}
- return connection->tls_closed ? MHD_YES : MHD_NO;;
+ return false;
}
/* end of connection_https.c */
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index be0eb424..eaed1580 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -989,11 +989,6 @@ struct MHD_Connection
* even though the socket is not?
*/
bool tls_read_ready;
-
- /**
- * TLS layer was shut down?
- */
- bool tls_closed;
#endif /* HTTPS_SUPPORT */
/**
--
To stop receiving notification emails like this one, please contact
address@hidden