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

Unified Diff: webrtc/p2p/base/turnserver.cc

Issue 1821083002: Split ByteBuffer into writer/reader objects. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/p2p/base/turnserver.h ('k') | webrtc/p2p/stunprober/stunprober.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/turnserver.cc
diff --git a/webrtc/p2p/base/turnserver.cc b/webrtc/p2p/base/turnserver.cc
index 14dcf05e89453cc4571b766f2cbb63f4dd551f56..13974a0bd91e5f21147f7dbb122fd42b895c77f5 100644
--- a/webrtc/p2p/base/turnserver.cc
+++ b/webrtc/p2p/base/turnserver.cc
@@ -216,7 +216,7 @@ void TurnServer::OnInternalPacket(rtc::AsyncPacketSocket* socket,
void TurnServer::HandleStunMessage(TurnServerConnection* conn, const char* data,
size_t size) {
TurnMessage msg;
- rtc::ByteBuffer buf(data, size);
+ rtc::ByteBufferReader buf(data, size);
if (!msg.Read(&buf) || (buf.Length() > 0)) {
LOG(LS_WARNING) << "Received invalid STUN message";
return;
@@ -489,7 +489,7 @@ void TurnServer::SendErrorResponseWithAlternateServer(
}
void TurnServer::SendStun(TurnServerConnection* conn, StunMessage* msg) {
- rtc::ByteBuffer buf;
+ rtc::ByteBufferWriter buf;
// Add a SOFTWARE attribute if one is set.
if (!software_.empty()) {
VERIFY(msg->AddAttribute(
@@ -500,7 +500,7 @@ void TurnServer::SendStun(TurnServerConnection* conn, StunMessage* msg) {
}
void TurnServer::Send(TurnServerConnection* conn,
- const rtc::ByteBuffer& buf) {
+ const rtc::ByteBufferWriter& buf) {
rtc::PacketOptions options;
conn->socket()->SendTo(buf.Data(), buf.Length(), conn->src(), options);
}
@@ -794,7 +794,7 @@ void TurnServerAllocation::OnExternalPacket(
Channel* channel = FindChannel(addr);
if (channel) {
// There is a channel bound to this address. Send as a channel message.
- rtc::ByteBuffer buf;
+ rtc::ByteBufferWriter buf;
buf.WriteUInt16(channel->id());
buf.WriteUInt16(static_cast<uint16_t>(size));
buf.WriteBytes(data, size);
« no previous file with comments | « webrtc/p2p/base/turnserver.h ('k') | webrtc/p2p/stunprober/stunprober.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698