| Index: branches/wmf/1.17wmf1/includes/SquidUpdate.php |
| — | — | @@ -148,10 +148,25 @@ |
| 149 | 149 | } |
| 150 | 150 | $url = SquidUpdate::expand( $url ); |
| 151 | 151 | |
| | 152 | + // Try and incremement value in APC cache |
| | 153 | + $id = apc_inc( 'squidhtcppurge' ); |
| | 154 | + if ( $id === false ) { |
| | 155 | + // If false, means it didn't work |
| | 156 | + // Chances are that means it isn't in the cache |
| | 157 | + // Start saving a cached value |
| | 158 | + $add = apc_add( 'squidhtcppurge', 1 ); |
| | 159 | + if ( $add === true ) { |
| | 160 | + wfDebugLog( 'htcp', 'Unable to set value to APC cache' ); |
| | 161 | + $id = 0; |
| | 162 | + } else { |
| | 163 | + $id = $add; |
| | 164 | + } |
| | 165 | + } |
| | 166 | + |
| 152 | 167 | // Construct a minimal HTCP request diagram |
| 153 | 168 | // as per RFC 2756 |
| 154 | 169 | // Opcode 'CLR', no response desired, no auth |
| 155 | | - $htcpTransID = rand(); |
| | 170 | + $htcpTransID = $id; |
| 156 | 171 | |
| 157 | 172 | $htcpSpecifier = pack( 'na4na*na8n', |
| 158 | 173 | 4, 'HEAD', strlen( $url ), $url, |