summaryrefslogtreecommitdiffstats
path: root/net/http/http_util.h
diff options
context:
space:
mode:
authorhaavardm <haavardm@opera.com>2015-06-11 01:19:54 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-11 08:20:39 +0000
commit8e7ed88c4187c496961b87fdcd1a2c307c39fe1b (patch)
treec5f52bbcb033ca27404ddb067868e7112b55790b /net/http/http_util.h
parent8ca72d1504c20967ec2693ec453a5f13ae0926cf (diff)
downloadchromium_src-8e7ed88c4187c496961b87fdcd1a2c307c39fe1b.zip
chromium_src-8e7ed88c4187c496961b87fdcd1a2c307c39fe1b.tar.gz
chromium_src-8e7ed88c4187c496961b87fdcd1a2c307c39fe1b.tar.bz2
Use net's response header parser for parsing multipart headers.
BUG=493379 Review URL: https://codereview.chromium.org/1166953002 Cr-Commit-Position: refs/heads/master@{#333909}
Diffstat (limited to 'net/http/http_util.h')
-rw-r--r--net/http/http_util.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/net/http/http_util.h b/net/http/http_util.h
index b158524..79a41ac 100644
--- a/net/http/http_util.h
+++ b/net/http/http_util.h
@@ -147,10 +147,19 @@ class NET_EXPORT HttpUtil {
// 2616 defines the end-of-headers marker as a double CRLF; however, some
// servers only send back LFs (e.g., Unix-based CGI scripts written using the
// ASIS Apache module). This function therefore accepts the pattern LF[CR]LF
- // as end-of-headers (just like Mozilla).
+ // as end-of-headers (just like Mozilla). The first line of |buf| is
+ // considered the status line, even if empty.
// The parameter |i| is the offset within |buf| to begin searching from.
static int LocateEndOfHeaders(const char* buf, int buf_len, int i = 0);
+ // Same as |LocateEndOfHeaders|, but does not expect a status line, so can be
+ // used on multi-part responses or HTTP/1.x trailers. As a result, if |buf|
+ // starts with a single [CR]LF, it is considered an empty header list, as
+ // opposed to an empty status line above a header list.
+ static int LocateEndOfAdditionalHeaders(const char* buf,
+ int buf_len,
+ int i = 0);
+
// Assemble "raw headers" in the format required by HttpResponseHeaders.
// This involves normalizing line terminators, converting [CR]LF to \0 and
// handling HTTP line continuations (i.e., lines starting with LWS are