PHP 4.3.2 Upgrade...

  • Jason Grosland

    Jason Grosland - 2003-05-31

    Looks like something in the php 4.3.2 upgrade breaks some stuff in Snoopy...

    If I try to pull down a page from a URL, I only get the first 2500 characters or so...  I'm not sure where this is coming from, haven't had time to investigate it yet.

    If anyone else has seen this problem/knows how to fix it, I'd love to hear from you.


    • Jason Grosland

      Jason Grosland - 2003-06-01

      Ok...  I had a chance to figure this out, here's the scoop.

      PHP's fopen function has always been advertised to stop whenever waiting on network traffic.  It appears that until version 4.3.2, it has never functioned as advertised...

      So, now to properly call the fopen method, we need to make calls to fopen in a loop to make sure we keep reading the contents of a URL  until we have the entire file.

      Here's my diff of the Snoopy php source file with the changed code:

      <               $results = "";
      <               $tmpdata = fread( $fp, $this->maxlength );
      <               while( strlen( $tmpdata ) != 0 ) {
      <                   $results .= $tmpdata;
      <                 $tmpdata = fread( $fp, $this->maxlength );
      <               }
      >               $results = fread($fp, $this->maxlength);

      Once I made this change, everything worked again.



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks