|
|
cURL Mailing List Monthly Index Single Mail
curl-tracker mailing list Archives
[ curl-Feature Requests-1949716 ] Reaching under the hood.
From: SourceForge.net <noreply_at_sourceforge.net>
Date: Fri, 26 Dec 2008 22:51:42 +0000
Feature Requests item #1949716, was opened at 2008-04-23 15:54
Please note that this message will contain a full copy of the comment thread,
Initial Comment:
Libcurl defines and uses several handy functions internally:
Curl_md5it() - computes an MD5 hash of a string;
Curl_base64_encode(), Curl_base64_decode() - encode and decode data in Base64 encoding.
These are just some (those which I used); other such functions may exist.
It would be great if these functions were made public and documented like it is already done with curl_easy_escape(). It is not logical to link to an external library for, say, computing MD5 hash when you know that this functionality is already in libcurl.
Note that existing Curl_* functions are not functional/robust enough to be exported:
Curl_base64_decode(): output is garbled if the input contains any non-base64 characters (like newlines and such). Robust implementations must skip such characters.
Curl_md5it() is string-oriented and cannot be used to hash binary data.
Other feature that (I hope) could be easily implemented, yet add to libcurl's flexibility: cooked connect, send, receive, poll, and disconnect functions. By "cooked" I mean the following:
'connect' is done using usual curl_easy_setopt()/curl_easy_perform(), so the application does not need to hassle with proxy/SSL negotiations and all such. The difference from regular, say, http transfer is that the "performance" finishes after connecting to the server, not after the protocol session is complete. After the connection is established, you could use the handle in subsequent send/receive operations.
'send' and 'receive' (I am dreaming here) work with curl handles, not sockets. Thus, it will be easy to write applications implementing custom network protocols, yet capable of working though proxies and SSL connections.
I guess that this (or similar) functionality is already in the guts of libcurl, but is not usable from outside. Wouldn't it be great if there were some public interface to send/receive raw data?
Rationale:
Currently we are forced to use predefined protocols (known by libcurl). If you want something non-standard, you should either implement it yourself from scratch, or modify libcurl.
(Yes, you can send and receive arbitrary data from callback functions. Isn't it ugly? I tried to write a simple libcurl application that talks to a telnet server and... I couldn't).
----------------------------------------------------------------------
Comment By: Zmey (zmey_)
Message:
Ok, I agree that mailing list is a better place for such a discussion
As for your concerns about fixing the movable: I don't think that
Anyway, I feel I have put too much into one post; I will split it into two
----------------------------------------------------------------------
Comment By: Dan Fandrich (dfandrich)
Message:
curl already does this for some functions--the curlx functions, although
I suggest bringing your suggestion to the libcurl-devel mailing list where
----------------------------------------------------------------------
You can respond by visiting:
These mail archives are generated by hypermail. |
Page updated November 12, 2010.
web site info