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

Side by Side Diff: webrtc/p2p/base/relayport.cc

Issue 2837133003: Don't crash if STUN error message is missing ERROR-CODE attribute. (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « webrtc/p2p/base/port.cc ('k') | webrtc/p2p/base/stun.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 #include <algorithm> 10 #include <algorithm>
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 } 817 }
818 818
819 // We will do a keep-alive regardless of whether this request suceeds. 819 // We will do a keep-alive regardless of whether this request suceeds.
820 // This should have almost no impact on network usage. 820 // This should have almost no impact on network usage.
821 entry_->ScheduleKeepAlive(); 821 entry_->ScheduleKeepAlive();
822 } 822 }
823 823
824 void AllocateRequest::OnErrorResponse(StunMessage* response) { 824 void AllocateRequest::OnErrorResponse(StunMessage* response) {
825 const StunErrorCodeAttribute* attr = response->GetErrorCode(); 825 const StunErrorCodeAttribute* attr = response->GetErrorCode();
826 if (!attr) { 826 if (!attr) {
827 LOG(INFO) << "Bad allocate response error code"; 827 LOG(LS_ERROR) << "Missing allocate response error code.";
828 } else { 828 } else {
829 LOG(INFO) << "Allocate error response:" 829 LOG(INFO) << "Allocate error response:"
830 << " code=" << attr->code() 830 << " code=" << attr->code()
831 << " reason='" << attr->reason() << "'"; 831 << " reason='" << attr->reason() << "'";
832 } 832 }
833 833
834 if (rtc::TimeMillis() - start_time_ <= kRetryTimeout) 834 if (rtc::TimeMillis() - start_time_ <= kRetryTimeout)
835 entry_->ScheduleKeepAlive(); 835 entry_->ScheduleKeepAlive();
836 } 836 }
837 837
838 void AllocateRequest::OnTimeout() { 838 void AllocateRequest::OnTimeout() {
839 LOG(INFO) << "Allocate request timed out"; 839 LOG(INFO) << "Allocate request timed out";
840 entry_->HandleConnectFailure(connection_->socket()); 840 entry_->HandleConnectFailure(connection_->socket());
841 } 841 }
842 842
843 } // namespace cricket 843 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/p2p/base/port.cc ('k') | webrtc/p2p/base/stun.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698