# [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0

12 messages from 2012-08-22 to 2012-08-24. Participants: Joachim Schmitz, Junio C Hamano.
Thread: https://gitlist.dev/t/31318

## Joachim Schmitz, 2012-08-22 15:44

Subject: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
Message-ID: <002201cd807d$0e83d300$2b8b7900$@schmitz-digital.de>
URL: https://gitlist.dev/e/002201cd807d%240e83d300%242b8b7900%24%40schmitz-digital.de

```

Signed-off-by: Joachim Schmitz <jojo@schmitz-digital.de>
---
 http.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/http.c b/http.c
index b61ac85..18bc6bf 100644
--- a/http.c
+++ b/http.c
@@ -806,10 +806,12 @@ static int http_request(const char *url, void *result,
int target, int options)
                                ret = HTTP_REAUTH;
                        }
                } else {
+#if LIBCURL_VERSION_NUM >= 0x070c00
                        if (!curl_errorstr[0])
                                strlcpy(curl_errorstr,
 
curl_easy_strerror(results.curl_result),
                                        sizeof(curl_errorstr));
+#endif
                        ret = HTTP_ERROR;
                }
        } else {
--
1.7.12

Bye, Jojo

```

## Junio C Hamano, 2012-08-22 17:18

Subject: Re: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
Message-ID: <7v8vd6alqe.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v8vd6alqe.fsf%40alter.siamese.dyndns.org
In-Reply-To: <002201cd807d$0e83d300$2b8b7900$@schmitz-digital.de>

```
"Joachim Schmitz" <jojo@schmitz-digital.de> writes:

> Signed-off-by: Joachim Schmitz <jojo@schmitz-digital.de>

At the very least, please mention that this reverts be22d92 (http:
avoid empty error messages for some curl errors, 2011-09-05) on
platforms with older versions of libcURL.

> ---
>  http.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/http.c b/http.c
> index b61ac85..18bc6bf 100644
> --- a/http.c
> +++ b/http.c
> @@ -806,10 +806,12 @@ static int http_request(const char *url, void *result,
> int target, int options)
>                                 ret = HTTP_REAUTH;
>                         }
>                 } else {
> +#if LIBCURL_VERSION_NUM >= 0x070c00
>                         if (!curl_errorstr[0])
>                                 strlcpy(curl_errorstr,
>  
> curl_easy_strerror(results.curl_result),
>                                         sizeof(curl_errorstr));
> +#endif
>                         ret = HTTP_ERROR;
>                 }
>         } else {
> --
> 1.7.12
>
> Bye, Jojo

```

## Joachim Schmitz, 2012-08-22 17:28

Subject: RE: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
Message-ID: <003001cd808b$9d505730$d7f10590$@schmitz-digital.de>
URL: https://gitlist.dev/e/003001cd808b%249d505730%24d7f10590%24%40schmitz-digital.de
In-Reply-To: <7v8vd6alqe.fsf@alter.siamese.dyndns.org>

```
> From: Junio C Hamano [mailto:gitster@pobox.com]
> Sent: Wednesday, August 22, 2012 7:19 PM
> To: Joachim Schmitz
> Cc: git@vger.kernel.org
> Subject: Re: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
> 
> "Joachim Schmitz" <jojo@schmitz-digital.de> writes:
> 
> > Signed-off-by: Joachim Schmitz <jojo@schmitz-digital.de>
> 
> At the very least, please mention that this reverts be22d92 (http:
> avoid empty error messages for some curl errors, 2011-09-05) on platforms
> with older versions of libcURL.

a) Of course I didn't know that, thanks for telling me.
b) How and where to add that? In the Subject of an email, in the body, right
at the front?
Like this:
----

This reverts be22d92 (http: avoid empty error messages for some curl errors,
2011-09-05) on platforms with older versions of libcURL.

Signed-off-by: Joachim Schmitz <jojo@schmitz-digital.de>
---
 http.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/http.c b/http.c
index b61ac85..18bc6bf 100644
--- a/http.c
+++ b/http.c
@@ -806,10 +806,12 @@ static int http_request(const char *url, void *result,
int target, int options)
                                ret = HTTP_REAUTH;
                        }
                } else {
+#if LIBCURL_VERSION_NUM >= 0x070c00
                        if (!curl_errorstr[0])
                                strlcpy(curl_errorstr,
 
curl_easy_strerror(results.curl_result),
                                        sizeof(curl_errorstr));
+#endif
                        ret = HTTP_ERROR;
                }
        } else {
--
1.7.12

Bye, Jojo

```

