trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jplev...@apache.org
Subject svn commit: r942179 - in /trafficserver/traffic/trunk: iocore/cluster/ iocore/net/ proxy/http2/
Date Fri, 07 May 2010 18:56:34 GMT
Author: jplevyak
Date: Fri May  7 18:56:33 2010
New Revision: 942179

URL: http://svn.apache.org/viewvc?rev=942179&view=rev
Log:
TS-273: SSL not working, fixed problem with virtual function not being found
and assorted cruft.

Modified:
    trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc
    trafficserver/traffic/trunk/iocore/net/I_NetVConnection.h
    trafficserver/traffic/trunk/iocore/net/NetVConnection.cc
    trafficserver/traffic/trunk/iocore/net/P_SSLNetVConnection.h
    trafficserver/traffic/trunk/iocore/net/P_UnixNetVConnection.h
    trafficserver/traffic/trunk/iocore/net/SSLNetVConnection.cc
    trafficserver/traffic/trunk/proxy/http2/HttpClientSession.cc
    trafficserver/traffic/trunk/proxy/http2/HttpSessionManager.cc

Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc?rev=942179&r1=942178&r2=942179&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc Fri May  7 18:56:33 2010
@@ -365,7 +365,6 @@ ClusterState::build_do_io_vector()
 #define REENABLE_IO() \
   if (!ch->on_stolen_thread && !io_complete) { \
     v->reenable_re(); \
-    ch->net_vc->boost(); \
   }
 
 #else // !CLUSTER_TOMCAT

Modified: trafficserver/traffic/trunk/iocore/net/I_NetVConnection.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/I_NetVConnection.h?rev=942179&r1=942178&r2=942179&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/I_NetVConnection.h (original)
+++ trafficserver/traffic/trunk/iocore/net/I_NetVConnection.h Fri May  7 18:56:33 2010
@@ -49,12 +49,6 @@ enum NetDataType
   NET_DATA_ATTRIBUTES = VCONNECTION_NET_DATA_BASE
 };
 
-/* can this be moved to NT files */
-enum
-{ IOCORE_NETVC_MAGIC_ALIVE = 0x0000BEEF,
-  IOCORE_NETVC_MAGIC_DEAD = 0xDEADBEEF
-};
-
 /**
   Holds user options for NetVConnection. This class holds various
   options a user can specify for NetVConnection. Right now this
@@ -94,10 +88,7 @@ enum
   rest get sensible default values.
 
 */
