Remove dead code in AsyncSSLSocket
authorSubodh Iyengar <subodh@fb.com>
Wed, 27 Apr 2016 16:13:48 +0000 (09:13 -0700)
committerFacebook Github Bot 9 <facebook-github-bot-9-bot@fb.com>
Wed, 27 Apr 2016 16:20:21 +0000 (09:20 -0700)
Summary: Remove dead code in AsyncSSLSocket.

Reviewed By: knekritz

Differential Revision: D3226948

fb-gh-sync-id: e85823f311de2539c6aa2d6bcc3ff3aee07045bf
fbshipit-source-id: e85823f311de2539c6aa2d6bcc3ff3aee07045bf

folly/io/async/AsyncSSLSocket.cpp

index 7dc76a7f42284bfe911b9aa999a5fb196499c224..0decbbc8072c7f75def9a3150da930d5c9118a5a 100644 (file)
@@ -1392,15 +1392,6 @@ ssize_t AsyncSSLSocket::performWrite(const iovec* vec,
   bool cork = isSet(flags, WriteFlags::CORK);
   CorkGuard guard(fd_, count > 1, cork, &corked_);
 
-#if 0
-//#ifdef SSL_MODE_WRITE_IOVEC
-  if (ssl_->expand == nullptr &&
-      ssl_->compress == nullptr &&
-      (ssl_->mode & SSL_MODE_WRITE_IOVEC)) {
-    return performWriteIovec(vec, count, flags, countWritten, partialWritten);
-  }
-#endif
-
   // Declare a buffer used to hold small write requests.  It could point to a
   // memory block either on stack or on heap. If it is on heap, we release it
   // manually when scope exits
@@ -1516,44 +1507,6 @@ ssize_t AsyncSSLSocket::performWrite(const iovec* vec,
   return totalWritten;
 }
 
-#if 0
-//#ifdef SSL_MODE_WRITE_IOVEC
-ssize_t AsyncSSLSocket::performWriteIovec(const iovec* vec,
-                                          uint32_t count,
-                                          WriteFlags flags,
-                                          uint32_t* countWritten,
-                                          uint32_t* partialWritten) {
-  size_t tot = 0;
-  for (uint32_t j = 0; j < count; j++) {
-    tot += vec[j].iov_len;
-  }
-
-  ssize_t totalWritten = SSL_write_iovec(ssl_, vec, count);
-
-  *countWritten = 0;
-  *partialWritten = 0;
-  if (totalWritten <= 0) {
-    return interpretSSLError(totalWritten, SSL_get_error(ssl_, totalWritten));
-  } else {
-    ssize_t bytes = totalWritten, i = 0;
-    while (i < count && bytes >= (ssize_t)vec[i].iov_len) {
-      // we managed to write all of this buf
-      bytes -= vec[i].iov_len;
-      (*countWritten)++;
-      i++;
-    }
-    *partialWritten = bytes;
-
-    VLOG(4) << "SSL_write_iovec() writes " << tot
-            << ", returns " << totalWritten << " bytes"
-            << ", max_send_fragment=" << ssl_->max_send_fragment
-            << ", count=" << count << ", countWritten=" << *countWritten;
-
-    return totalWritten;
-  }
-}
-#endif
-
 int AsyncSSLSocket::eorAwareSSLWrite(SSL *ssl, const void *buf, int n,
                                       bool eor) {
   if (eor && SSL_get_wbio(ssl)->method == &eorAwareBioMethod) {