nghttpx: Fix bug that server push from mruby script did not work

This commit is contained in:
Tatsuhiro Tsujikawa 2016-04-16 18:52:14 +09:00
parent 4041d1eb26
commit 6f52da834b
2 changed files with 5 additions and 1 deletions

View File

@ -1893,7 +1893,8 @@ bool Http2Upstream::push_enabled() const {
int Http2Upstream::initiate_push(Downstream *downstream, const StringRef &uri) {
int rv;
if (uri.empty() || !push_enabled() || (downstream->get_stream_id() % 2)) {
if (uri.empty() || !push_enabled() ||
(downstream->get_stream_id() % 2) == 0) {
return 0;
}

View File

@ -68,6 +68,9 @@ public:
virtual int send_reply(Downstream *downstream, const uint8_t *body,
size_t bodylen) = 0;
// Starts server push. The |downstream| is an associated stream for
// the pushed resource. This function returns 0 if it succeeds,
// otherwise -1.
virtual int initiate_push(Downstream *downstream, const StringRef &uri) = 0;
// Fills response data in |iov| whose capacity is |iovcnt|. Returns