-class NetVCOptions
-{
-
-public:
+struct NetVCOptions {
   int local_port;
 
   inku32 spoof_ip;
@@ -116,11 +107,9 @@ public:
   void set_sock_param(int _recv_bufsize, int _send_bufsize, unsigned long _opt_flags);
 
 
-    NetVCOptions()
-  {
+  NetVCOptions() {
     reset();
   }
-
   /* Add more options here instead of adding them to connect_re() args etc */
 };
 
@@ -345,13 +334,6 @@ public:
   /** @return current inactivity_timeout value in nanosecs */
   virtual ink_hrtime get_inactivity_timeout() = 0;
 
-  /**
-    Boosts the priority of the VConnection. Used by SM to indicate
-    that the connection is likely to be actively used soon.
-
-  */
-  virtual void boost();
-
   /** Returns local sockaddr in. */
   const struct sockaddr_in &get_local_addr();
 
@@ -391,7 +373,7 @@ public:
   virtual void reenable_re(VIO * vio) = 0;
 
   /// PRIVATE
-    virtual ~ NetVConnection();
+  virtual ~NetVConnection() {}
 
   /**
     PRIVATE: instances of NetVConnection cannot be created directly
@@ -400,16 +382,9 @@ public:
     just to avoid compile errors.
 
   */
-    NetVConnection();
-
-  /// PRIVATE: SSL specific stuff 
-  virtual bool is_over_ssl() = 0;
+  NetVConnection();
 
-  /// NOT IMPLEMENTED
-  virtual SOCKET get_socket();
-
-  /// NOT IMPLEMENTED
-  virtual int get_last_error();
+  virtual SOCKET get_socket() = 0;
 
   /** Set local sock addr struct. */
   virtual void set_local_addr() = 0;
@@ -417,6 +392,7 @@ public:
   /** Set remote sock addr struct. */
   virtual void set_remote_addr() = 0;
 
+  // for InkAPI
   bool get_is_internal_request() const {
     return is_internal_request;
   }
@@ -493,22 +469,18 @@ protected:
 
 inline
 NetVConnection::NetVConnection():
-VConnection(NULL),
-attributes(0),
-thread(NULL),
+  VConnection(NULL),
+  attributes(0),
+  thread(NULL),
 #if WITH_DETAILED_VCONNECTION_LOGGING
-logging(NULL),
+  logging(NULL),
 #endif
-got_local_addr(0),
-got_remote_addr(0),
-is_internal_request(false)
+  got_local_addr(0),
+  got_remote_addr(0),
+  is_internal_request(false)
 {
   memset(&local_addr, 0, sizeof(local_addr));
   memset(&remote_addr, 0, sizeof(remote_addr));
 }
 
-#if defined (_IOCORE_WIN32_WINNT)
-#include "NTNetVConnection.h"
-#endif
-
 #endif

Modified: trafficserver/traffic/trunk/iocore/net/NetVConnection.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/NetVConnection.cc?rev=942179&r1=942178&r2=942179&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/NetVConnection.cc (original)
+++ trafficserver/traffic/trunk/iocore/net/NetVConnection.cc Fri May  7 18:56:33 2010
@@ -44,25 +44,3 @@ NetVConnection::cancel_OOB()
   return;
 }
 
-int
-NetVConnection::get_last_error()
-{
-  return 0;
-}
-
-
-void
-NetVConnection::boost()
-{
-}
-
-NetVConnection::~NetVConnection()
-{
-}
-
-SOCKET
-NetVConnection::get_socket()
-{
-  ink_release_assert(!"Not Implemented");
-  return (SOCKET) 0;
-}

Modified: trafficserver/traffic/trunk/iocore/net/P_SSLNetVConnection.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/P_SSLNetVConnection.h?rev=942179&r1=942178&r2=942179&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/P_SSLNetVConnection.h (original)
+++ trafficserver/traffic/trunk/iocore/net/P_SSLNetVConnection.h Fri May  7 18:56:33 2010
@@ -79,10 +79,7 @@ public:
   int write_want_syscal;
   int write_want_x509;
   int write_error_zero;
-  virtual bool is_over_ssl()
-  {
-    return (true);
-  }
+
   virtual int sslStartHandShake(int event, int &err);
   virtual void free(EThread * t);
   virtual void enableRead()
@@ -90,14 +87,9 @@ public:
     read.enabled = 1;
     write.enabled = 1;
   };
-//  virtual int  loadBufferAndCallRead (int toread, int &rattempted,
-//                                                                        int &total_read,
MIOBufferAccessor &buf);
-
-  virtual int loadBufferAndCallWrite(int towrite, int &wattempted, int &total_wrote,
MIOBufferAccessor & buf);
-
   virtual bool getSSLHandShakeComplete()
   {
-    return (sslHandShakeComplete);
+    return sslHandShakeComplete;
   };
   void setSSLHandShakeComplete(bool state)
   {
@@ -105,7 +97,7 @@ public:
   };
   virtual bool getSSLClientConnection()
   {
-    return (sslClientConnection);
+    return sslClientConnection;
   };
   virtual void setSSLClientConnection(bool state)
   {
@@ -113,14 +105,9 @@ public:
   };
   int sslServerHandShakeEvent(int &err);
   int sslClientHandShakeEvent(int &err);
-//  virtual void readInternalSSLBuffers (int &r, int toread, int &rattempted,
-//                                                                         int &total_read,
MIOBufferAccessor &buf, 
-//                                                                         NetHandler * nh);
-
   virtual void net_read_io(NetHandler * nh, EThread * lthread);
