chiark / gitweb /
dgit: WWW::Curl Set $response_body to '' explicitly
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 8 Aug 2019 11:30:46 +0000 (12:30 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 10 Aug 2019 23:09:28 +0000 (00:09 +0100)
commitbbc8063258e22fb5270d27f3d5c74215c88a8785
treee156041745f4dd015689a5685dcef351b583e589
parent9ff427424a06206e33200773b317f6e70ac0e2f7
dgit: WWW::Curl Set $response_body to '' explicitly

check_for_git calls url_fetch with a WWW::Curl parameter
CURLOPT_NOBODY which suppresses saving the body.  The result is that
CURLOPT_WRITEDATA does not update $response_body.  Then, even on
success, url_fetch returns undef (which ought to mean 404).

Strictly this is a bit sneaky of check_for_git.  But, rather than
trying to make this interface more formal, just make url_fetch set
$response_body to ''.  It does return this except in the success case,
so the error cases are still handled right.

Closes: #934126
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit