X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/546b7396244452dba8f9cb917e904028ab01dda5..6eb687f52d55d3255f1ee26be19c8c247b463a39:/sbr/oauth.c diff --git a/sbr/oauth.c b/sbr/oauth.c old mode 100644 new mode 100755 index 85fe7146..f4564d0f --- a/sbr/oauth.c +++ b/sbr/oauth.c @@ -956,6 +956,14 @@ post(struct curl_ctx *ctx, const char *url, const char *req_body) curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback); curl_easy_setopt(curl, CURLOPT_WRITEDATA, ctx); + if (strncmp(url, "http://127.0.0.1:", 17) == 0) { + /* Hack: on Cygwin, curl doesn't fail to connect with ECONNREFUSED. + Instead, it waits to timeout. So set a really short timeout, but + just on localhost (for convenience of the user, and the test + suite). */ + curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 2L); + } + status = curl_easy_perform(curl); /* first check for error from callback */ if (ctx->too_big) {