Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: net/http/http_util.h

Issue 1166953002: Use net's response header parser for parsing multipart headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address more comments Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/child/multipart_response_delegate.cc ('k') | net/http/http_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_util.h
diff --git a/net/http/http_util.h b/net/http/http_util.h
index b1585243d3eb0db4b267a0425367012e273a864a..79a41acd193cccddc4152fabb50e0760ba06b385 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
« no previous file with comments | « content/child/multipart_response_delegate.cc ('k') | net/http/http_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698