-
-  virtual ~ SSLNetVConnection() {
-  };
+  virtual ink64 load_buffer_and_write(ink64 towrite, ink64 &wattempted, ink64 &total_wrote,
MIOBufferAccessor & buf);
+  virtual ~ SSLNetVConnection() { }
   ////////////////////////////////////////////////////////////
   // instances of NetVConnection should be allocated        //
   // only from the free list using NetVConnection::alloc(). //

Modified: trafficserver/traffic/trunk/iocore/net/P_UnixNetVConnection.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/P_UnixNetVConnection.h?rev=942179&r1=942178&r2=942179&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/P_UnixNetVConnection.h (original)
+++ trafficserver/traffic/trunk/iocore/net/P_UnixNetVConnection.h Fri May  7 18:56:33 2010
@@ -92,7 +92,6 @@ public:
   virtual Action *send_OOB(Continuation *cont, char *buf, int len);
   virtual void cancel_OOB();
 
-  virtual bool is_over_ssl() { return (false); }
   virtual void setSSLHandshakeWantsRead(bool flag) { return; }
   virtual bool getSSLHandshakeWantsRead() { return false; }
   virtual void setSSLHandshakeWantsWrite(bool flag) { return; }
@@ -123,10 +122,7 @@ public:
   virtual void reenable(VIO *vio);
   virtual void reenable_re(VIO *vio);
 
-  virtual SOCKET get_socket()
-  {
-    return con.fd;
-  }
+  virtual SOCKET get_socket();
 
   virtual ~ UnixNetVConnection();
 
@@ -342,11 +338,11 @@ UnixNetVConnection::cancel_active_timeou
   }
 }
 
