re: #156582: drupal_http_request() should support timeout setting we should port this to acquia_agent's version, and improve it to have separate connect and total timeouts.

CommentFileSizeAuthor
#2 1426178-2.patch4.14 KBpwolanin
#1 1426178-1.patch4.13 KBpwolanin

Comments

pwolanin’s picture

Status: Active » Needs work
StatusFileSize
new4.13 KB

First untested pass at porting

pwolanin’s picture

StatusFileSize
new4.14 KB

missed a constant

cpliakas’s picture

Status: Needs work » Reviewed & tested by the community

This looks good. I tested the patch using a page callback with a sleep() call, and if the value passed to the sleep call is longer than the specified $timeout then the appropriate error message is returned. The request completes when the value passed to sleep() is less than the timeout. I tested both the 6.x-1.x and 6.x-2.x branches, as the patch does apply to both cleanly.

pwolanin’s picture

Were you able to test the connect timeout part?

cpliakas’s picture

No, that is a little more difficult to test. If you ping a dummy domain then it fails immediately, not sure how to simulate a slow connection. Any advice would be appreciated.

cpliakas’s picture

As per the suggestion by @pwolanin, I tested against a valid Solr server with an invalid port, and the connection timeout works as expected.

coltrane’s picture

Is it correct that this is for 1.x of Connector?

pwolanin’s picture

It is for both branches.

pwolanin’s picture

Status: Reviewed & tested by the community » Fixed

committed to both 6.x branches.

Status: Fixed » Closed (fixed)

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