Got these while running my thousands of test URLs.

Warning: fwrite(): 758 is not a valid stream resource in httprl_send_request() (line 569 of drupal7\sites\all\modules\httprl\httprl.module).

Comments

hass’s picture

Issue summary: View changes

ff

hass’s picture

Issue summary: View changes

One issue moved to extra case having a repro case.

hass’s picture

Title: Several warnings in module » fwrite(): XXX is not a valid stream resource in httprl_send_request()

Repro case is currently unknown

hass’s picture

Repro cases found:

function httprl_admin_settings_form() {

  $headers = array();
  $headers['User-Agent'] = 'User-Agent: Drupal (+http://drupal.org/)';

  // Add in the headers and enable blocking mode.
  $options = array(
    'blocking' => TRUE,
    'headers' => $headers,
    'method' => 'HEAD',
    'max_redirects' => 1,
  );

  $urls = array(
    'http://www.science-tech.nmstc.ca/english/index.cfm',
    'http://www.aviation.nmstc.ca/Eng/english_home.html',
    'http://home.sunrise.ch/kleinera/tourismus-museum/',
    'http://www.paritaet.org/gv/infothek/pid/',
    'http://www.fabienne-iaf.de',
    'http://www.jugendarbeit.gmxhome.de',
    'http://www.fr-aktuell.de/uebersicht/alle_serien/regional/berufsbilder',
    'http://infomed.mds-ev.de/sindbad_frame',
    'http://www.careandhealth.com/',
    'http://comm-org.utoledo.edu',
    'http://www.zeva.uni-hannover.de',
    'http://www4.karlsruhe.de/kultur/ausstellungen',
    'http://www.egyptianmuseum.gov.eg/news.asp',
    'http://www.museum.gov.my/english/home.htm',
    'http://www2.imj.org.il/eng/branches/rockefeller/final/index.html',
  );

  drupal_set_time_limit(240);
  foreach ($urls as $url) {
    // Queue up the requests.
    httprl_request($url, $options);
  }

  // Execute requests.
  $responses = httprl_send_request();
  foreach ($responses as $response) {
    krumo($response);
  }
hass’s picture

These URLs have missing status code in the result, too!

mikeytown2’s picture

Status: Active » Fixed
FileSize
2 KB

This is a pretty odd case, good job finding it. This patch should fix it; it has been committed.

mikeytown2’s picture

empty() should be === FALSE http://php.net/array-search
This patch has been committed.

hass’s picture

Results looks good. All status codes "-1 request timed out" are inside. THX

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

klokie’s picture

Version: 7.x-1.4 » 6.x-1.7
FileSize
614 bytes

I'm having the same issue with 6.x-1.7. I've backported the patch in #5. Hope it's ok. Thanks!

klokie’s picture

Status: Closed (fixed) » Needs review
mikeytown2’s picture

In the latest dev version the $streams variable went away due to this issue getting fixed #1697244: Connection refused by destination. Write. curl works . As a result, the patch that you added isn't going to do the right thing. Also noted is the 6.x and 7.x versions of httprl should always be exactly the same.
http://drupalcode.org/project/httprl.git/blob/refs/heads/6.x-1.x:/httprl...
http://drupalcode.org/project/httprl.git/blob/refs/heads/7.x-1.x:/httprl...

Trying the example in #2 against the latest dev does not repo this.

Can you tell me how you are able to reproduce this bug? Here is a patch for 6.x & 7.x dev that adds this check back in. I need to know that this bug exists in the latest dev, and the attached patch fixes it before I commit this.

mikeytown2’s picture

Status: Needs review » Postponed (maintainer needs more info)

Marking this postponed until I can get feedback.

mikeytown2’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Closing issue as I can not reproduce it with the latest dev.

mikeytown2’s picture

Issue summary: View changes

#1429272