git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com>
To: Daniel Stenberg <daniel@haxx.se>,
	Nicolas Morey-Chaisemartin <NMoreyChaisemartin@suse.de>
Cc: Jonathan Nieder <jrnieder@gmail.com>,
	Doron Behar <doron.behar@gmail.com>, <git@vger.kernel.org>
Subject: Re: imap-send with gmail: curl_easy_perform() failed: URL using bad/illegal format or missing URL
Date: Thu, 30 Nov 2017 10:51:01 +0100	[thread overview]
Message-ID: <44bbb765-fb0d-5b80-c697-76a9b6ff0811@morey-chaisemartin.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1711301041250.30591@tvnag.unkk.fr>



Le 30/11/2017 à 10:46, Daniel Stenberg a écrit :
> On Thu, 30 Nov 2017, Nicolas Morey-Chaisemartin wrote:
>
>> This is due to the weird "[Gmail]" prefix in the folder.
>> I tried manually replacing it with:
>>         folder = %5BGmail%5D/Drafts
>> in .git/config and it works.
>>
>> curl is doing some fancy handling with brackets and braces. It make sense for multiple FTP downloads like ftp://ftp.numericals.com/file[1-100].txt, not in our case. The curl command line has a --globoff argument to disable this "regexp" support and it seems to fix the gmail case. However I couldn't find a way to change this value through the API...
>
> That's just a feature of the command line tool, "globbing" isn't a function provided by the library. libcurl actually "just" expects a plain old URL.
>
Yep that what I figured looking a bit further in the code.

> But with the risk of falling through the cracks into the rathole that is "what is a URL" (I've blogged about the topic several times in the past and I will surely do it again in the future):
>
> A "legal" URL (as per RFC 3986) does not contain brackets, such symbols should be used URL encoded: %5B and %5D.
>
> This said: I don't know exactly why brackets cause a problem in this case. It could still be worth digging into and see if libcurl could deal with them better here...
>

It would make sense to have a way to ask libcurl to URI encode for us. I'm guessing there's already the code for that somewhere in curl and we would be wise to use it.
But to work wqith older version we'll have to do it ourselves anyway.

Nicolas

  reply	other threads:[~2017-11-30 10:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-29 17:13 imap-send with gmail: curl_easy_perform() failed: URL using bad/illegal format or missing URL Doron Behar
2017-11-30  2:04 ` Jonathan Nieder
2017-11-30  3:28   ` Jeff King
2017-11-30  3:55     ` Jeff King
2017-11-30  9:39   ` Nicolas Morey-Chaisemartin
2017-11-30  9:46     ` Daniel Stenberg
2017-11-30  9:51       ` Nicolas Morey-Chaisemartin [this message]
2017-11-30  9:55         ` Daniel Stenberg
2017-11-30  9:47     ` Nicolas Morey-Chaisemartin
2017-11-30 10:07 ` [PATCH] imap-send: URI encode server folder Nicolas Morey-Chaisemartin
2017-11-30 17:53   ` Eric Sunshine
2017-12-05 15:30     ` Junio C Hamano
2017-12-18 18:25     ` [PATCH v2] " Kaartic Sivaraam
2017-12-18 18:48       ` Eric Sunshine
2017-12-18 19:11         ` [PATCH v3] " Kaartic Sivaraam
2017-12-18 22:19           ` Jonathan Nieder
2017-12-18 22:32           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44bbb765-fb0d-5b80-c697-76a9b6ff0811@morey-chaisemartin.com \
    --to=nicolas@morey-chaisemartin.com \
    --cc=NMoreyChaisemartin@suse.de \
    --cc=daniel@haxx.se \
    --cc=doron.behar@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).