OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2011 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 size_t result = parseHTTPRequestLine(data, length, failureReason, m_requestM
ethod, url, m_httpVersion); | 74 size_t result = parseHTTPRequestLine(data, length, failureReason, m_requestM
ethod, url, m_httpVersion); |
75 m_url = KURL(KURL(), url); | 75 m_url = KURL(KURL(), url); |
76 return result; | 76 return result; |
77 } | 77 } |
78 | 78 |
79 size_t HTTPRequest::parseHeaders(const char* data, size_t length, String& failur
eReason) | 79 size_t HTTPRequest::parseHeaders(const char* data, size_t length, String& failur
eReason) |
80 { | 80 { |
81 const char* p = data; | 81 const char* p = data; |
82 const char* end = data + length; | 82 const char* end = data + length; |
83 AtomicString name; | 83 AtomicString name; |
84 String value; | 84 AtomicString value; |
85 for (; p < data + length; p++) { | 85 for (; p < data + length; p++) { |
86 size_t consumedLength = parseHTTPHeader(p, end - p, failureReason, name,
value); | 86 size_t consumedLength = parseHTTPHeader(p, end - p, failureReason, name,
value); |
87 if (!consumedLength) | 87 if (!consumedLength) |
88 return 0; | 88 return 0; |
89 p += consumedLength; | 89 p += consumedLength; |
90 if (name.isEmpty()) | 90 if (name.isEmpty()) |
91 break; | 91 break; |
92 m_headerFields.add(name, value); | 92 m_headerFields.add(name, value); |
93 } | 93 } |
94 return p - data; | 94 return p - data; |
(...skipping 14 matching lines...) Expand all Loading... |
109 , m_httpVersion(version) | 109 , m_httpVersion(version) |
110 , m_requestMethod(requestMethod) | 110 , m_requestMethod(requestMethod) |
111 { | 111 { |
112 } | 112 } |
113 | 113 |
114 HTTPRequest::~HTTPRequest() | 114 HTTPRequest::~HTTPRequest() |
115 { | 115 { |
116 } | 116 } |
117 | 117 |
118 } // namespace WebCore | 118 } // namespace WebCore |
OLD | NEW |