From e5dce2b6b9d7f542392c64dc71dc77c43744086a Mon Sep 17 00:00:00 2001 From: deadbeef Date: Fri, 2 Jun 2017 11:52:06 -0700 Subject: [PATCH] Replacing unnecessary conditional with DCHECK in OpenSSLAdapter Follow-up from https://codereview.webrtc.org/2915243002/ BUG=None TBR=pthatcher@webrtc.org Review-Url: https://codereview.webrtc.org/2917933003 Cr-Commit-Position: refs/heads/master@{#18418} --- webrtc/base/openssladapter.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/webrtc/base/openssladapter.cc b/webrtc/base/openssladapter.cc index fbab6c84ef..e1d0a5802e 100644 --- a/webrtc/base/openssladapter.cc +++ b/webrtc/base/openssladapter.cc @@ -565,8 +565,9 @@ OpenSSLAdapter::Send(const void* pv, size_t cb) { // buffer the data ourselves. When we know the underlying socket is writable // again from OnWriteEvent (or if Send is called again before that happens), // we'll retry sending this buffered data. - if ((error == SSL_ERROR_WANT_READ || error == SSL_ERROR_WANT_WRITE) && - pending_data_.empty()) { + if (error == SSL_ERROR_WANT_READ || error == SSL_ERROR_WANT_WRITE) { + // Shouldn't be able to get to this point if we already have pending data. + RTC_DCHECK(pending_data_.empty()); LOG(LS_WARNING) << "SSL_write couldn't write to the underlying socket; buffering data."; pending_data_.SetData(static_cast(pv), cb);