Return 0 on reads where the SSL layer needs more data to proceed

This commit is contained in:
Florian Zeitz 2012-09-17 16:26:24 +02:00
parent 430bde693e
commit 1aa89e25dd

View file

@ -270,10 +270,14 @@ ssl_locking_callback(int mode, int n, const char *file, int line)
@throw e; @throw e;
} }
if ((ret = SSL_read(ssl, buffer, (int)length)) < 0) if ((ret = SSL_read(ssl, buffer, (int)length)) < 0) {
if (SSL_get_error(ssl, ret) == SSL_ERROR_WANT_READ)
return 0;
@throw [OFReadFailedException exceptionWithClass: [self class] @throw [OFReadFailedException exceptionWithClass: [self class]
stream: self stream: self
requestedLength: length]; requestedLength: length];
}
if (ret == 0) if (ret == 0)
atEndOfStream = YES; atEndOfStream = YES;