## Junio C Hamano, 2012-08-22 17:41

Subject: Re: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
Message-ID: <7vk3wq964r.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vk3wq964r.fsf%40alter.siamese.dyndns.org
In-Reply-To: <003001cd808b$9d505730$d7f10590$@schmitz-digital.de>

```
"Joachim Schmitz" <jojo@schmitz-digital.de> writes:

> Like this:
> ----
>
> This reverts be22d92 (http: avoid empty error messages for some curl errors,
> 2011-09-05) on platforms with older versions of libcURL.
>
> Signed-off-by: Joachim Schmitz <jojo@schmitz-digital.de>
> ---

Perfect ;-)

>  http.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/http.c b/http.c
> index b61ac85..18bc6bf 100644
> --- a/http.c
> +++ b/http.c
> @@ -806,10 +806,12 @@ static int http_request(const char *url, void *result,
> int target, int options)
>                                 ret = HTTP_REAUTH;
>                         }

Now we need to see where these whitespace breakages are coming from
and fix it, and I think it should be done earlier than later, as I
expect we will be seeing more patches from you in the coming weeks.

>                 } else {
> +#if LIBCURL_VERSION_NUM >= 0x070c00
>                         if (!curl_errorstr[0])
>                                 strlcpy(curl_errorstr,
>  
> curl_easy_strerror(results.curl_result),
>                                         sizeof(curl_errorstr));
> +#endif
>                         ret = HTTP_ERROR;
>                 }
>         } else {
> --
> 1.7.12
>
> Bye, Jojo

```

## Joachim Schmitz, 2012-08-22 17:59

Subject: RE: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
Message-ID: <003c01cd808f$f24e2a60$d6ea7f20$@schmitz-digital.de>
URL: https://gitlist.dev/e/003c01cd808f%24f24e2a60%24d6ea7f20%24%40schmitz-digital.de
In-Reply-To: <7vk3wq964r.fsf@alter.siamese.dyndns.org>

```
> From: Junio C Hamano [mailto:gitster@pobox.com]
> Sent: Wednesday, August 22, 2012 7:41 PM
> To: Joachim Schmitz
> Cc: git@vger.kernel.org
> Subject: Re: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
> 
> "Joachim Schmitz" <jojo@schmitz-digital.de> writes:
> 
> > Like this:
> > ----
> >
> > This reverts be22d92 (http: avoid empty error messages for some curl
> > errors,
> > 2011-09-05) on platforms with older versions of libcURL.
> >
> > Signed-off-by: Joachim Schmitz <jojo@schmitz-digital.de>
> > ---
> 
> Perfect ;-)
> 
> >  http.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/http.c b/http.c
> > index b61ac85..18bc6bf 100644
> > --- a/http.c
> > +++ b/http.c
> > @@ -806,10 +806,12 @@ static int http_request(const char *url, void
> > *result, int target, int options)
> >                                 ret = HTTP_REAUTH;
> >                         }
> 
> Now we need to see where these whitespace breakages are coming from and
> fix it, and I think it should be done earlier than later, as I expect we
will be
> seeing more patches from you in the coming weeks.

OK, next attempt (this time I downloaded the patch file to my PC first and
used Wordpad for copy/past rather than cat in a PuTTY session)
---

This reverts be22d92 (http: avoid empty error messages for some curl errors,
2011-09-05) on platforms with older versions of libcURL.

Signed-off-by: Joachim Schmitz <jojo@schmitz-digital.de>
---
 http.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/http.c b/http.c
index b61ac85..18bc6bf 100644
--- a/http.c
+++ b/http.c
@@ -806,10 +806,12 @@ static int http_request(const char *url, void *result,
int target, int options)
 				ret = HTTP_REAUTH;
 			}
 		} else {
+#if LIBCURL_VERSION_NUM >= 0x070c00
 			if (!curl_errorstr[0])
 				strlcpy(curl_errorstr,
 
curl_easy_strerror(results.curl_result),
 					sizeof(curl_errorstr));
+#endif
 			ret = HTTP_ERROR;
 		}
 	} else {
-- 
1.7.12

Better?

Bye, Jojo

```

## Junio C Hamano, 2012-08-22 18:17

Subject: Re: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
Message-ID: <7v7gsq94gd.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v7gsq94gd.fsf%40alter.siamese.dyndns.org
In-Reply-To: <003c01cd808f$f24e2a60$d6ea7f20$@schmitz-digital.de>

