Skip to content

Commit 78f227b

Browse files
committed
Pass tests with SSL
1 parent cf79fad commit 78f227b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ssl.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ void ssl_on_data(struct us_ssl_socket *s, void *data, int length) {
185185
}
186186
}
187187

188-
189188
if (read > 0) {
190189

191190
// note: if we got a shutdown we cannot send anything, so we need to handle shutdown earlier than this
@@ -425,10 +424,11 @@ void us_ssl_socket_shutdown(struct us_ssl_socket *s) {
425424

426425
// sets SSL_SENT_SHUTDOWN no matter what (not actually true if error!)
427426
int ret = SSL_shutdown(s->ssl);
427+
if (ret == 0) {
428+
ret = SSL_shutdown(s->ssl);
429+
}
428430

429-
int err = SSL_get_error(s->ssl, ret);
430-
431-
if (err == SSL_ERROR_SSL) {
431+
if (ret < 0) {
432432
// we get here if we are shutting down while still in init
433433
us_socket_shutdown(&s->s);
434434
}

0 commit comments

Comments
 (0)