@@ -159,13 +159,17 @@ int http_v2_send_frame (manapi::net::http::http_v2_t *ctx, int frame_type, uint
159159 header[4 ] = static_cast <char > (flags);
160160
161161 auto rhs = ctx->worker ->sync_write_ex (ctx->conn , header, sizeof (header), force && !size, maxcnt);
162- if (rhs != sizeof (header))
162+ if (rhs != sizeof (header)) {
163+ manapi_log_trace (manapi::debug::LOG_TRACE_LOW, " http2:ctx->worker->sync_write_ex failed" );
163164 return manapi::ERR_INTERNAL;
165+ }
164166
165167 if (nbuff) {
166168 rhs = ctx->worker ->sync_write_ex (ctx->conn , buffs, nbuff, size, force, maxcnt);
167- if (rhs != size)
169+ if (rhs != size) {
170+ manapi_log_trace (manapi::debug::LOG_TRACE_LOW, " http2:ctx->worker->sync_write_ex failed" );
168171 return manapi::ERR_INTERNAL;
172+ }
169173 }
170174
171175 if (!(ctx->flags & manapi::net::http::HTTP2_CTX_FLAG_BLOCK_WRITE)
@@ -672,7 +676,7 @@ int manapi::net::http::http_v2_on_close_stream(http_v2_t *ctx, uint32_t id) MANA
672676 return manapi::ERR_OK;
673677}
674678
675- bool http_v2_stream_on_write (const manapi::net::worker::shared_conn &conn, manapi::net::http::http_v2_stream_t *data) MANAPIHTTP_NOEXCEPT {
679+ static int http_v2_stream_on_write (const manapi::net::worker::shared_conn &conn, manapi::net::http::http_v2_stream_t *data) MANAPIHTTP_NOEXCEPT {
676680 if ((data->flags & manapi::ev::WRITE)) {
677681 if (data->ev_callback ) {
678682 try {
@@ -681,11 +685,12 @@ bool http_v2_stream_on_write (const manapi::net::worker::shared_conn &conn, mana
681685 catch (std::exception const &e) {
682686 manapi_log_error (" %s: %s failed due to %s" , " http2" , " event callback" , e.what ());
683687 }
688+ return 2 ;
684689 }
685690
686- return true ;
691+ return 1 ;
687692 }
688- return false ;
693+ return 0 ;
689694}
690695
691696int manapi::net::http::http_v2_on_write (http_v2_t *ctx) MANAPIHTTP_NOEXCEPT {
@@ -1120,8 +1125,8 @@ int manapi::net::http::http_v2_work(http_v2_t *ctx, http::config *config, const
11201125 ctx->http_v2_worker ->close_connection (s->second , worker::CLOSE_CONN_ERR);
11211126 }
11221127 else {
1123- manapi_log_trace (debug::LOG_TRACE_LOW, " http2: window frame received: id=%u v =%d prev =%u" ,
1124- sdata->id , sdata->write_window , ctx->n1 );
1128+ manapi_log_trace (debug::LOG_TRACE_LOW, " http2: window frame received: id=%u prev =%d v =%u" ,
1129+ sdata->id , sdata->write_window , sdata-> write_window + ctx->n1 );
11251130 sdata->write_window += ctx->n1 ;
11261131
11271132 if (sdata->write_window > 0 ) {
@@ -1140,8 +1145,8 @@ int manapi::net::http::http_v2_work(http_v2_t *ctx, http::config *config, const
11401145 " overflow" );
11411146 goto repeat;
11421147 }
1143- manapi_log_trace (debug::LOG_TRACE_LOW, " http2: window frame received: id=%u v =%d prev =%u" ,
1144- 0 , ctx->write_window , ctx->n1 );
1148+ manapi_log_trace (debug::LOG_TRACE_LOW, " http2: window frame received: id=%u prev =%d v =%u" ,
1149+ 0 , ctx->write_window , ctx->write_window +ctx-> n1 );
11451150
11461151 ctx->write_window += static_cast <int >(ctx->n1 );
11471152 if (ctx->write_window <= ctx->n1 ) {
0 commit comments