Skip to content

Commit 58aa9ac

Browse files
committed
FIX | memory leak
1 parent 09cb9e4 commit 58aa9ac

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/http/ManapiBaseHttp.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,8 +1263,6 @@ manapi::future<void> manapi::net::http::internal::send_file(std::unique_ptr<resp
12631263

12641264

12651265
cdata->cb->call(current >= size);
1266-
1267-
co_return;
12681266
}
12691267
catch (std::exception const &e) {
12701268
manapi_log_trace(debug::LOG_TRACE_MEDIUM, "send_file() %p failed due to %s", cdata->conn.get(), e.what());

src/worker/ManapiTlsOverTcp.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ void manapi::net::worker::TLS::shutdown_async_(shared_conn conn) {
419419
}
420420

421421
if (err == this->ssl_error_want_write_) {
422-
if (this->ssl_bio_flush_write_(conn, s, WORKER_MAX_CNT, false))
422+
if (this->ssl_bio_flush_write_(conn, s, this->config_->max_buffer_stack, false))
423423
goto err;
424424
if (this->flush_write_(conn, true))
425425
goto err;
@@ -455,7 +455,7 @@ void manapi::net::worker::TLS::shutdown_async_(shared_conn conn) {
455455
}
456456

457457
write:
458-
if (this->ssl_bio_flush_write_(conn, s, WORKER_MAX_CNT, false))
458+
if (this->ssl_bio_flush_write_(conn, s, this->config_->max_buffer_stack, false))
459459
goto err;
460460
if (this->flush_write_(conn, true))
461461
goto err;
@@ -530,7 +530,7 @@ void manapi::net::worker::TLS::onrecv(const std::shared_ptr<ev::tcp> &watcher, c
530530
err == this->ssl_error_want_read_ ||
531531
err == this->ssl_error_want_write_) {
532532

533-
if (this->ssl_bio_flush_write_(conn, data, WORKER_MAX_CNT, false))
533+
if (this->ssl_bio_flush_write_(conn, data, this->config_->max_buffer_stack, false))
534534
goto err;
535535
if (this->flush_write_(conn, true))
536536
goto err;
@@ -740,7 +740,7 @@ int manapi::net::worker::TLS::manapi_do_process(const shared_conn &conn, tls_con
740740
auto const err = this->ssl_get_error_(data->ssl, nread);
741741
if (err == this->ssl_error_want_read_ || err == this->ssl_error_want_write_) {
742742
/* force write all data */
743-
if (this->ssl_bio_flush_write_(conn, data, WORKER_MAX_CNT, false)) {
743+
if (this->ssl_bio_flush_write_(conn, data, this->config_->max_buffer_stack, false)) {
744744
return CONN_IO_ERROR;
745745
}
746746

@@ -803,7 +803,7 @@ int manapi::net::worker::TLS::manapi_do_handshake_(const shared_conn &conn, tls_
803803

804804
if (status == this->ssl_error_want_read_ || status == this->ssl_error_want_write_) {
805805
/* force write all data */
806-
if (this->ssl_bio_flush_write_(conn, data, WORKER_MAX_CNT, false)) {
806+
if (this->ssl_bio_flush_write_(conn, data, this->config_->max_buffer_stack, false)) {
807807
return CONN_IO_ERROR;
808808
}
809809

@@ -991,7 +991,7 @@ int manapi::net::worker::TLS::ssl_bio_flush_read_(const shared_conn &conn, tls_c
991991
else {
992992
rhs = static_cast<int>(readbytes);
993993

994-
if (this->ssl_bio_flush_write_(conn, m, WORKER_MAX_CNT, false)) {
994+
if (this->ssl_bio_flush_write_(conn, m, this->config_->max_buffer_stack, false)) {
995995
return CONN_IO_ERROR;
996996
}
997997

@@ -1032,7 +1032,7 @@ int manapi::net::worker::TLS::ssl_bio_flush_read_(const shared_conn &conn, tls_c
10321032

10331033
if (err == this->ssl_error_want_read_ || err == this->ssl_error_want_write_) {
10341034
/* force write all data */
1035-
if (this->ssl_bio_flush_write_(conn, m, WORKER_MAX_CNT, false)) {
1035+
if (this->ssl_bio_flush_write_(conn, m, this->config_->max_buffer_stack, false)) {
10361036
return CONN_IO_ERROR;
10371037
}
10381038

0 commit comments

Comments
 (0)