Skip to content

Commit 21c3c28

Browse files
0.13.x: if reset callbacks is called in loop exit
1 parent 1f71b32 commit 21c3c28

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

api/net/stream_buffer.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ namespace net {
205205
// Pop each time, in case callback leads to another call here.
206206
m_send_buffers.pop_front();
207207
m_on_read(buf);
208+
if (m_on_read == nullptr) { break; } //if calling m_on_read reset the callbacks exit
208209
}
209210
}
210211
}

src/net/openssl/tls_stream.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,18 @@ void TLS_stream::handle_write_congestion()
164164
}
165165
void TLS_stream::handle_data()
166166
{
167-
while (m_transport->next_size() > 0)
167+
while ( m_transport->next_size() > 0)
168168
{
169169
if (UNLIKELY(read_congested())){
170170
break;
171171
}
172172
tls_read(m_transport->read_next());
173+
//bail
174+
if (m_transport == nullptr)
175+
{
176+
printf("m_transport \n");
177+
break;
178+
}
173179
}
174180
}
175181

0 commit comments

Comments
 (0)