1
0
mirror of https://github.com/moparisthebest/spdylay synced 2024-11-13 13:05:04 -05:00

Added implementation note for deletion of downstream

This commit is contained in:
Tatsuhiro Tsujikawa 2012-06-12 22:43:28 +09:00
parent 6702d34651
commit 22f5bb3ebb

View File

@ -117,6 +117,9 @@ void on_stream_close_callback
// At this point, downstream read may be paused. // At this point, downstream read may be paused.
upstream->remove_downstream(downstream); upstream->remove_downstream(downstream);
delete downstream; delete downstream;
// How to test this case? Request sufficient large download
// and make client send RST_STREAM after it gets first DATA
// frame chunk.
} }
} }
} }
@ -575,6 +578,8 @@ spdylay_session* SpdyUpstream::get_spdy_session()
return session_; return session_;
} }
// WARNING: Never call directly or indirectly spdylay_session_send or
// spdylay_session_recv. These calls may delete downstream.
int SpdyUpstream::on_downstream_header_complete(Downstream *downstream) int SpdyUpstream::on_downstream_header_complete(Downstream *downstream)
{ {
if(ENABLE_LOG) { if(ENABLE_LOG) {
@ -628,6 +633,8 @@ int SpdyUpstream::on_downstream_header_complete(Downstream *downstream)
return 0; return 0;
} }
// WARNING: Never call directly or indirectly spdylay_session_send or
// spdylay_session_recv. These calls may delete downstream.
int SpdyUpstream::on_downstream_body(Downstream *downstream, int SpdyUpstream::on_downstream_body(Downstream *downstream,
const uint8_t *data, size_t len) const uint8_t *data, size_t len)
{ {
@ -646,6 +653,8 @@ int SpdyUpstream::on_downstream_body(Downstream *downstream,
return 0; return 0;
} }
// WARNING: Never call directly or indirectly spdylay_session_send or
// spdylay_session_recv. These calls may delete downstream.
int SpdyUpstream::on_downstream_body_complete(Downstream *downstream) int SpdyUpstream::on_downstream_body_complete(Downstream *downstream)
{ {
if(ENABLE_LOG) { if(ENABLE_LOG) {