IvnSoft / mod_bw

Apache Module - Bandwidth Mod (mod_bw)
Apache License 2.0
9 stars 4 forks source link

Output filter invoked twice when using mod_rewrite and mod_xsendfile #5

Open sosherof opened 2 years ago

sosherof commented 2 years ago

When using mod_rewrite to run a PHP script that inserts an X-Sendfile header to be use by the mod_xsendfile module, mod_rewrite is invoked a second time for a subrequest during file path validation. That's fine but the second invocation causes the hook (handle_bw) to add the bandwidth output filter twice. I haven't verified if that actually causes duplicate data on the wire but it causes BW to think there's twice as many connections, causing it to apply limits unnecessarily.

I've got a branch I'll submit soon with a fix, along with the PR. Hopefully that can be incorporated into the new version.