These functions' return value semantics did not match those documented
in stream-provider.h.
if (error == SSL_ERROR_ZERO_RETURN) {
return 0;
} else {
- return interpret_ssl_error("SSL_read", ret, error, &sslv->rx_want);
+ return -interpret_ssl_error("SSL_read", ret, error,
+ &sslv->rx_want);
}
}
}
struct ssl_stream *sslv = ssl_stream_cast(stream);
if (sslv->txbuf) {
- return EAGAIN;
+ return -EAGAIN;
} else {
int error;
switch (error) {
case 0:
ssl_clear_txbuf(sslv);
- return 0;
+ return n;
case EAGAIN:
leak_checker_claim(buffer);
- return 0;
+ return n;
default:
sslv->txbuf = NULL;
- return error;
+ return -error;
}
}
}