Commit 6f52da83 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

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

parent 4041d1eb
......@@ -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;
}
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment