cURL / Mailing Lists / curl-library / Single Mail

curl-library

An I-use-this-version-function (was Re: SMTP: compatibility concerns with bug #1389)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 25 Aug 2014 15:21:06 +0200 (CEST)

On Fri, 22 Aug 2014, Jacob Champion wrote:

> Have you considered having the client tell you which version of the cURL
> library they were compiled (and, theoretically, tested) against? For
> example, during one of the global/easy/multi_init()s, a client could pass
> the "functional version" of the library that it expects.

Oh, that's an interesting idea indeed! I've seen similar things in other libs.

It would indeed help for exactly this case, when an application that was built
against a functionality at point A in time and later we modify things and B
comes the preferred way, we can still detect the older user...

I can see some problems with sich an approach though, or perhaps things that
will stand in the way of making it less awesome:

We have to introduce it now so everything before this entry point will be
"older" and we can't make any other differentiations for already-built
applications.

A working program that just gets recompiled then risks suddenly not work
anymore, in a subtle way even (just like in your case) since the API is and
should documented to work in a specific way... Documenting such multiple
behaviors would not be very nice.

It makes it somewhat complicated to test and be certain that the checks and
actions really are the correct ones.

I fear it gives us or fellow contributors less incentives to actually maintain
ABI compatiblity since then you can actually introduce new behaviors without
damaging older applications. This is of course a double-edged sword as it can
then greatly helps us get out from a few strict rules we are under and better
change internals at specific boundaries.

In addition, I can't think of any smooth way to add this without introducing a
new function or macro or something that needs to be called from the
application and so.

Adding a new such function or macro now would force us to add that to all the
examples and then we have created examples that only work from release N + 1
and not for any older release ever made of libcurl.

So, while I like the idea I think the drawbacks of introducing that now is
somewhat big and not easily handled and I don't see a very strong need for
this feature...

Discuss!

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2014-08-25