-TS_INLINE
-UnixNetVConnection::~
-UnixNetVConnection()
-{
-  return;
+TS_INLINE UnixNetVConnection::~UnixNetVConnection() { }
+
+TS_INLINE SOCKET
+UnixNetVConnection::get_socket() {
+  return con.fd;
 }
 
 // declarations for local use (within the net module)

Modified: trafficserver/traffic/trunk/iocore/net/SSLNetVConnection.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/SSLNetVConnection.cc?rev=942179&r1=942178&r2=942179&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/SSLNetVConnection.cc (original)
+++ trafficserver/traffic/trunk/iocore/net/SSLNetVConnection.cc Fri May  7 18:56:33 2010
@@ -77,8 +77,7 @@ ssl_read_from_net(NetHandler * nh, UnixN
     Debug("ssl", "[SSL_NetVConnection::ssl_read_from_net] b->write_avail()=%d", block_write_avail);
 
     int offset = 0;
-// while can be replaced with if - need to test what works faster with openssl
-//        if( block_write_avail > 0 ) 
+    // while can be replaced with if - need to test what works faster with openssl
     while (block_write_avail > 0) {
       sslvc->read_calls++;
       int rres = SSL_read(sslvc->ssl, b->end() + offset, block_write_avail);
@@ -122,11 +121,14 @@ ssl_read_from_net(NetHandler * nh, UnixN
         Debug("ssl", "[SSL_NetVConnection::ssl_read_from_net] SSL_ERROR_ZERO_RETURN");
         break;
       case SSL_ERROR_SSL:
-      default:
+      default: {
+        char err_string[4096];
+        ERR_error_string(ERR_get_error(), err_string);
         event = SSL_READ_ERROR;
         ret = errno;
-        Error("[SSL_NetVConnection::ssl_read_from_net] SSL_ERROR_SSL");
+        Error("[SSL_NetVConnection::ssl_read_from_net] SSL_ERROR_SSL %s", err_string);
         break;
+      }
       }                         // switch
       break;
     }                           // while( block_write_avail > 0 )
@@ -150,7 +152,6 @@ ssl_read_from_net(NetHandler * nh, UnixN
 #if defined (_DEBUG)
     if (readAvail == 0) {
       Debug("ssl", "[SSL_NetVConnection::ssl_read_from_net] readAvail == 0");
-//            event = VC_EVENT_EOS;
     }
 #endif
   }
@@ -281,17 +282,13 @@ SSLNetVConnection::net_read_io(NetHandle
 }
 
 
-int
-SSLNetVConnection::loadBufferAndCallWrite(int towrite, int &wattempted, int &total_wrote,
MIOBufferAccessor & buf)
-{
+ink64 SSLNetVConnection::load_buffer_and_write(ink64 towrite, ink64 &wattempted, ink64
&total_wrote, MIOBufferAccessor & buf) {
   ProxyMutex *mutex = this_ethread()->mutex;
   int r = 0;
-  int l = 0;
+  ink64 l = 0;
   int offset = buf.entry->start_offset;
   IOBufferBlock *b = buf.entry->block;
 
-
-
   do {
     // check if we have done this block
     l = b->read_avail();
@@ -302,13 +299,11 @@ SSLNetVConnection::loadBufferAndCallWrit
       continue;
     }
     // check if to amount to write exceeds that in this buffer
-    int wavail = towrite - total_wrote;
-    if (l > wavail) {
+    ink64 wavail = towrite - total_wrote;
+    if (l > wavail)
       l = wavail;
-    }
-    if (!l) {
+    if (!l)
       break;
-    }
     wattempted = l;
     total_wrote += l;
     Debug("ssl", "SSLNetVConnection::loadBufferAndCallWrite, before do_SSL_write, l = %d,
towrite = %d, b = %x", l,
@@ -357,7 +352,6 @@ SSLNetVConnection::loadBufferAndCallWrit
     default:
       r = -errno;
       Debug("ssl", "SSL_write-SSL_ERROR_SSL");
-      //SSLNetProcessor::logSSLError("SSL_write", 0);
       SSLNetProcessor::logSSLError("SSL_write");
       break;
     }
@@ -366,35 +360,34 @@ SSLNetVConnection::loadBufferAndCallWrit
 }
 
 SSLNetVConnection::SSLNetVConnection():
-connect_calls(0),
-connect_want_write(0),
-connect_want_read(0),
-connect_want_connect(0),
-connect_want_ssl(0),
-connect_want_syscal(0),
-connect_want_accept(0),
-connect_want_x509(0),
-connect_error_zero(0),
-accept_calls(0),
-read_calls(0),
-read_want_write(0),
-read_want_read(0),
-read_want_ssl(0),
-read_want_syscal(0),
-read_want_x509(0),
-read_error_zero(0),
-write_calls(0),
-write_want_write(0),
-write_want_read(0),
-write_want_ssl(0),
-write_want_syscal(0), write_want_x509(0), write_error_zero(0), sslHandShakeComplete(false),
sslClientConnection(false)
+  connect_calls(0),
+  connect_want_write(0),
+  connect_want_read(0),
+  connect_want_connect(0),
+  connect_want_ssl(0),
+  connect_want_syscal(0),
+  connect_want_accept(0),
+  connect_want_x509(0),
+  connect_error_zero(0),
+  accept_calls(0),
+  read_calls(0),
+  read_want_write(0),
+  read_want_read(0),
+  read_want_ssl(0),
+  read_want_syscal(0),
+  read_want_x509(0),
+  read_error_zero(0),
+  write_calls(0),
+  write_want_write(0),
+  write_want_read(0),
+  write_want_ssl(0),
+  write_want_syscal(0), write_want_x509(0), write_error_zero(0), sslHandShakeComplete(false),
sslClientConnection(false)
 {
   ssl = NULL;
 }
 
 void
-SSLNetVConnection::free(EThread * t)
-{
+SSLNetVConnection::free(EThread * t) {
   ProxyMutex *mutex = t->mutex;
   NET_DECREMENT_DYN_STAT(net_connections_currently_open_stat);
   got_remote_addr = 0;
@@ -407,8 +400,6 @@ SSLNetVConnection::free(EThread * t)
   SET_CONTINUATION_HANDLER(this, (SSLNetVConnHandler) & SSLNetVConnection::startEvent);
   ink_assert(con.fd == NO_FD);
   nh = NULL;
-  //printf("total %d read calls for this connection fd: %d\n", read_calls, con.fd); 
-  //printf("total %d write calls for this connection fd:  %d\n", write_calls, con.fd); 
   read_calls = 0;
   write_calls = 0;
   connect_calls = 0;
@@ -511,7 +502,6 @@ SSLNetVConnection::sslServerHandShakeEve
 */
       X509_free(client_cert);
     }
-    //printf("ssl accept successful after %d calls for fd %d\n", accept_calls,con.fd);
     sslHandShakeComplete = 1;
 
     return EVENT_DONE;
@@ -546,7 +536,6 @@ SSLNetVConnection::sslServerHandShakeEve
   default:
     err = errno;
     Debug("ssl", "SSLNetVConnection::sslServerHandShakeEvent, error");
-    //SSLNetProcessor::logSSLError("SSL_ServerHandShake", 0);
     SSLNetProcessor::logSSLError("SSL_ServerHandShake");
     return EVENT_ERROR;
     break;
@@ -579,8 +568,6 @@ SSLNetVConnection::sslClientHandShakeEve
 */
 
     X509_free(server_cert);
-//          printf("ssl connect successful after %d calls for fd: %d\n",connect_calls, con.fd);
-    //         printf("connect errors connect_want_write %d , connect_want_read %d ,connect_want_x509
%d,connect_want_accept %d,connect_want_connect %d,connect_error_zero %d,connect_want_syscal
%d,connect_want_ssl %d\n",connect_want_write,connect_want_read,connect_want_x509,connect_want_accept,connect_want_connect,connect_error_zero,connect_want_syscal,connect_want_ssl);
     sslHandShakeComplete = 1;
 
     return EVENT_DONE;
@@ -623,7 +610,6 @@ SSLNetVConnection::sslClientHandShakeEve
   default:
     connect_want_ssl++;
     err = errno;
-    //SSLNetProcessor::logSSLError("sslClientHandShakeEvent", 0);
     SSLNetProcessor::logSSLError("sslClientHandShakeEvent");
     return EVENT_ERROR;
     break;

Modified: trafficserver/traffic/trunk/proxy/http2/HttpClientSession.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpClientSession.cc?rev=942179&r1=942178&r2=942179&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpClientSession.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpClientSession.cc Fri May  7 18:56:33 2010
@@ -585,8 +585,6 @@ HttpClientSession::release(IOBufferReade
   HTTP_DECREMENT_DYN_STAT(http_current_client_transactions_stat);
   client_trans_stat--;
 
-  client_vc->boost();
-
   // Check to see there is remaining data in the
   //  buffer.  If there is, spin up a new state
   //  machine to process it.  Otherwise, issue an

Modified: trafficserver/traffic/trunk/proxy/http2/HttpSessionManager.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpSessionManager.cc?rev=942179&r1=942178&r2=942179&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpSessionManager.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpSessionManager.cc Fri May  7 18:56:33 2010
@@ -200,7 +200,6 @@ HttpSessionManager::acquire_session(Cont
         Debug("http_ss", "[%lld] [acquire session] returning attached session ", to_return->con_id);
         to_return->state = HSS_ACTIVE;
         sm->attach_server_session(to_return);
-        to_return->get_netvc()->boost();
         return HSM_DONE;
       }
     }
@@ -255,7 +254,6 @@ HttpSessionManager::acquire_session(Cont
           to_return = b;
           Debug("http_ss", "[%lld] [acquire session] " "return session from shared pool",
to_return->con_id);
           sm->attach_server_session(to_return);
-          to_return->get_netvc()->boost();
           return HSM_DONE;
         }
       }



Mime
View raw message