Revision c6e2db2f

View differences:

src/node_crypto.cc
901 901

  
902 902

  
903 903
int Connection::HandleSSLError(const char* func, int rv, ZeroStatus zs) {
904
  // Forcibly clear OpenSSL's error stack on return. This stops stale errors
905
  // from popping up later in the lifecycle of the SSL connection where they
906
  // would cause spurious failures. It's a rather blunt method, though.
907
  // ERR_clear_error() isn't necessarily cheap either.
908
  struct ClearErrorOnReturn {
909
    ~ClearErrorOnReturn() { ERR_clear_error(); }
910
  };
911
  ClearErrorOnReturn clear_error_on_return;
912
  (void) &clear_error_on_return;  // Silence unused variable warning.
913

  
904 914
  if (rv > 0) return rv;
905 915
  if ((rv == 0) && (zs == kZeroIsNotAnError)) return rv;
906 916

  

Also available in: Unified diff