curl-library
Re: extract max keepalive requests configuration using a discovery loop
Date: Thu, 29 Sep 2005 13:57:19 +0200
>> Why is there no libcurl_easy_getopt()? Just curious.
>
> Why would there be one?
>From a OOA design point of view. I might be wrong in how people peruse
libcurl but if you write your application using functions or methods you
most certainly pass the CURL handle as a parameter to the function. Now
it would be nice to have a way to extract the various settings
associated with the internal "SessionHandle *data" struct without the
need to pass them as well upon a function call.
Stupid example:
I write a global error handling function which is used throughout the
whole source, called exit_and_cleanup(CURL *handle, int exit_on_failure,
...). Now in this error function I would maybe like to dump some
internal state, for the sake of simplicity, let's say the last used URL.
So far as I understand the design I would need to pass all the
information I'd like to dump along with the prototype of the function,
thus giving me something (regarding the beforementioned example) like:
void exit_and_cleanup(CURL *handle, int exit_on_failure, char *url, ...)
Simply to get the URL information, which is by virtue and definition
already passed with the CURL handle. A libcurl_easy_getopt() function
could in a OOA fashion close this "redundant information passing" gap.
I hope you understand what I mean.
Best regards,
Roberto Nibali, ratz
-- ------------------------------------------------------------- addr://Kasinostrasse 30, CH-5001 Aarau tel://++41 62 823 9355 http://www.terreactive.com fax://++41 62 823 9356 ------------------------------------------------------------- terreActive AG Wir sichern Ihren Erfolg -------------------------------------------------------------Received on 2005-09-29