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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 // 2. Parse HTTP Headers. | 54 // 2. Parse HTTP Headers. |
55 size_t headersLength = request->parseHeaders(pos, remainingLength, failureRe
ason); | 55 size_t headersLength = request->parseHeaders(pos, remainingLength, failureRe
ason); |
56 if (!headersLength) | 56 if (!headersLength) |
57 return 0; | 57 return 0; |
58 pos += headersLength; | 58 pos += headersLength; |
59 remainingLength -= headersLength; | 59 remainingLength -= headersLength; |
60 | 60 |
61 // 3. Parse HTTP Data. | 61 // 3. Parse HTTP Data. |
62 size_t dataLength = request->parseRequestBody(pos, remainingLength); | 62 size_t dataLength = request->parseRequestBody(pos, remainingLength); |
63 pos += dataLength; | |
64 remainingLength -= dataLength; | 63 remainingLength -= dataLength; |
65 | 64 |
66 // We should have processed the entire input. | 65 // We should have processed the entire input. |
67 ASSERT(!remainingLength); | 66 ASSERT(!remainingLength); |
68 return request.release(); | 67 return request.release(); |
69 } | 68 } |
70 | 69 |
71 size_t HTTPRequest::parseRequestLine(const char* data, size_t length, String& fa
ilureReason) | 70 size_t HTTPRequest::parseRequestLine(const char* data, size_t length, String& fa
ilureReason) |
72 { | 71 { |
73 String url; | 72 String url; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 , m_httpVersion(version) | 108 , m_httpVersion(version) |
110 , m_requestMethod(requestMethod) | 109 , m_requestMethod(requestMethod) |
111 { | 110 { |
112 } | 111 } |
113 | 112 |
114 HTTPRequest::~HTTPRequest() | 113 HTTPRequest::~HTTPRequest() |
115 { | 114 { |
116 } | 115 } |
117 | 116 |
118 } // namespace WebCore | 117 } // namespace WebCore |
OLD | NEW |