On 21-Jun-15 12:35 AM, (( \/\/|||"'""/'")) ((\"""" )) (( ))\\\"\\"\ wrote:
Libcurl is just a wrapper around OpenSSL, and forgive me if I'm wrong,
but it looks like the only original functionality libcurl has is to
verify certificates (which doesn't work that well either... try
verifying yahoo's cert...).
I had this same problem using libcurl and their awkward, over
complicated callback scheme.
>>> Yes. Its very complicated scheme they have implemented.
OpenSSL has sockets more or less identical to send()/recv() API, so
you can read data directly from a socket, and no need to deal with
header callback, body callback, write callback, blah blah etc.
IMHO - while correct to libcurl's functions Ray Satiro's answer
highlights how incredibly over complicated such simple tasks are
w/libcurl.
This code has faults but is enough to get you started. You can get
size, etc straight from the socket.
http://savetheions.com/2010/01/16/quickly-using-openssl-in-c/
If you want to roll code yourself to verify certs, you can find a lot
of info/links to various code samples on OpenSSL's site.
On Fri, Jun 19, 2015 at 8:12 PM, Daniel Stenberg <[email protected]
<mailto:[email protected]>> wrote:
On Fri, 19 Jun 2015, Ganesh Nikam wrote:
1. What do you mean by "as much as possible" here ? how
libcurl decides it ?
It depends completley on what it receives. For every recv() call
(and some other details Jay mentioned), libcurl will call the
callback to deliver data.
2. In my case, my complete http response boby is of 2155
bytes. For such small response also libcurl breaks the message
in two callbacks. First with 1295 byte and other is 860 byte.
What could be the reasons for
calling callback two times for such small message size?
Most probably libcurl received the data in two different recv() calls.
3. I want to get the complete http response in single
write_callbck function.
libcurl doesn't work like that.
is there is any way to get the complete size of the http
response ?
Sure, for example like this:
http://curl.haxx.se/libcurl/c/getinmemory.html
My http server sends response in chunked encoding. is there
a way to get the chunked response size ?
You can switch off transfer-encoding in libcurl, and then you get
all the chunked data to deal with - but then you also have to do
the entire chunked decoding yourself.
--
/ daniel.haxx.se <http://daniel.haxx.se>
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html