You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2015/12/10 02:39:55 UTC

[1/2] trafficserver git commit: TS-4062: CID 1341764: Remove DEADCODE

Repository: trafficserver
Updated Branches:
  refs/heads/master d5307c6d5 -> 88c35d77a


TS-4062: CID 1341764: Remove DEADCODE

This DEADCODE will be restored in TS-4061


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a68d5834
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a68d5834
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a68d5834

Branch: refs/heads/master
Commit: a68d583467033b634b528c903dfe44fa076da5ed
Parents: d5307c6
Author: Masaori Koshiba <ma...@apache.org>
Authored: Wed Dec 9 11:28:06 2015 +0900
Committer: Masaori Koshiba <ma...@apache.org>
Committed: Thu Dec 10 10:35:02 2015 +0900

----------------------------------------------------------------------
 proxy/http2/HPACK.cc | 3 ---
 1 file changed, 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a68d5834/proxy/http2/HPACK.cc
----------------------------------------------------------------------
diff --git a/proxy/http2/HPACK.cc b/proxy/http2/HPACK.cc
index b05f3a8..7e4b2fc 100644
--- a/proxy/http2/HPACK.cc
+++ b/proxy/http2/HPACK.cc
@@ -343,9 +343,6 @@ encode_string(uint8_t *buf_start, const uint8_t *buf_end, const char *value, siz
     if (data == NULL)
       return -1;
     data_len = huffman_encode(reinterpret_cast<uint8_t *>(data), reinterpret_cast<const uint8_t *>(value), value_len);
-  } else {
-    data = const_cast<char *>(value);
-    data_len = value_len;
   }
 
   // Length


[2/2] trafficserver git commit: TS-4062: CID 1341763: Free data when error

Posted by ma...@apache.org.
TS-4062: CID 1341763: Free data when error

This closes #370


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/88c35d77
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/88c35d77
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/88c35d77

Branch: refs/heads/master
Commit: 88c35d77a8897325f0cecfc4c844938bbffa6035
Parents: a68d583
Author: Masaori Koshiba <ma...@apache.org>
Authored: Wed Dec 9 11:29:20 2015 +0900
Committer: Masaori Koshiba <ma...@apache.org>
Committed: Thu Dec 10 10:35:23 2015 +0900

----------------------------------------------------------------------
 proxy/http2/HPACK.cc | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/88c35d77/proxy/http2/HPACK.cc
----------------------------------------------------------------------
diff --git a/proxy/http2/HPACK.cc b/proxy/http2/HPACK.cc
index 7e4b2fc..51b9a2f 100644
--- a/proxy/http2/HPACK.cc
+++ b/proxy/http2/HPACK.cc
@@ -347,14 +347,26 @@ encode_string(uint8_t *buf_start, const uint8_t *buf_end, const char *value, siz
 
   // Length
   const int64_t len = encode_integer(p, buf_end, data_len, 7);
-  if (len == -1)
+  if (len == -1) {
+    if (use_huffman) {
+      ats_free(data);
+    }
+
     return -1;
+  }
+
   if (use_huffman) {
     *p |= 0x80;
   }
   p += len;
-  if (buf_end < p || buf_end - p < data_len)
+
+  if (buf_end < p || buf_end - p < data_len) {
+    if (use_huffman) {
+      ats_free(data);
+    }
+
     return -1;
+  }
 
   // Value
   memcpy(p, data, data_len);