```
"Joachim Schmitz" <jojo@schmitz-digital.de> writes:

>
> This reverts be22d92 (http: avoid empty error messages for some curl errors,
> 2011-09-05) on platforms with older versions of libcURL.
>
> Signed-off-by: Joachim Schmitz <jojo@schmitz-digital.de>
> ---
>  http.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/http.c b/http.c
> index b61ac85..18bc6bf 100644
> --- a/http.c
> +++ b/http.c
> @@ -806,10 +806,12 @@ static int http_request(const char *url, void *result,
> int target, int options)

Likewrapped X-<

>  				ret = HTTP_REAUTH;
>  			}
>  		} else {
> +#if LIBCURL_VERSION_NUM >= 0x070c00
>  			if (!curl_errorstr[0])
>  				strlcpy(curl_errorstr,
>  
> curl_easy_strerror(results.curl_result),
>  					sizeof(curl_errorstr));
> +#endif
>  			ret = HTTP_ERROR;
>  		}
>  	} else {

```

## Joachim Schmitz, 2012-08-22 18:50

Subject: RE: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
Message-ID: <004101cd8096$fce3a700$f6aaf500$@schmitz-digital.de>
URL: https://gitlist.dev/e/004101cd8096%24fce3a700%24f6aaf500%24%40schmitz-digital.de
In-Reply-To: <7v7gsq94gd.fsf@alter.siamese.dyndns.org>

```


> -----Original Message-----
> From: Junio C Hamano [mailto:gitster@pobox.com]
> Sent: Wednesday, August 22, 2012 8:17 PM
> To: Joachim Schmitz
> Cc: git@vger.kernel.org
> Subject: Re: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
> 
> "Joachim Schmitz" <jojo@schmitz-digital.de> writes:
> 
> >
> > This reverts be22d92 (http: avoid empty error messages for some curl
> > errors,
> > 2011-09-05) on platforms with older versions of libcURL.
> >
> > Signed-off-by: Joachim Schmitz <jojo@schmitz-digital.de>
> > ---
> >  http.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/http.c b/http.c
> > index b61ac85..18bc6bf 100644
> > --- a/http.c
> > +++ b/http.c
> > @@ -806,10 +806,12 @@ static int http_request(const char *url, void
> > *result, int target, int options)
> 
> Likewrapped X-<

Any suggestion?

```

## Junio C Hamano, 2012-08-22 21:01

Subject: Re: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
Message-ID: <7vwr0q63po.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vwr0q63po.fsf%40alter.siamese.dyndns.org
In-Reply-To: <004101cd8096$fce3a700$f6aaf500$@schmitz-digital.de>

```
"Joachim Schmitz" <jojo@schmitz-digital.de> writes:

>> > diff --git a/http.c b/http.c
>> > index b61ac85..18bc6bf 100644
>> > --- a/http.c
>> > +++ b/http.c
>> > @@ -806,10 +806,12 @@ static int http_request(const char *url, void
>> > *result, int target, int options)
>> 
>> Likewrapped X-<
>
> Any suggestion?

Other than "don't wrap" (or "get a real MUA and MTA" X-<),
unfortunately no.

I do not know if you have checked MUA specific hints section of
Documentation/SubmittingPatches; there may be environment specific
hints described for a MUA you may have at hand (or not).

```

## Joachim Schmitz, 2012-08-22 21:05

Subject: RE: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
Message-ID: <004601cd80a9$e79bace0$b6d306a0$@schmitz-digital.de>
URL: https://gitlist.dev/e/004601cd80a9%24e79bace0%24b6d306a0%24%40schmitz-digital.de
In-Reply-To: <7vwr0q63po.fsf@alter.siamese.dyndns.org>

```
> From: Junio C Hamano [mailto:gitster@pobox.com]
> Sent: Wednesday, August 22, 2012 11:02 PM
> To: Joachim Schmitz
> Cc: git@vger.kernel.org
> Subject: Re: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
> 
> "Joachim Schmitz" <jojo@schmitz-digital.de> writes:
> 
> >> > diff --git a/http.c b/http.c
> >> > index b61ac85..18bc6bf 100644
> >> > --- a/http.c
> >> > +++ b/http.c
> >> > @@ -806,10 +806,12 @@ static int http_request(const char *url, void
> >> > *result, int target, int options)
> >>
> >> Likewrapped X-<
> >
> > Any suggestion?
> 
> Other than "don't wrap" (or "get a real MUA and MTA" X-<), unfortunately
no.
> 
> I do not know if you have checked MUA specific hints section of
> Documentation/SubmittingPatches; there may be environment specific hints
> described for a MUA you may have at hand (or not).

I checked, but Outlook isn't mentioned :-(

Bye, Jojo

```

