Remove unused parameter from crypto::Handle*Error
authorRyan Dahl <ry@tinyclouds.org>
Wed, 9 Feb 2011 09:30:31 +0000 (01:30 -0800)
committerRyan Dahl <ry@tinyclouds.org>
Wed, 9 Feb 2011 09:30:31 +0000 (01:30 -0800)
src/node_crypto.cc
src/node_crypto.h

index 9527424a0bd1986569f20ef99e63397122702422..bbc98c56c6c69ca23a78dfaca34d424ee09e0f7f 100644 (file)
@@ -294,10 +294,7 @@ Handle<Value> SecureContext::Close(const Arguments& args) {
 #endif
 
 
-int Connection::HandleBIOError(BIO *bio,
-                               const char* func,
-                               int rv,
-                               bool ignore_error) {
+int Connection::HandleBIOError(BIO *bio, const char* func, int rv) {
   if (rv >= 0) return rv;
 
   int retry = BIO_should_retry(bio);
@@ -314,11 +311,9 @@ int Connection::HandleBIOError(BIO *bio,
    static char ssl_error_buf[512];
     ERR_error_string_n(rv, ssl_error_buf, sizeof(ssl_error_buf));
 
-    if (!ignore_error) {
-      HandleScope scope;
-      Local<Value> e = Exception::Error(String::New(ssl_error_buf));
-      handle_->Set(String::New("error"), e);
-    }
+    HandleScope scope;
+    Local<Value> e = Exception::Error(String::New(ssl_error_buf));
+    handle_->Set(String::New("error"), e);
 
     DEBUG_PRINT("[%p] BIO: %s failed: (%d) %s\n", ssl_, func, rv, ssl_error_buf);
 
@@ -329,7 +324,7 @@ int Connection::HandleBIOError(BIO *bio,
 }
 
 
-int Connection::HandleSSLError(const char* func, int rv, bool ignore_error) {
+int Connection::HandleSSLError(const char* func, int rv) {
   if (rv >= 0) return rv;
 
   int err = SSL_get_error(ssl_, rv);
@@ -346,11 +341,9 @@ int Connection::HandleSSLError(const char* func, int rv, bool ignore_error) {
     static char ssl_error_buf[512];
     ERR_error_string_n(err, ssl_error_buf, sizeof(ssl_error_buf));
 
-    if (!ignore_error) {
-      HandleScope scope;
-      Local<Value> e = Exception::Error(String::New(ssl_error_buf));
-      handle_->Set(String::New("error"), e);
-    }
+    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);
 
@@ -659,7 +652,7 @@ Handle<Value> Connection::EncOut(const Arguments& args) {
 
   int bytes_read = BIO_read(ss->bio_write_, buffer_data + off, len);
 
-  ss->HandleBIOError(ss->bio_write_, "BIO_read:EncOut", bytes_read, true);
+  ss->HandleBIOError(ss->bio_write_, "BIO_read:EncOut", bytes_read);
   ss->SetShutdownFlags();
 
   return scope.Close(Integer::New(bytes_read));
index e67ca4e7828e48e289a61bc87a875c119a821a3c..a8032f2d055e361d8aea691e1480cf70893fa7e6 100644 (file)
@@ -74,8 +74,9 @@ class Connection : ObjectWrap {
   static v8::Handle<v8::Value> Start(const v8::Arguments& args);
   static v8::Handle<v8::Value> Close(const v8::Arguments& args);
 
-  int HandleBIOError(BIO *bio, const char* func, int rv, bool ignore_error=false);
-  int HandleSSLError(const char* func, int rv, bool ignore_error=false);
+  int HandleBIOError(BIO *bio, const char* func, int rv);
+  int HandleSSLError(const char* func, int rv);
+
   void ClearError();
   void SetShutdownFlags();