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

Side by Side Diff: net/server/web_socket.cc

Issue 8677002: Fix Win builder following r111314 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/server/web_socket.h" 5 #include "net/server/web_socket.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/md5.h" 10 #include "base/md5.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 size_t data_length = connection_->recv_data().length(); 209 size_t data_length = connection_->recv_data().length();
210 if (data_length < 2) 210 if (data_length < 2)
211 return FRAME_INCOMPLETE; 211 return FRAME_INCOMPLETE;
212 212
213 const char* p = connection_->recv_data().c_str(); 213 const char* p = connection_->recv_data().c_str();
214 const char* buffer_end = p + data_length; 214 const char* buffer_end = p + data_length;
215 215
216 unsigned char first_byte = *p++; 216 unsigned char first_byte = *p++;
217 unsigned char second_byte = *p++; 217 unsigned char second_byte = *p++;
218 218
219 final_ = first_byte & kFinalBit; 219 final_ = (first_byte & kFinalBit) != 0;
220 reserved1_ = first_byte & kReserved1Bit; 220 reserved1_ = (first_byte & kReserved1Bit) != 0;
221 reserved2_ = first_byte & kReserved2Bit; 221 reserved2_ = (first_byte & kReserved2Bit) != 0;
222 reserved3_ = first_byte & kReserved3Bit; 222 reserved3_ = (first_byte & kReserved3Bit) != 0;
223 op_code_ = first_byte & kOpCodeMask; 223 op_code_ = first_byte & kOpCodeMask;
224 masked_ = second_byte & kMaskBit; 224 masked_ = (second_byte & kMaskBit) != 0;
225 225
226 switch (op_code_) { 226 switch (op_code_) {
227 case kOpCodeClose: 227 case kOpCodeClose:
228 closed_ = true; 228 closed_ = true;
229 break; 229 break;
230 case kOpCodeText: 230 case kOpCodeText:
231 break; 231 break;
232 case kOpCodeBinary: // We don't support binary frames yet. 232 case kOpCodeBinary: // We don't support binary frames yet.
233 case kOpCodeContinuation: // We don't support binary frames yet. 233 case kOpCodeContinuation: // We don't support binary frames yet.
234 case kOpCodePing: // We don't support binary frames yet. 234 case kOpCodePing: // We don't support binary frames yet.
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 if (socket) 365 if (socket)
366 return socket; 366 return socket;
367 367
368 return WebSocketHixie76::Create(connection, request, pos); 368 return WebSocketHixie76::Create(connection, request, pos);
369 } 369 }
370 370
371 WebSocket::WebSocket(HttpConnection* connection) : connection_(connection) { 371 WebSocket::WebSocket(HttpConnection* connection) : connection_(connection) {
372 } 372 }
373 373
374 } // namespace net 374 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698