You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2010/05/18 01:11:40 UTC

svn commit: r945419 - in /trafficserver/traffic/trunk: iocore/eventsystem/I_IOBuffer.h libinktomi++/ink_platform.h libinktomi++/ink_port.h proxy/hdrs/MIME.cc proxy/http2/HttpSM.cc proxy/http2/HttpTransact.cc

Author: zwoop
Date: Mon May 17 23:11:39 2010
New Revision: 945419

URL: http://svn.apache.org/viewvc?rev=945419&view=rev
Log:
TS-34: Did a minor cleanup of our usage of MAXINT vs INT_MAX, while starting working on this issue. I don't think this should break on any platforms, since MAXINT is no longer used anywhere in the source.

Modified:
    trafficserver/traffic/trunk/iocore/eventsystem/I_IOBuffer.h
    trafficserver/traffic/trunk/libinktomi++/ink_platform.h
    trafficserver/traffic/trunk/libinktomi++/ink_port.h
    trafficserver/traffic/trunk/proxy/hdrs/MIME.cc
    trafficserver/traffic/trunk/proxy/http2/HttpSM.cc
    trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc

Modified: trafficserver/traffic/trunk/iocore/eventsystem/I_IOBuffer.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/eventsystem/I_IOBuffer.h?rev=945419&r1=945418&r2=945419&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/eventsystem/I_IOBuffer.h (original)
+++ trafficserver/traffic/trunk/iocore/eventsystem/I_IOBuffer.h Mon May 17 23:11:39 2010
@@ -874,8 +874,8 @@ public:
 
   /**
     Add by data from IOBufferReader r to the this buffer by reference. If
-    len is MAXINT, all available data on the reader is added. If len is
-    less than MAXINT, the smaller of len or the amount of data on the
+    len is INT_MAX, all available data on the reader is added. If len is
+    less than INT_MAX, the smaller of len or the amount of data on the
     buffer is added. If offset is greater than zero, than the offset
     bytes of data at the front of the reader are skipped. Bytes skipped
     by offset reduce the number of bytes available on the reader used

Modified: trafficserver/traffic/trunk/libinktomi++/ink_platform.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/libinktomi%2B%2B/ink_platform.h?rev=945419&r1=945418&r2=945419&view=diff
==============================================================================
--- trafficserver/traffic/trunk/libinktomi++/ink_platform.h (original)
+++ trafficserver/traffic/trunk/libinktomi++/ink_platform.h Mon May 17 23:11:39 2010
@@ -193,10 +193,6 @@ typedef unsigned int in_addr_t;
 #include <sys/sysmacros.h>
 #endif
 
-#ifndef MAXINT
-#define MAXINT INT_MAX
-#endif
-
 #ifndef PATH_NAME_MAX
 #define PATH_NAME_MAX 511 // instead of PATH_MAX which is inconsistent
                           // on various OSs (linux-4096,osx/bsd-1024,

Modified: trafficserver/traffic/trunk/libinktomi++/ink_port.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/libinktomi%2B%2B/ink_port.h?rev=945419&r1=945418&r2=945419&view=diff
==============================================================================
--- trafficserver/traffic/trunk/libinktomi++/ink_port.h (original)
+++ trafficserver/traffic/trunk/libinktomi++/ink_port.h Mon May 17 23:11:39 2010
@@ -90,7 +90,6 @@ typedef off_t ink_off_t;
 
 #if (HOST_OS == freebsd)
 #define NO_MEMALIGN
-#define MAXINT INT_MAX
 #endif
 
 #if (HOST_OS == darwin)

Modified: trafficserver/traffic/trunk/proxy/hdrs/MIME.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/hdrs/MIME.cc?rev=945419&r1=945418&r2=945419&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/hdrs/MIME.cc (original)
+++ trafficserver/traffic/trunk/proxy/hdrs/MIME.cc Mon May 17 23:11:39 2010
@@ -4206,10 +4206,10 @@ MIMEHdrImpl::recompute_cooked_stuff(MIME
                   m_cooked_stuff.m_cache_control.m_secs_s_maxage = value;
               } else {
 #if TRACK_COOKING
-                Debug("http", "                        set integer value %d\n", MAXINT);
+                Debug("http", "                        set integer value %d\n", INT_MAX);
 #endif
                 if (token_wks == MIME_VALUE_MAX_STALE)
-                  m_cooked_stuff.m_cache_control.m_secs_max_stale = MAXINT;
+                  m_cooked_stuff.m_cache_control.m_secs_max_stale = INT_MAX;
               }
             }
           }

Modified: trafficserver/traffic/trunk/proxy/http2/HttpSM.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpSM.cc?rev=945419&r1=945418&r2=945419&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpSM.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpSM.cc Mon May 17 23:11:39 2010
@@ -5931,7 +5931,7 @@ int
 HttpSM::server_transfer_init(MIOBuffer * buf, int hdr_size)
 {
   int nbytes;
-  int to_copy = MAXINT;
+  int to_copy = INT_MAX;
 
   if (server_entry->eos == true) {
     // The server has shutdown on us already so the only data

Modified: trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc?rev=945419&r1=945418&r2=945419&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc Mon May 17 23:11:39 2010
@@ -5924,11 +5924,11 @@ HttpTransact::handle_trace_and_options_r
     return TRUE;
   } else {                      /* max-forwards != 0 */
 
-    if ((max_forwards <= 0) || (max_forwards > MAXINT)) {
+    if ((max_forwards <= 0) || (max_forwards > INT_MAX)) {
       if (!s->traffic_net_req) {
-        Log::error("HTTP: snapping invalid max-forwards value %d to %d", max_forwards, MAXINT);
+        Log::error("HTTP: snapping invalid max-forwards value %d to %d", max_forwards, INT_MAX);
       }
-      max_forwards = MAXINT;
+      max_forwards = INT_MAX;
     }
 
     --max_forwards;
@@ -8024,7 +8024,7 @@ HttpTransact::Freshness_t HttpTransact::
       } else {
         int max_stale_val = client_request->get_cooked_cc_max_stale();
 
-        if (max_stale_val != MAXINT)
+        if (max_stale_val != INT_MAX)
           age_limit += max_stale_val;
         else
           age_limit = max_stale_val;