OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/websockets/websocket_basic_handshake_stream.h" | 5 #include "net/websockets/websocket_basic_handshake_stream.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 "Sent non-empty 'Sec-WebSocket-Protocol' header " | 218 "Sent non-empty 'Sec-WebSocket-Protocol' header " |
219 "but no response was received"; | 219 "but no response was received"; |
220 return false; | 220 return false; |
221 } | 221 } |
222 *sub_protocol = value; | 222 *sub_protocol = value; |
223 return true; | 223 return true; |
224 } | 224 } |
225 | 225 |
226 bool DeflateError(std::string* message, const base::StringPiece& piece) { | 226 bool DeflateError(std::string* message, const base::StringPiece& piece) { |
227 *message = "Error in permessage-deflate: "; | 227 *message = "Error in permessage-deflate: "; |
228 piece.AppendToString(message); | 228 AppendToString(piece, message); |
229 return false; | 229 return false; |
230 } | 230 } |
231 | 231 |
232 bool ValidatePerMessageDeflateExtension(const WebSocketExtension& extension, | 232 bool ValidatePerMessageDeflateExtension(const WebSocketExtension& extension, |
233 std::string* failure_message, | 233 std::string* failure_message, |
234 WebSocketExtensionParams* params) { | 234 WebSocketExtensionParams* params) { |
235 static const char kClientPrefix[] = "client_"; | 235 static const char kClientPrefix[] = "client_"; |
236 static const char kServerPrefix[] = "server_"; | 236 static const char kServerPrefix[] = "server_"; |
237 static const char kNoContextTakeover[] = "no_context_takeover"; | 237 static const char kNoContextTakeover[] = "no_context_takeover"; |
238 static const char kMaxWindowBits[] = "max_window_bits"; | 238 static const char kMaxWindowBits[] = "max_window_bits"; |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 &extensions_, | 610 &extensions_, |
611 &failure_message_, | 611 &failure_message_, |
612 extension_params_.get())) { | 612 extension_params_.get())) { |
613 return OK; | 613 return OK; |
614 } | 614 } |
615 failure_message_ = "Error during WebSocket handshake: " + failure_message_; | 615 failure_message_ = "Error during WebSocket handshake: " + failure_message_; |
616 return ERR_INVALID_RESPONSE; | 616 return ERR_INVALID_RESPONSE; |
617 } | 617 } |
618 | 618 |
619 } // namespace net | 619 } // namespace net |
OLD | NEW |