]> git.pld-linux.org Git - packages/apache-mod_bw.git/commitdiff
- new (fixes build with apr 1.0)
authorAdam Gołębiowski <adamg@pld-linux.org>
Sat, 12 Mar 2005 14:49:13 +0000 (14:49 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    apache-mod_bw-apr_1.0.patch -> 1.1

apache-mod_bw-apr_1.0.patch [new file with mode: 0644]

diff --git a/apache-mod_bw-apr_1.0.patch b/apache-mod_bw-apr_1.0.patch
new file mode 100644 (file)
index 0000000..8e35aa9
--- /dev/null
@@ -0,0 +1,73 @@
+diff -burN bw_mod-0.6.orig/bw_mod-0.6.c bw_mod-0.6/bw_mod-0.6.c
+--- bw_mod-0.6.orig/bw_mod-0.6.c       2005-03-12 14:28:51.665241352 +0100
++++ bw_mod-0.6/bw_mod-0.6.c    2005-03-12 14:32:46.305570600 +0100
+@@ -510,7 +510,7 @@
+     nowtime = apr_time_now();
+     if ( bwstat->time < (nowtime - 1000000) ) {
+       /* And if we got lock */
+-      if ( apr_atomic_cas( &bwstat->lock, 1, 0 ) == 0 ) {
++      if ( apr_atomic_cas32( &bwstat->lock, 1, 0 ) == 0 ) {
+         /* Calculate bw used in the last timeinterval */
+         bwstat->bandwidth = ( bwstat->bytes_count / (double)(nowtime - bwstat->time)) * 1000000 ;
+@@ -522,7 +522,7 @@
+         bwstat->time = apr_time_now();
+           
+         /* Release lock */
+-        apr_atomic_set( &bwstat->lock, 0 );
++        apr_atomic_set32( &bwstat->lock, 0 );
+      }
+   }    
+ }   
+@@ -653,7 +653,7 @@
+   else             bwmaxconn = bwstat;
+  
+   /* Add 1 active connection to the record */
+-  apr_atomic_inc( &bwmaxconn->connection_count );
++  apr_atomic_inc32( &bwmaxconn->connection_count );
+   /* Verbose Output */
+   if (sconf->debug == BANDWIDTH_ENABLED) {
+@@ -682,7 +682,7 @@
+       ap_pass_brigade(f->next, ctx->bb);
+       /* Delete 1 active connection */
+-      apr_atomic_dec( &bwmaxconn->connection_count );
++      apr_atomic_dec32( &bwmaxconn->connection_count );
+       return APR_SUCCESS; 
+     }
+@@ -750,14 +750,14 @@
+         b = APR_BRIGADE_FIRST(bb);
+         /* Add the number of bytes transferred, so we can get an estimated bw usage */
+-        apr_atomic_add( &bwstat->bytes_count, packet);
++        apr_atomic_add32( &bwstat->bytes_count, packet);
+         /* If the connection goes to hell... go with it ! */
+         if (r->connection->aborted) { 
+           /* Verbose. Tells when the connection was ended */
+           if (sconf->debug == BANDWIDTH_ENABLED) 
+             ap_log_error(APLOG_MARK, APLOG_NOTICE|APLOG_NOERRNO, 0,NULL,"[W] Connection to hell"); 
+-          apr_atomic_dec( &bwmaxconn->connection_count ); 
++          apr_atomic_dec32( &bwmaxconn->connection_count ); 
+           return APR_SUCCESS; 
+         }
+@@ -774,14 +774,14 @@
+     b = APR_BRIGADE_FIRST(bb);
+     /* Add the number of bytes to the counter */
+-    apr_atomic_add( &bwstat->bytes_count, bytes);
++    apr_atomic_add32( &bwstat->bytes_count, bytes);
+       
+     /* Pass the final brigade */
+     ap_pass_brigade(f->next, ctx->bb);
+   }
+   /* Delete 1 active connection to the record */
+-  apr_atomic_dec( &bwmaxconn->connection_count );
++  apr_atomic_dec32( &bwmaxconn->connection_count );
+   /* Verbose, tells when we ended the Filter */
+   if (sconf->debug == BANDWIDTH_ENABLED) 
This page took 0.086345 seconds and 4 git commands to generate.