diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index 659408d62..98cf04987 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -7,6 +7,7 @@ The changelog for SRS. ## SRS 7.0 Changelog +* v7.0, 2025-10-26, AI: HTTPS: Handle SSL_ERROR_ZERO_RETURN as graceful connection closure. v7.0.108 (#4036) * v7.0, 2025-10-26, AI: API: Add clients field to on_play/on_stop webhooks and total field to HTTP API. v7.0.107 (#4147) * v7.0, 2025-10-26, AI: WebRTC: Fix camera/microphone not released after closing publisher. v7.0.106 (#4261) * v7.0, 2025-10-26, AI: Build: Improve dependency checking to report all missing dependencies at once. v7.0.105 (#4293) diff --git a/trunk/src/core/srs_core_version7.hpp b/trunk/src/core/srs_core_version7.hpp index ccc01c635..c6d62d463 100644 --- a/trunk/src/core/srs_core_version7.hpp +++ b/trunk/src/core/srs_core_version7.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 7 #define VERSION_MINOR 0 -#define VERSION_REVISION 107 +#define VERSION_REVISION 108 #endif \ No newline at end of file diff --git a/trunk/src/protocol/srs_protocol_conn.cpp b/trunk/src/protocol/srs_protocol_conn.cpp index 2fc7655c8..041afb067 100644 --- a/trunk/src/protocol/srs_protocol_conn.cpp +++ b/trunk/src/protocol/srs_protocol_conn.cpp @@ -533,6 +533,12 @@ srs_error_t SrsSslConnection::read(void *plaintext, size_t nn_plaintext, ssize_t int r2 = BIO_ctrl_pending(bio_in_); int r3 = SSL_is_init_finished(ssl_); + // Peer gracefully close. + if (r0 == 0 && r1 == SSL_ERROR_ZERO_RETURN) { + return srs_error_new(ERROR_SOCKET_READ, "SSL_read r0=%d, r1=%d, r2=%d, r3=%d", + r0, r1, r2, r3); + } + // OK, got data. if (r0 > 0) { srs_assert(r0 <= (int)nn_plaintext); diff --git a/trunk/src/protocol/srs_protocol_http_client.cpp b/trunk/src/protocol/srs_protocol_http_client.cpp index a3a1c3e0d..8648dbd2c 100644 --- a/trunk/src/protocol/srs_protocol_http_client.cpp +++ b/trunk/src/protocol/srs_protocol_http_client.cpp @@ -198,6 +198,12 @@ srs_error_t SrsSslClient::read(void *plaintext, size_t nn_plaintext, ssize_t *nr int r2 = BIO_ctrl_pending(bio_in_); int r3 = SSL_is_init_finished(ssl_); + // Peer gracefully close. + if (r0 == 0 && r1 == SSL_ERROR_ZERO_RETURN) { + return srs_error_new(ERROR_SOCKET_READ, "SSL_read r0=%d, r1=%d, r2=%d, r3=%d", + r0, r1, r2, r3); + } + // OK, got data. if (r0 > 0) { srs_assert(r0 <= (int)nn_plaintext);