mirror of
https://github.com/moparisthebest/spdylay
synced 2024-11-12 04:25:09 -05:00
shrpx: Fix WINDOW_UPDATE may block until SpdyUpstream::send()
spdy_data_read_callback in SpdyDownstreamConnection calls SpdyUpstream::resume_read() which submits WINDOW_UPDATE, but after that they are not call SpdyUpstream::send(). This means that if no pending outgoing data in upstream, then WINDOW_UPDATE is blocked until SpdyUpstream::send() from somewhere. This change adds SpdyUpstream::send() to resume_read() so that WINDOW_UPDATE is not blocked.
This commit is contained in:
parent
7b3f57cef8
commit
da36fc3953
@ -190,6 +190,11 @@ ssize_t spdy_data_read_callback(spdylay_session *session,
|
|||||||
// In this case, downstream may be deleted.
|
// In this case, downstream may be deleted.
|
||||||
return SPDYLAY_ERR_DEFERRED;
|
return SPDYLAY_ERR_DEFERRED;
|
||||||
}
|
}
|
||||||
|
// Check dconn is still alive because Upstream::resume_read()
|
||||||
|
// may delete downstream which will delete dconn.
|
||||||
|
if(sd->dconn == 0) {
|
||||||
|
return SPDYLAY_ERR_DEFERRED;
|
||||||
|
}
|
||||||
if(evbuffer_get_length(body) == 0) {
|
if(evbuffer_get_length(body) == 0) {
|
||||||
return SPDYLAY_ERR_DEFERRED;
|
return SPDYLAY_ERR_DEFERRED;
|
||||||
}
|
}
|
||||||
|
@ -898,7 +898,7 @@ int SpdyUpstream::resume_read(IOCtrlReason reason, Downstream *downstream)
|
|||||||
window_update(downstream);
|
window_update(downstream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return send();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace shrpx
|
} // namespace shrpx
|
||||||
|
Loading…
Reference in New Issue
Block a user