trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jplev...@apache.org
Subject svn commit: r962709 - in /trafficserver/traffic/trunk: example/cache_scan/cache_scan.cc proxy/InkAPI.cc proxy/PluginVC.cc proxy/PluginVC.h
Date Fri, 09 Jul 2010 22:12:25 GMT
Author: jplevyak
Date: Fri Jul  9 22:12:24 2010
New Revision: 962709

URL: http://svn.apache.org/viewvc?rev=962709&view=rev
Log:
TS-380: more 64 bit issues, this time in the PluginVC code

Modified:
    trafficserver/traffic/trunk/example/cache_scan/cache_scan.cc
    trafficserver/traffic/trunk/proxy/InkAPI.cc
    trafficserver/traffic/trunk/proxy/PluginVC.cc
    trafficserver/traffic/trunk/proxy/PluginVC.h

Modified: trafficserver/traffic/trunk/example/cache_scan/cache_scan.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/cache_scan/cache_scan.cc?rev=962709&r1=962708&r2=962709&view=diff
==============================================================================
--- trafficserver/traffic/trunk/example/cache_scan/cache_scan.cc (original)
+++ trafficserver/traffic/trunk/example/cache_scan/cache_scan.cc Fri Jul  9 22:12:24 2010
@@ -50,9 +50,9 @@ struct cache_scan_state_t
   INKAction pending_action;
   INKCacheKey key_to_delete;
 
-  int total_bytes;
+  INK64 total_bytes;
   int total_items;
-  int done;
+
   bool write_pending;
 };
 

