]> git.pld-linux.org Git - packages/apache-mod_bw.git/blob - apache-mod_bw-apr_1.0.patch
- orphaned, outdated
[packages/apache-mod_bw.git] / apache-mod_bw-apr_1.0.patch
1 diff -burN bw_mod-0.6.orig/bw_mod-0.6.c bw_mod-0.6/bw_mod-0.6.c
2 --- bw_mod-0.6.orig/bw_mod-0.6.c        2005-03-12 14:28:51.665241352 +0100
3 +++ bw_mod-0.6/bw_mod-0.6.c     2005-03-12 14:32:46.305570600 +0100
4 @@ -510,7 +510,7 @@
5      nowtime = apr_time_now();
6      if ( bwstat->time < (nowtime - 1000000) ) {
7        /* And if we got lock */
8 -      if ( apr_atomic_cas( &bwstat->lock, 1, 0 ) == 0 ) {
9 +      if ( apr_atomic_cas32( &bwstat->lock, 1, 0 ) == 0 ) {
10  
11          /* Calculate bw used in the last timeinterval */
12          bwstat->bandwidth = ( bwstat->bytes_count / (double)(nowtime - bwstat->time)) * 1000000 ;
13 @@ -522,7 +522,7 @@
14          bwstat->time = apr_time_now();
15            
16          /* Release lock */
17 -        apr_atomic_set( &bwstat->lock, 0 );
18 +        apr_atomic_set32( &bwstat->lock, 0 );
19       }
20    }    
21  }   
22 @@ -653,7 +653,7 @@
23    else             bwmaxconn = bwstat;
24   
25    /* Add 1 active connection to the record */
26 -  apr_atomic_inc( &bwmaxconn->connection_count );
27 +  apr_atomic_inc32( &bwmaxconn->connection_count );
28  
29    /* Verbose Output */
30    if (sconf->debug == BANDWIDTH_ENABLED) {
31 @@ -682,7 +682,7 @@
32        ap_pass_brigade(f->next, ctx->bb);
33  
34        /* Delete 1 active connection */
35 -      apr_atomic_dec( &bwmaxconn->connection_count );
36 +      apr_atomic_dec32( &bwmaxconn->connection_count );
37        return APR_SUCCESS; 
38      }
39  
40 @@ -750,14 +750,14 @@
41          b = APR_BRIGADE_FIRST(bb);
42  
43          /* Add the number of bytes transferred, so we can get an estimated bw usage */
44 -        apr_atomic_add( &bwstat->bytes_count, packet);
45 +        apr_atomic_add32( &bwstat->bytes_count, packet);
46  
47          /* If the connection goes to hell... go with it ! */
48          if (r->connection->aborted) { 
49            /* Verbose. Tells when the connection was ended */
50            if (sconf->debug == BANDWIDTH_ENABLED) 
51              ap_log_error(APLOG_MARK, APLOG_NOTICE|APLOG_NOERRNO, 0,NULL,"[W] Connection to hell"); 
52 -          apr_atomic_dec( &bwmaxconn->connection_count ); 
53 +          apr_atomic_dec32( &bwmaxconn->connection_count ); 
54            return APR_SUCCESS; 
55          }
56  
57 @@ -774,14 +774,14 @@
58      b = APR_BRIGADE_FIRST(bb);
59  
60      /* Add the number of bytes to the counter */
61 -    apr_atomic_add( &bwstat->bytes_count, bytes);
62 +    apr_atomic_add32( &bwstat->bytes_count, bytes);
63        
64      /* Pass the final brigade */
65      ap_pass_brigade(f->next, ctx->bb);
66    }
67  
68    /* Delete 1 active connection to the record */
69 -  apr_atomic_dec( &bwmaxconn->connection_count );
70 +  apr_atomic_dec32( &bwmaxconn->connection_count );
71  
72    /* Verbose, tells when we ended the Filter */
73    if (sconf->debug == BANDWIDTH_ENABLED) 
This page took 0.159836 seconds and 3 git commands to generate.