OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 2 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
3 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
4 * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 4 * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
5 * Copyright (C) 2009 Google Inc. All rights reserved. | 5 * Copyright (C) 2009 Google Inc. All rights reserved. |
6 * Copyright (C) 2011 Apple Inc. All Rights Reserved. | 6 * Copyright (C) 2011 Apple Inc. All Rights Reserved. |
7 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 || c == '/' || c == '[' || c == ']' || c == '?' || c == '=' | 122 || c == '/' || c == '[' || c == ']' || c == '?' || c == '=' |
123 || c == '{' || c == '}') | 123 || c == '{' || c == '}') |
124 return false; | 124 return false; |
125 } | 125 } |
126 return true; | 126 return true; |
127 } | 127 } |
128 | 128 |
129 static const size_t maxInputSampleSize = 128; | 129 static const size_t maxInputSampleSize = 128; |
130 static String trimInputSample(const char* p, size_t length) | 130 static String trimInputSample(const char* p, size_t length) |
131 { | 131 { |
132 String s = String(p, std::min<size_t>(length, maxInputSampleSize)); | |
133 if (length > maxInputSampleSize) | 132 if (length > maxInputSampleSize) |
134 s.append(horizontalEllipsis); | 133 return String(p, maxInputSampleSize) + horizontalEllipsis; |
135 return s; | 134 return String(p, length); |
136 } | 135 } |
137 | 136 |
138 ContentDispositionType contentDispositionType(const String& contentDisposition) | 137 ContentDispositionType contentDispositionType(const String& contentDisposition) |
139 { | 138 { |
140 if (contentDisposition.isEmpty()) | 139 if (contentDisposition.isEmpty()) |
141 return ContentDispositionNone; | 140 return ContentDispositionNone; |
142 | 141 |
143 Vector<String> parameters; | 142 Vector<String> parameters; |
144 contentDisposition.split(';', parameters); | 143 contentDisposition.split(';', parameters); |
145 | 144 |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 | 678 |
680 size_t parseHTTPRequestBody(const char* data, size_t length, Vector<unsigned cha
r>& body) | 679 size_t parseHTTPRequestBody(const char* data, size_t length, Vector<unsigned cha
r>& body) |
681 { | 680 { |
682 body.clear(); | 681 body.clear(); |
683 body.append(data, length); | 682 body.append(data, length); |
684 | 683 |
685 return length; | 684 return length; |
686 } | 685 } |
687 | 686 |
688 } | 687 } |
OLD | NEW |