## Joachim Schmitz, 2012-08-23 07:33

Subject: RE: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
Message-ID: <000601cd8101$a6f81900$f4e84b00$@schmitz-digital.de>
URL: https://gitlist.dev/e/000601cd8101%24a6f81900%24f4e84b00%24%40schmitz-digital.de
In-Reply-To: <7vwr0q63po.fsf@alter.siamese.dyndns.org>

```
> From: Joachim Schmitz [mailto:jojo@schmitz-digital.de]
> Sent: Wednesday, August 22, 2012 11:06 PM
> To: 'Junio C Hamano'
> Cc: 'git@vger.kernel.org'
> Subject: RE: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
> 
> > From: Junio C Hamano [mailto:gitster@pobox.com]
> > Sent: Wednesday, August 22, 2012 11:02 PM
> > To: Joachim Schmitz
> > Cc: git@vger.kernel.org
> > Subject: Re: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
> >
> > "Joachim Schmitz" <jojo@schmitz-digital.de> writes:
> >
> > >> > diff --git a/http.c b/http.c
> > >> > index b61ac85..18bc6bf 100644
> > >> > --- a/http.c
> > >> > +++ b/http.c
> > >> > @@ -806,10 +806,12 @@ static int http_request(const char *url, void
> > >> > *result, int target, int options)
> > >>
> > >> Likewrapped X-<
> > >
> > > Any suggestion?
> >
> > Other than "don't wrap" (or "get a real MUA and MTA" X-<), unfortunately no.
> >
> > I do not know if you have checked MUA specific hints section of
> > Documentation/SubmittingPatches; there may be environment specific hints
> > described for a MUA you may have at hand (or not).
> 
> I checked, but Outlook isn't mentioned :-(

OK, Outlook inserts line breaks at position 76. I can't switch it off completely, but can set it to anything between 30 and 132. I
set it to 132 now, does that look OK now?
---

This reverts be22d92 (http: avoid empty error messages for some curl errors, 2011-09-05) on platforms with older versions of
libcURL.

Signed-off-by: Joachim Schmitz <jojo@schmitz-digital.de>
---
 http.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/http.c b/http.c
index b61ac85..18bc6bf 100644
--- a/http.c
+++ b/http.c
@@ -806,10 +806,12 @@ static int http_request(const char *url, void *result, int target, int options)
 				ret = HTTP_REAUTH;
 			}
 		} else {
+#if LIBCURL_VERSION_NUM >= 0x070c00
 			if (!curl_errorstr[0])
 				strlcpy(curl_errorstr,
 					curl_easy_strerror(results.curl_result),
 					sizeof(curl_errorstr));
+#endif
 			ret = HTTP_ERROR;
 		}
 	} else {
-- 
1.7.12


Bye, Jojo

```

## Junio C Hamano, 2012-08-23 21:27

Subject: Re: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
Message-ID: <7vlih52tag.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vlih52tag.fsf%40alter.siamese.dyndns.org
In-Reply-To: <000601cd8101$a6f81900$f4e84b00$@schmitz-digital.de>

```
"Joachim Schmitz" <jojo@schmitz-digital.de> writes:

>> From: Joachim Schmitz [mailto:jojo@schmitz-digital.de]
>> Sent: Wednesday, August 22, 2012 11:06 PM
>> To: 'Junio C Hamano'
>> Cc: 'git@vger.kernel.org'
>> Subject: RE: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
>> 
>> > From: Junio C Hamano [mailto:gitster@pobox.com]
>> > Sent: Wednesday, August 22, 2012 11:02 PM
>> > To: Joachim Schmitz
>> > Cc: git@vger.kernel.org
>> > Subject: Re: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
>> >
>> > "Joachim Schmitz" <jojo@schmitz-digital.de> writes:
>> >
>> > >> > diff --git a/http.c b/http.c
>> > >> > index b61ac85..18bc6bf 100644
>> > >> > --- a/http.c
>> > >> > +++ b/http.c
>> > >> > @@ -806,10 +806,12 @@ static int http_request(const char *url, void
>> > >> > *result, int target, int options)
>> > >>
>> > >> Likewrapped X-<
>> > >
>> > > Any suggestion?
>> >
>> > Other than "don't wrap" (or "get a real MUA and MTA" X-<), unfortunately no.
>> >
>> > I do not know if you have checked MUA specific hints section of
>> > Documentation/SubmittingPatches; there may be environment specific hints
>> > described for a MUA you may have at hand (or not).
>> 
>> I checked, but Outlook isn't mentioned :-(
>
> OK, Outlook inserts line breaks at position 76. I can't switch it off completely, but can set it to anything between 30 and 132. I
> set it to 132 now, does that look OK now?

Yeah, modulo that with all the above noise and with "---" before the
log message you inserted by hand before the real commit log message,
and also the log message is not properly line-wrapped, it is getting
closer to what is expected of a patch to be applied.

I've applied it by hand and fixed the log message up, so no need to
resend this particular one.  Thanks.

> ---
>
> This reverts be22d92 (http: avoid empty error messages for some curl errors, 2011-09-05) on platforms with older versions of
> libcURL.
>
> Signed-off-by: Joachim Schmitz <jojo@schmitz-digital.de>
> ---
>  http.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/http.c b/http.c
> index b61ac85..18bc6bf 100644
> --- a/http.c
> +++ b/http.c
> @@ -806,10 +806,12 @@ static int http_request(const char *url, void *result, int target, int options)
>  				ret = HTTP_REAUTH;
>  			}
>  		} else {
> +#if LIBCURL_VERSION_NUM >= 0x070c00
>  			if (!curl_errorstr[0])
>  				strlcpy(curl_errorstr,
>  					curl_easy_strerror(results.curl_result),
>  					sizeof(curl_errorstr));
> +#endif
>  			ret = HTTP_ERROR;
>  		}
>  	} else {

```

