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

Unified Diff: webrtc/base/openssladapter.h

Issue 2915243002: Fixing SSL error that occurs when underlying socket is blocked. (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | webrtc/base/openssladapter.cc » ('j') | webrtc/base/openssladapter.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/openssladapter.h
diff --git a/webrtc/base/openssladapter.h b/webrtc/base/openssladapter.h
index 554627f58fa7dfe66a10a2abf2256c874b05b4a0..a2f3d30c8818507f5e8981a36786b5ef2de25c27 100644
--- a/webrtc/base/openssladapter.h
+++ b/webrtc/base/openssladapter.h
@@ -12,6 +12,7 @@
#define WEBRTC_BASE_OPENSSLADAPTER_H__
#include <string>
+#include "webrtc/base/buffer.h"
#include "webrtc/base/messagehandler.h"
#include "webrtc/base/messagequeue.h"
#include "webrtc/base/ssladapter.h"
@@ -65,6 +66,9 @@ private:
void Error(const char* context, int err, bool signal = true);
void Cleanup();
+ // Return value and arguments have the same meanings as for Send.
+ int DoSslWrite(const void* pv, size_t cb);
+
void OnMessage(Message* msg) override;
static bool VerifyServerName(SSL* ssl, const char* host,
@@ -86,6 +90,11 @@ private:
// If true, socket will retain SSL configuration after Close.
bool restartable_;
+ // Set to true if SSL_write fails with SSL_ERROR_WANT_WRITE, which means we
+ // need to keep retrying with *the same exact data* until it succeeds.
+ bool pending_write_ = false;
+ Buffer pending_data_;
pthatcher1 2017/06/02 04:58:21 Why do we need both? Can't the non-emptiness of p
Taylor Brandstetter 2017/06/02 06:49:14 Sure, done.
+
SSL* ssl_;
SSL_CTX* ssl_ctx_;
std::string ssl_host_name_;
« no previous file with comments | « no previous file | webrtc/base/openssladapter.cc » ('j') | webrtc/base/openssladapter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698