Ticket #2733 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Value in class-snoopy.php is set too high and can sometimes cause problems

Reported by: JeremyVisser Assigned to: anonymous
Priority: normal Milestone:
Component: Administration Version: 2.0.3
Severity: normal Keywords: snoopy, fread, wp-slimstat, dashboard
Cc: jeremy.visser@gmail.com

Description

Please read footnote at the bottom.

I use WordPress 2.0.2 which contains a copy of Snoopy 1.2.3.

I recently ran into a problem where the Dashboard would simply terminate with no feedback whatsoever during a call to fread() in the _httprequest() function in wp-includes/class-snoopy.php while my wp-slimstat plugin was activated.

After many hours of debugging, I found that changing the default value of $maxlength from 500000 to 8192 fixed the problem.

At first, I thought this was due to the WP-SlimStat plugin being activated, but later I concluded it was just because of the extra memory used by he plugin that was tipping the memory limit over.

I think that the default value should be permanently changed to 8192, because according to the PHP documentation on fread() (http://www.php.net/manual/en/function.fread.php) the reading of file will stop at 8192 bytes anyway, so having the value of $maxlength any higher would be pointless, and in my case, cause problems.

Regards, Jeremy.

This is a modified copy of the bug report I filed at http://sf.net/projects/snoopy/. The folks at Snoopy seem to be pretty idle, because I haven't had any feedback on my bug report, but I really would like this fixed as it does appear to cause problems with certain configurations in WordPress. I would like to see this fixed in the Snoopy included with WP, as it won't really harm anything to change the value from 500000 to 8192.

Attachments

class-snoopy.php.diff (0.7 kB) - added by JeremyVisser on 05/20/06 04:23:15.
A patch for class-snoopy.php to make the requested changes

Change History

05/18/06 10:30:36 changed by JeremyVisser

  • version changed from 1.2 to 2.0.2.

I changed the version to say 2.0.2, which I am using. I'm new to Trac, so I didn't realise that the 1.2 meant WP 1.2!

05/20/06 04:23:15 changed by JeremyVisser

  • attachment class-snoopy.php.diff added.

A patch for class-snoopy.php to make the requested changes

06/29/06 03:48:07 changed by JeremyVisser

  • cc set to jeremy.visser@gmail.com.
  • version changed from 2.0.2 to 2.0.3.
  • milestone changed from 2.0.3 to 2.0.4.

Note: in php.ini, setting the memory limit to 16M also fixes the problem. This makes this fix more like a workaround. It should still be fixed.

07/23/06 18:23:44 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [4030]) Snoopy fread fixes. Props JeremyVisser?. fixes #2733

07/23/06 18:24:17 changed by ryan

(In [4031]) Snoopy fread fixes. Props JeremyVisser?. fixes #2733

07/23/06 23:28:29 changed by JeremyVisser

Thankyou very much!

11/30/06 19:41:50 changed by

  • milestone deleted.

Milestone 2.0.4 deleted