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

Unified Diff: webrtc/base/openssladapter.h

Issue 2915243002: Fixing SSL error that occurs when underlying socket is blocked. (Closed)
Patch Set: Send an additional message while socket is blocked. 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..2f0150f0f9a2fd6ff8d4bfaf2bbf41a0235a9875 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,10 @@ private:
void Error(const char* context, int err, bool signal = true);
void Cleanup();
+ // Return value and arguments have the same meanings as for Send; |error| is
+ // an output parameter filled with the result of SSL_get_error.
+ int DoSslWrite(const void* pv, size_t cb, int* error);
+
void OnMessage(Message* msg) override;
static bool VerifyServerName(SSL* ssl, const char* host,
@@ -86,6 +91,11 @@ private:
// If true, socket will retain SSL configuration after Close.
bool restartable_;
+ // This buffer is used if SSL_write fails with SSL_ERROR_WANT_WRITE, which
+ // means we need to keep retrying with *the same exact data* until it
+ // succeeds. Afterwards it will be cleared.
+ Buffer pending_data_;
+
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