Skip to content

Commit

Permalink
Fix missing error info
Browse files Browse the repository at this point in the history
  • Loading branch information
twose committed Dec 7, 2023
1 parent 59008f6 commit 232b509
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ext/src/swow_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,10 @@ static inline int swow_stream_accept(php_stream *stream, swow_netstream_data_t *
php_stream_close(xparam->outputs.client);
xparam->outputs.client = NULL;
xparam->outputs.returncode = -1;
xparam->outputs.error_code = cat_orig_errno(cat_get_last_error_code());
if (xparam->want_errortext) {
xparam->outputs.error_text = strpprintf(0, "%s", cat_get_last_error_message());
}
return -1;
}
}
Expand Down Expand Up @@ -1030,6 +1034,9 @@ static int swow_stream_set_tcp_option(php_stream *stream, int option, int value,
return PHP_STREAM_OPTION_RETURN_OK;
case STREAM_XPORT_CRYPTO_OP_ENABLE:
cparam->outputs.returncode = swow_stream_enable_crypto(stream, swow_sock, sock, socket, cparam);
if (cparam->outputs.returncode != 1) {
php_error_docref(NULL, E_WARNING, "%s", cat_get_last_error_message());
}
return PHP_STREAM_OPTION_RETURN_OK;
default:
break;
Expand Down

0 comments on commit 232b509

Please sign in to comment.