Skip to content

Instantly share code, notes, and snippets.

Created November 12, 2012 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/4061896 to your computer and use it in GitHub Desktop.
Save anonymous/4061896 to your computer and use it in GitHub Desktop.
diff --git a/src/libwaitress/waitress.c b/src/libwaitress/waitress.c
index ce2a254..88c309e 100644
--- a/src/libwaitress/waitress.c
+++ b/src/libwaitress/waitress.c
@@ -537,6 +537,10 @@ static WaitressReturn_t WaitressGnutlsRead (void *data, char *buf,
ssize_t ret = gnutls_record_recv (waith->request.tlsSession, buf, size);
if (ret < 0) {
+ if (ret == GNUTLS_E_PREMATURE_TERMINATION) {
+ *retSize = 0;
+ return waith->request.readWriteRet;
+ }
return WAITRESS_RET_TLS_READ_ERR;
} else {
*retSize = ret;
@giddonah
Copy link

giddonah commented Feb 3, 2013

what the hell do I do with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment