On my system (libcurl 7.18.0-1ubuntu2), drupalGet does not work correctly: it issues POST requests instead of GET. For example, this access log from a Forum test case:

127.0.1.1 - - [01/Jul/2008:02:07:35 +0200] "POST /CoreDev/DRUPAL-7/node/1 HTTP/1.1" 200 6558 "-" "simpletest994906"
127.0.1.1 - - [01/Jul/2008:02:07:36 +0200] "POST /CoreDev/DRUPAL-7/node/1 HTTP/1.1" 200 6558 "-" "simpletest994906"
127.0.1.1 - - [01/Jul/2008:02:07:36 +0200] "POST /CoreDev/DRUPAL-7/node/1 HTTP/1.1" 200 6558 "-" "simpletest994906"
127.0.1.1 - - [01/Jul/2008:02:07:36 +0200] "POST /CoreDev/DRUPAL-7/node/2 HTTP/1.1" 200 6693 "-" "simpletest994906"
127.0.1.1 - - [01/Jul/2008:02:07:36 +0200] "POST /CoreDev/DRUPAL-7/node/2 HTTP/1.1" 200 6693 "-" "simpletest994906"
127.0.1.1 - - [01/Jul/2008:02:07:37 +0200] "POST /CoreDev/DRUPAL-7/node/2 HTTP/1.1" 200 6693 "-" "simpletest994906"
127.0.1.1 - - [01/Jul/2008:02:07:37 +0200] "POST /CoreDev/DRUPAL-7/node/3 HTTP/1.1" 200 6693 "-" "simpletest994906"
127.0.1.1 - - [01/Jul/2008:02:07:37 +0200] "POST /CoreDev/DRUPAL-7/node/3 HTTP/1.1" 200 6693 "-" "simpletest994906"
127.0.1.1 - - [01/Jul/2008:02:07:37 +0200] "POST /CoreDev/DRUPAL-7/node/3 HTTP/1.1" 200 6693 "-" "simpletest994906"

Looks like we need to use CURLOPT_HTTPGET to reset the internal state of the curl library (the enclosed patch does that).

Can someone confirm this bugs with others versions of libcurl?

Comments

damien tournoud’s picture

Oh, and note that this broke my Block caching tests in #235673: Changes to block caching mode not caught.

chx’s picture

Status: Needs review » Needs work

then, i believe the curlopt_post => FALSE is not necessary. Damien thanks for this i remember trying to find exactly this but i failed. i am happy someone else did not :)

damien tournoud’s picture

Status: Needs work » Needs review
StatusFileSize
new988 bytes

I also believe curl doesn't need the reset of POSTFIELDS. Untested patch.

catch’s picture

Status: Needs review » Reviewed & tested by the community

Ran all tests with #3, no new failures.

chx’s picture

Yay for less and cleaner code.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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