Modified: trafficserver/traffic/trunk/proxy/InkAPI.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/InkAPI.cc?rev=962709&r1=962708&r2=962709&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/InkAPI.cc (original)
+++ trafficserver/traffic/trunk/proxy/InkAPI.cc Fri Jul  9 22:12:24 2010
@@ -7047,7 +7047,7 @@ INKCacheRemove(INKCont contp, INKCacheKe
 INKAction
 INKCacheScan(INKCont contp, INKCacheKey key, int KB_per_second)
 {
-  if ((sdk_sanity_check_iocore_structure(contp) != INK_SUCCESS) || (sdk_sanity_check_cachekey(key)
!= INK_SUCCESS))
+  if ((sdk_sanity_check_iocore_structure(contp) != INK_SUCCESS) || (key && sdk_sanity_check_cachekey(key)
!= INK_SUCCESS))
     return (INKAction) INK_ERROR_PTR;
 
   FORCE_PLUGIN_MUTEX(contp);

Modified: trafficserver/traffic/trunk/proxy/PluginVC.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/PluginVC.cc?rev=962709&r1=962708&r2=962709&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/PluginVC.cc (original)
+++ trafficserver/traffic/trunk/proxy/PluginVC.cc Fri Jul  9 22:12:24 2010
@@ -415,18 +415,18 @@ PluginVC::do_io_shutdown(ShutdownHowTo_t
 //
 // Returns number of bytes transfered
 //
-int
-PluginVC::transfer_bytes(MIOBuffer * transfer_to, IOBufferReader * transfer_from, int act_on)
+int64
+PluginVC::transfer_bytes(MIOBuffer * transfer_to, IOBufferReader * transfer_from, int64 act_on)
 {
 
-  int total_added = 0;
+  int64 total_added = 0;
 
   ink_debug_assert(act_on <= transfer_from->read_avail());
 
   while (act_on > 0) {
-    int block_read_avail = transfer_from->block_read_avail();
-    int to_move = MIN(act_on, block_read_avail);
-    int moved = 0;
+    int64 block_read_avail = transfer_from->block_read_avail();
+    int64 to_move = MIN(act_on, block_read_avail);
+    int64 moved = 0;
 
     if (to_move <= 0) {
       break;
@@ -495,14 +495,14 @@ PluginVC::process_write_side(bool other_
 
 
   // Check the state of our write buffer as well as ntodo
-  int ntodo = write_state.vio.ntodo();
+  int64 ntodo = write_state.vio.ntodo();
   if (ntodo == 0) {
     return;
   }
 
   IOBufferReader *reader = write_state.vio.get_reader();
-  int bytes_avail = reader->read_avail();
-  int act_on = MIN(bytes_avail, ntodo);
+  int64 bytes_avail = reader->read_avail();
+  int64 act_on = MIN(bytes_avail, ntodo);
 
   Debug("pvc", "[%u] %s: process_write_side; act_on %d", PVC_ID, PVC_TYPE, act_on);
 
@@ -522,14 +522,14 @@ PluginVC::process_write_side(bool other_
   // Bytes available, try to transfer to the PluginVCCore
   //   intermediate buffer
   //
-  int buf_space = PVC_DEFAULT_MAX_BYTES - core_buffer->max_read_avail();
+  int64 buf_space = PVC_DEFAULT_MAX_BYTES - core_buffer->max_read_avail();
   if (buf_space <= 0) {
     Debug("pvc", "[%u] %s: process_write_side no buffer space", PVC_ID, PVC_TYPE);
     return;
   }
   act_on = MIN(act_on, buf_space);
 
-  int added = transfer_bytes(core_buffer, reader, act_on);
+  int64 added = transfer_bytes(core_buffer, reader, act_on);
   if (added < 0) {
     // Couldn't actually get the buffer space.  This only
     //   happens on small transfers with the above
@@ -609,13 +609,13 @@ PluginVC::process_read_side(bool other_s
   need_read_process = false;
 
   // Check the state of our read buffer as well as ntodo
-  int ntodo = read_state.vio.ntodo();
+  int64 ntodo = read_state.vio.ntodo();
   if (ntodo == 0) {
     return;
   }
 
-  int bytes_avail = core_reader->read_avail();
-  int act_on = MIN(bytes_avail, ntodo);
+  int64 bytes_avail = core_reader->read_avail();
+  int64 act_on = MIN(bytes_avail, ntodo);
 
   Debug("pvc", "[%u] %s: process_read_side; act_on %d", PVC_ID, PVC_TYPE, act_on);
 
@@ -630,16 +630,16 @@ PluginVC::process_read_side(bool other_s
   //
   MIOBuffer *output_buffer = read_state.vio.get_writer();
 
-  int water_mark = output_buffer->water_mark;
+  int64 water_mark = output_buffer->water_mark;
   water_mark = MAX(water_mark, PVC_DEFAULT_MAX_BYTES);
-  int buf_space = water_mark - output_buffer->max_read_avail();
+  int64 buf_space = water_mark - output_buffer->max_read_avail();
   if (buf_space <= 0) {
     Debug("pvc", "[%u] %s: process_read_side no buffer space", PVC_ID, PVC_TYPE);
     return;
   }
   act_on = MIN(act_on, buf_space);
 
-  int added = transfer_bytes(output_buffer, core_reader, act_on);
+  int64 added = transfer_bytes(output_buffer, core_reader, act_on);
   if (added <= 0) {
     // Couldn't actually get the buffer space.  This only
     //   happens on small transfers with the above

Modified: trafficserver/traffic/trunk/proxy/PluginVC.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/PluginVC.h?rev=962709&r1=962708&r2=962709&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/PluginVC.h (original)
+++ trafficserver/traffic/trunk/proxy/PluginVC.h Fri Jul  9 22:12:24 2010
@@ -128,7 +128,7 @@ private:
   void setup_event_cb(ink_hrtime in, Event ** e_ptr);
 
   void update_inactive_time();
-  int transfer_bytes(MIOBuffer * transfer_to, IOBufferReader * transfer_from, int act_on);
+  int64 transfer_bytes(MIOBuffer * transfer_to, IOBufferReader * transfer_from, int64 act_on);
 
   uint32 magic;
   PluginVC_t vc_type;



Mime
View raw message