nghttpx: Don't use data_prd.source.ptr

This commit is contained in:
Tatsuhiro Tsujikawa 2016-03-27 16:57:43 +09:00
parent 2cee80acf0
commit c9aba4ea0c
1 changed files with 2 additions and 4 deletions

View File

@ -173,7 +173,7 @@ ssize_t http2_data_read_callback(nghttp2_session *session, int32_t stream_id,
if (!sd || !sd->dconn) {
return NGHTTP2_ERR_DEFERRED;
}
auto dconn = static_cast<Http2DownstreamConnection *>(source->ptr);
auto dconn = sd->dconn;
auto downstream = dconn->get_downstream();
if (!downstream) {
// In this case, RST_STREAM should have been issued. But depending
@ -453,9 +453,7 @@ int Http2DownstreamConnection::push_request_headers() {
if (req.method == HTTP_CONNECT || chunked_encoding || content_length ||
req.http2_expect_body) {
// Request-body is expected.
nghttp2_data_provider data_prd;
data_prd.source.ptr = this;
data_prd.read_callback = http2_data_read_callback;
nghttp2_data_provider data_prd{{}, http2_data_read_callback};
rv = http2session_->submit_request(this, nva.data(), nva.size(), &data_prd);
} else {
rv = http2session_->submit_request(this, nva.data(), nva.size(), nullptr);