trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bc...@apache.org
Subject [trafficserver] branch master updated: Fixes padding byte being part of the POST/PUT data (2nd try)
Date Wed, 19 Apr 2017 22:33:50 GMT
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/master by this push:
       new  74bbc78   Fixes padding byte being part of the POST/PUT data (2nd try)
74bbc78 is described below

commit 74bbc781382146c9d87683b8c0ebc537ee40cdee
Author: Masakazu Kitajo <maskit@apache.org>
AuthorDate: Wed Apr 19 10:14:48 2017 +0900

    Fixes padding byte being part of the POST/PUT data (2nd try)
---
 proxy/http2/Http2ConnectionState.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc
index 6df7bd0..7964a49 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -102,7 +102,7 @@ rcv_data_frame(Http2ConnectionState &cstate, const Http2Frame &frame)
   }
 
   if (frame.header().flags & HTTP2_FLAGS_DATA_PADDED) {
-    frame.reader()->read(&pad_length, HTTP2_DATA_PADLEN_LEN);
+    frame.reader()->memcpy(&pad_length, HTTP2_DATA_PADLEN_LEN, nbytes);
     nbytes += HTTP2_DATA_PADLEN_LEN;
     if (pad_length > payload_length) {
       // If the length of the padding is the length of the
@@ -150,6 +150,10 @@ rcv_data_frame(Http2ConnectionState &cstate, const Http2Frame &frame)
   // update its offset via consume.  Otherwise, we will read the same data on the
   // second time through
   IOBufferReader *myreader = frame.reader()->clone();
+  // Skip pad length field
+  if (frame.header().flags & HTTP2_FLAGS_DATA_PADDED) {
+    myreader->consume(HTTP2_DATA_PADLEN_LEN);
+  }
   while (nbytes < payload_length - pad_length) {
     size_t read_len = BUFFER_SIZE_FOR_INDEX(buffer_size_index[HTTP2_FRAME_TYPE_DATA]);
     if (nbytes + read_len > unpadded_length) {

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Mime
View raw message