nghttp: Don't request already pushed resources

This commit is contained in:
Tatsuhiro Tsujikawa 2015-02-15 12:36:18 +09:00
parent 4cafdb7670
commit 685dabc2d6
1 changed files with 12 additions and 0 deletions

View File

@ -1807,6 +1807,18 @@ int on_frame_recv_callback2(nghttp2_session *session,
}
req->uri = uri;
req->u = u;
if (client->path_cache.count(uri)) {
nghttp2_submit_rst_stream(session, NGHTTP2_FLAG_NONE,
frame->push_promise.promised_stream_id,
NGHTTP2_CANCEL);
break;
}
if (config.multiply == 1) {
client->path_cache.insert(uri);
}
break;
}
}