[PATCH 4/6] added openconnect_strdup()

David Woodhouse dwmw2 at infradead.org
Wed Aug 27 02:03:18 PDT 2014


On Wed, 2014-08-27 at 09:17 +0200, Nikos Mavrogiannopoulos wrote:
> 
> So you mean to keep openconnect_strdup() and rename it to
> openconnect_set_form_field()? If combined with your earlier proposal
> to change ABI and have the main functions clean of any allocation it
> would be pretty ok.

Well, it wouldn't just be a rename of the function. It would actually
*set* the field. The caller wouldn't do the direct assignment to
opt->value, but would call a function such as:

openconnect_set_option_value(struct oc_form_opt *opt, const char *value);

I might even *rename* opt->value, to make sure they use the function. Or
maybe even make 'struct oc_form_opt' an opaque structure and make them
do *everything* with accessor functions.

And then yes, the whole API would all be clean of any allocation; no
strings would need to cross the boundary between libraries. Which not
only fixes the Windows situation but is also a fairly nice cleanup. I
think that's probably worth an ABI break, and I can probably fix it up
with wrappers to provide compatibility with the previous soname, like I
did once for libopenconnect.so.1 after libopenconnect.so.2 was
introduced.

-- 
dwmw2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5745 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openconnect-devel/attachments/20140827/1fc7ac43/attachment.bin>


More information about the openconnect-devel mailing list