X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=scripts%2Fgen_curlinfo.php;h=a07af2281c2f5485497814a9754e4ff3a9459d06;hb=22e85919b89570a1848bcc8f41949a592ae20b48;hp=92bde38a562cbc6d7ccb8d3af923f0399b760078;hpb=feba1657a156f10d687e6e239e95e26536270eaa;p=m6w6%2Fext-http diff --git a/scripts/gen_curlinfo.php b/scripts/gen_curlinfo.php index 92bde38..a07af22 100644 --- a/scripts/gen_curlinfo.php +++ b/scripts/gen_curlinfo.php @@ -4,7 +4,9 @@ error_reporting(0); function failure() { - fprintf(STDERR, "FAILURE: %s\n", error_get_last()); + // this is why error_get_last() should return a stdClass object + $error = error_get_last(); + fprintf(STDERR, "FAILURE: %s\n", $error["message"]); exit(-1); } @@ -35,7 +37,8 @@ $exclude = array( 'PRIVATE', 'LASTSOCKET', 'FTP_ENTRY_PATH' ); $translate = array( - 'HTTP_CONNECTCODE' => "connect_code" + 'HTTP_CONNECTCODE' => "connect_code", + 'COOKIELIST' => 'cookies', ); $templates = array( @@ -74,8 +77,7 @@ foreach ($infos as $info) { list(, $full, $short, $type) = $info; if (in_array($short, $exclude)) continue; if (isset($ifdefs[$short])) printf("#if HTTP_CURL_VERSION(%s)\n", $ifdefs[$short]); - if (isset($translate[$short])) $short = $translate[$short]; - printf($templates[$type], $full, strtolower($short)); + printf($templates[$type], $full, strtolower((isset($translate[$short])) ? $translate[$short] : $short)); if (isset($ifdefs[$short])) printf("#endif\n"); }