summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2012-06-14 20:49:07 +0200
committerLars-Dominik Braun <lars@6xq.net>2012-06-14 20:49:07 +0200
commitba122b9354e1556171ec3c10706c73ff19a7b347 (patch)
tree08afc288cfcb1d4b43387e659afcee5ee56619ef /src
parentefa919fc80b388b38045da79a513ba9dd9f0b4c5 (diff)
downloadpianobar-ba122b9354e1556171ec3c10706c73ff19a7b347.tar.gz
pianobar-ba122b9354e1556171ec3c10706c73ff19a7b347.tar.bz2
pianobar-ba122b9354e1556171ec3c10706c73ff19a7b347.zip
waitress: Send TLS bye only if connect was successful
Diffstat (limited to 'src')
-rw-r--r--src/libwaitress/waitress.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libwaitress/waitress.c b/src/libwaitress/waitress.c
index c98a55e..ee2926b 100644
--- a/src/libwaitress/waitress.c
+++ b/src/libwaitress/waitress.c
@@ -1098,11 +1098,13 @@ WaitressReturn_t WaitressFetchCall (WaitressHandle_t *waith) {
if ((wRet = WaitressSendRequest (waith)) == WAITRESS_RET_OK) {
wRet = WaitressReceiveResponse (waith);
}
+ if (waith->url.tls) {
+ gnutls_bye (waith->request.tlsSession, GNUTLS_SHUT_RDWR);
+ }
}
/* cleanup */
if (waith->url.tls) {
- gnutls_bye (waith->request.tlsSession, GNUTLS_SHUT_RDWR);
gnutls_deinit (waith->request.tlsSession);
gnutls_certificate_free_credentials (waith->tlsCred);
}