Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-09-16 01:56:12 +0400
committerRyan Dahl <ry@tinyclouds.org>2011-09-16 02:04:09 +0400
commit6312e889b1cd76fb5089056fd80f335319ad103e (patch)
tree20e17d54f493ef321657aacd8bf3113894553e72
parente06ce7562ca568ca9fa8072fbd554da4d20dc779 (diff)
Drain OpenSSL error queue? Addresses #1719
-rw-r--r--src/node_crypto.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index 0f148b4d350..a908f526bd5 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -504,11 +504,22 @@ int Connection::HandleSSLError(const char* func, int rv) {
static char ssl_error_buf[512];
ERR_error_string_n(err, ssl_error_buf, sizeof(ssl_error_buf));
+ // XXX We need to drain the error queue for this thread or else OpenSSL
+ // has the possibility of blocking connections? This problem is not well
+ // understood. And we should be somehow propigating these errors up
+ // into JavaScript. There is no test which demonstrates this problem.
+ // https://github.com/joyent/node/issues/1719
+ while ((err = ERR_get_error()) != 0) {
+ ERR_error_string_n(err, ssl_error_buf, sizeof(ssl_error_buf));
+ fprintf(stderr, "(node SSL) %s\n", ssl_error_buf);
+ }
+
HandleScope scope;
Local<Value> e = Exception::Error(String::New(ssl_error_buf));
handle_->Set(String::New("error"), e);
- DEBUG_PRINT("[%p] SSL: %s failed: (%d:%d) %s\n", ssl_, func, err, rv, ssl_error_buf);
+ DEBUG_PRINT("[%p] SSL: %s failed: (%d:%d) %s\n", ssl_, func, err, rv,
+ ssl_error_buf);
return rv;
}