trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jplev...@apache.org
Subject svn commit: r897067 - in /incubator/trafficserver/traffic/branches/dev/iocore/net: I_NetVConnection.h UnixNetAccept.cc UnixNetVConnection.cc
Date Fri, 08 Jan 2010 00:39:46 GMT
Author: jplevyak
Date: Fri Jan  8 00:39:45 2010
New Revision: 897067

URL: http://svn.apache.org/viewvc?rev=897067&view=rev
Log:
TS-86: partial fix
in do_io_close, actually close the connection if possible causing
TCP/IP to push the waiting bits.
Also get the DetailedLog working and fix a spelling error.

Modified:
    incubator/trafficserver/traffic/branches/dev/iocore/net/I_NetVConnection.h
    incubator/trafficserver/traffic/branches/dev/iocore/net/UnixNetAccept.cc
    incubator/trafficserver/traffic/branches/dev/iocore/net/UnixNetVConnection.cc

Modified: incubator/trafficserver/traffic/branches/dev/iocore/net/I_NetVConnection.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/iocore/net/I_NetVConnection.h?rev=897067&r1=897066&r2=897067&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/iocore/net/I_NetVConnection.h (original)
+++ incubator/trafficserver/traffic/branches/dev/iocore/net/I_NetVConnection.h Fri Jan  8
00:39:45 2010
@@ -32,9 +32,9 @@
 #include "I_IOBuffer.h"
 #include "I_Socks.h"
 
-// #define WITH_DETTAILED_VCONNECTION_LOGGING 1
+// #define WITH_DETAILED_VCONNECTION_LOGGING 1
 
-#if WITH_DETTAILED_VCONNECTION_LOGGING
+#if WITH_DETAILED_VCONNECTION_LOGGING
 #include "DetailedLog.h"
 #endif
 
@@ -417,7 +417,7 @@
   /** Set remote sock addr struct. */
   virtual void set_remote_addr() = 0;
 
-#if WITH_DETTAILED_VCONNECTION_LOGGING
+#if WITH_DETAILED_VCONNECTION_LOGGING
   void loggingInit()
   {
     if (logging == NULL) {
@@ -457,8 +457,10 @@
   {
     return (logging != NULL);
   }
+  DetailedLog *logging;
 #else
   void addLogMessage(const char *message) {}
+  void loggingInit() {}
   bool loggingEnabled() const { return false; }
   ink_hrtime getLogsTotalTime() const { return 0; }
   void printLogs() const {}
@@ -466,12 +468,8 @@
 #endif
 
 private:
-    NetVConnection(const NetVConnection &);
+  NetVConnection(const NetVConnection &);
   NetVConnection & operator =(const NetVConnection &);
-#if WITH_DETTAILED_VCONNECTION_LOGGING
-  /** Used to queue up messages for the connection. */
-  DetailedLog *logging;
-#endif
 
 protected:
   struct sockaddr_in local_addr;
@@ -486,7 +484,7 @@
 VConnection(NULL),
 attributes(0),
 thread(NULL),
-#if WITH_DETTAILED_VCONNECTION_LOGGING
+#if WITH_DETAILED_VCONNECTION_LOGGING
 logging(NULL),
 #endif
 got_local_addr(0),

Modified: incubator/trafficserver/traffic/branches/dev/iocore/net/UnixNetAccept.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/iocore/net/UnixNetAccept.cc?rev=897067&r1=897066&r2=897067&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/iocore/net/UnixNetAccept.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/iocore/net/UnixNetAccept.cc Fri Jan  8 00:39:45
2010
@@ -406,7 +406,7 @@
     socklen_t sz = sizeof(vc->con.sa);
     int fd = socketManager.accept(server.fd, (struct sockaddr *) &vc->con.sa, &sz);
 
-    // vc->loggingInit(); // TODO add a configuration option for this
+    vc->loggingInit(); // TODO add a configuration option for this
 
     if (likely(fd >= 0)) {
       vc->addLogMessage("accepting the connection");

Modified: incubator/trafficserver/traffic/branches/dev/iocore/net/UnixNetVConnection.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/iocore/net/UnixNetVConnection.cc?rev=897067&r1=897066&r2=897067&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/iocore/net/UnixNetVConnection.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/iocore/net/UnixNetVConnection.cc Fri Jan
 8 00:39:45 2010
@@ -101,7 +101,7 @@
   if (vc->loggingEnabled()) {
     vc->addLogMessage("close_UnixNetVConnection");
     // display the slow log for the http client session
-    if (vc->getLogsTotalTime() / 1000000 > 30000)
+    if (vc->getLogsTotalTime() / HRTIME_MSECOND > 100)
       vc->printLogs();
     vc->clearLogs();
   }
@@ -305,13 +305,6 @@
       }
 
       if (!r || r == -ECONNRESET) {
-        // display the slow log for the http client session
-        if (vc->loggingEnabled()) {
-          if (vc->getLogsTotalTime() / 1000000 > 30000)
-            vc->printLogs();
-          vc->clearLogs();
-        }
-        // connection is closed
         vc->read.triggered = 0;
         nh->read_ready_list.remove(vc);
         read_signal_done(VC_EVENT_EOS, nh, vc);
@@ -582,14 +575,10 @@
 void
 UnixNetVConnection::do_io_close(int alerrno /* = -1 */ )
 {
-  if (loggingEnabled()) {
-    addLogMessage("UnixNetVConnection::do_io_close");
-    // display the slow log for the http client session
-    if (getLogsTotalTime() / 1000000 > 30000) {
-      printLogs();
-    }
-    clearLogs();
-  }
+  addLogMessage("UnixNetVConnection::do_io_close");
+
+  EThread *t = read.vio.mutex ? read.vio.mutex->thread_holding : write.vio.mutex->thread_holding;
+  ink_debug_assert(t);
 
   disable_read(this);
   disable_write(this);
@@ -607,6 +596,9 @@
     closed = 1;
   else
     closed = -1;
+
+  if (!recursion && nh->mutex->thread_holding == t)
+    close_UnixNetVConnection(this, t);
 }
 
 void



Mime
View raw message