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

Side by Side Diff: net/quic/crypto/crypto_framer.cc

Issue 11633030: Send the ClientHello handshake message. Fix a bug in (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix QuicStreamFactoryTest properly Created 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/quic/crypto/crypto_framer.h" 5 #include "net/quic/crypto/crypto_framer.h"
6 6
7 #include "net/quic/quic_data_reader.h" 7 #include "net/quic/quic_data_reader.h"
8 #include "net/quic/quic_data_writer.h" 8 #include "net/quic/quic_data_writer.h"
9 #include "net/quic/quic_protocol.h" 9 #include "net/quic/quic_protocol.h"
10 10
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } 97 }
98 state_ = STATE_READING_VALUES; 98 state_ = STATE_READING_VALUES;
99 } 99 }
100 case STATE_READING_VALUES: 100 case STATE_READING_VALUES:
101 if (reader.BytesRemaining() < values_len_) { 101 if (reader.BytesRemaining() < values_len_) {
102 break; 102 break;
103 } 103 }
104 for (int i = 0; i < num_entries_; ++i) { 104 for (int i = 0; i < num_entries_; ++i) {
105 StringPiece value; 105 StringPiece value;
106 reader.ReadStringPiece(&value, tag_length_map_[tags_[i]]); 106 reader.ReadStringPiece(&value, tag_length_map_[tags_[i]]);
107 tag_value_map_[tags_[i]] = value; 107 tag_value_map_[tags_[i]] = value.as_string();
108 } 108 }
109 CryptoHandshakeMessage message; 109 CryptoHandshakeMessage message;
110 message.tag = message_tag_; 110 message.tag = message_tag_;
111 message.tag_value_map.swap(tag_value_map_); 111 message.tag_value_map.swap(tag_value_map_);
112 visitor_->OnHandshakeMessage(message); 112 visitor_->OnHandshakeMessage(message);
113 Clear(); 113 Clear();
114 state_ = STATE_READING_TAG; 114 state_ = STATE_READING_TAG;
115 break; 115 break;
116 } 116 }
117 // Save any remaining data. 117 // Save any remaining data.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 182
183 void CryptoFramer::Clear() { 183 void CryptoFramer::Clear() {
184 tag_value_map_.clear(); 184 tag_value_map_.clear();
185 tag_length_map_.clear(); 185 tag_length_map_.clear();
186 tags_.clear(); 186 tags_.clear();
187 error_ = QUIC_NO_ERROR; 187 error_ = QUIC_NO_ERROR;
188 state_ = STATE_READING_TAG; 188 state_ = STATE_READING_TAG;
189 } 189 }
190 190
191 } // namespace net 191 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/crypto/crypto_framer_test.cc » ('j') | net/quic/crypto/crypto_framer_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698