## Joachim Schmitz, 2012-08-24 05:30

Subject: RE: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
Message-ID: <002101cd81b9$828f1380$87ad3a80$@schmitz-digital.de>
URL: https://gitlist.dev/e/002101cd81b9%24828f1380%2487ad3a80%24%40schmitz-digital.de
In-Reply-To: <7vlih52tag.fsf@alter.siamese.dyndns.org>

```
> From: Junio C Hamano [mailto:gitster@pobox.com]
> Sent: Thursday, August 23, 2012 11:27 PM
> To: Joachim Schmitz
> Cc: git@vger.kernel.org
> Subject: Re: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
> 
> "Joachim Schmitz" <jojo@schmitz-digital.de> writes:
> 
> >> From: Joachim Schmitz [mailto:jojo@schmitz-digital.de]
> >> Sent: Wednesday, August 22, 2012 11:06 PM
> >> To: 'Junio C Hamano'
> >> Cc: 'git@vger.kernel.org'
> >> Subject: RE: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
> >>
> >> > From: Junio C Hamano [mailto:gitster@pobox.com]
> >> > Sent: Wednesday, August 22, 2012 11:02 PM
> >> > To: Joachim Schmitz
> >> > Cc: git@vger.kernel.org
> >> > Subject: Re: [PATCH] Don't use curl_easy_strerror prior to curl-7.12.0
> >> >
> >> > "Joachim Schmitz" <jojo@schmitz-digital.de> writes:
> >> >
> >> > >> > diff --git a/http.c b/http.c
> >> > >> > index b61ac85..18bc6bf 100644
> >> > >> > --- a/http.c
> >> > >> > +++ b/http.c
> >> > >> > @@ -806,10 +806,12 @@ static int http_request(const char *url, void
> >> > >> > *result, int target, int options)
> >> > >>
> >> > >> Likewrapped X-<
> >> > >
> >> > > Any suggestion?
> >> >
> >> > Other than "don't wrap" (or "get a real MUA and MTA" X-<), unfortunately no.
> >> >
> >> > I do not know if you have checked MUA specific hints section of
> >> > Documentation/SubmittingPatches; there may be environment specific hints
> >> > described for a MUA you may have at hand (or not).
> >>
> >> I checked, but Outlook isn't mentioned :-(
> >
> > OK, Outlook inserts line breaks at position 76. I can't switch it off completely, but can set it to anything between 30 and 132.
I
> > set it to 132 now, does that look OK now?
> 
> Yeah, modulo that with all the above noise and with "---" before the
> log message you inserted by hand before the real commit log message,

OK, those are not allowed then? Or would they need to look different?

> and also the log message is not properly line-wrapped, it is getting
> closer to what is expected of a patch to be applied.
> 
> I've applied it by hand and fixed the log message up, so no need to
> resend this particular one.  Thanks.

Thanks

> > This reverts be22d92 (http: avoid empty error messages for some curl errors, 2011-09-05) on platforms with older versions of
> > libcURL.

You meant that linewrap between "of" and libcURL?, Or well, that was the 132 position... Or do you want these messages being wrapped
at <=80?

Bye, Jojo

```
