Re: Is there an easy way to separate request / response processing with libCurl?

2012-01-27 Thread Alan Wolfe
Hey Burt, LOL it sounds like they really are being odd about things and not trusting your judgement like they ought to.. :P Anyways, your questions regarding the multi interface... You can actually use the fd stuff w/ the multi interface as well (have you seen this page? http://curl.haxx.se/libc

Re: Is there an easy way to separate request / response processing with libCurl?

2012-01-27 Thread Alan Wolfe
Thanks Daniel! On Fri, Jan 27, 2012 at 1:23 PM, Daniel Stenberg wrote: > On Fri, 27 Jan 2012, Alan Wolfe wrote: > > But, I personally use curl_multi_info_read >> http://curl.haxx.se/libcurl/c/**curl_multi_info_read.html<http://curl.haxx.se/libcurl/c/curl_multi_info_re

Re: Linking issue

2012-02-15 Thread Alan Wolfe
i just did this the other day and sorry i am just running out the door but if i recall correctly, there was a "library" directory that contained the project for just libcurl. I was able to build the lib and dlls from that (both flavors worked) the instructions on how to build libcurl on windows f

Re: Only want to open TCP port

2012-02-22 Thread Alan Wolfe
I think it is possible actually! Libcurl supports telnet, which is essentially what you want. I dont have any info on hand but try google or the libcurl site and see if you can find some more info about how to do telnet with libcurl On Wed, Feb 22, 2012 at 8:08 PM, Gaylord Yu wrote: > I have i

Re: Best practices for using curl multi api

2012-03-20 Thread Alan Wolfe
i never use fd set when using the multi interface (but your mileage may require variance!) I just always call multi preform each frame and read the messages to know when something has finished. When going this route, the code is more of a "busy wait" loop instead of a nice "sleep until there is d

Re: Testing Curl put for Rest with XML

2012-04-06 Thread Alan Wolfe
In case you dont get a better response, have you thought about putting both those items into one peice of XML? I mean for instance this: foosomething On Fri, Apr 6, 2012 at 7:21 PM, Rajesh Khan wrote: > The following cul command works when i am passing a single XML object > curl -X PUT -HConte

Re: Basic help.

2012-04-28 Thread Alan Wolfe
specifically... size is the size of one data item, nmemb is the number of data items. all you really need to worry about is (size * nmemb) That's how many bytes total there are. Hope that helps! On Sat, Apr 28, 2012 at 7:10 PM, Jim Lloyd wrote: > Yes. The function signature is the same signat

Re: "The Most Dangerous Code in the World"

2012-10-24 Thread Alan Wolfe
Playing devil's advocate... well engineered code makes it harder, or impossible to do the wrong thing, by accident or on purpose. For instance, well named enums and enum values instead of "magic numbers" are always better for function parameters. That being said... I use libcurl quite a bit and l

Re: "The Most Dangerous Code in the World"

2012-10-28 Thread Alan Wolfe
Would it be possible to have the function take an enum instead of an int on top of whatever other solution you guys use? Its really telling watching this conversation how useful it would be. You guys are talking about 0, 1 and 2 which is completely meaningless without reading documentation or sou

Re: Reciving buffer size less than CURL_MAX_WRITE_SIZE

2013-01-05 Thread Alan Wolfe
Actually i think i know what your issue is. Curl is single threaded, even if you use the multi interface. If you are doing a bunch of work in the callback function, that means that the main thread (the only thread) is doing that, and not processing data waiting on the line etc. Also, usually it'

Re: Help, before I cry myself to death

2013-02-04 Thread Alan Wolfe
No idea on this issue specifically (sorry), but a handy little tip... if you ever want to defeat caching (like as a temporary work around...) you can append a random number onto the end of a URL and that basically defeats every single caching mechanism there is. For instance instead of: http://myu

Re: 15 years

2013-03-20 Thread Alan Wolfe
I expect in 15 years the topic will be "30 years - from FTP to FTL" Thanks for making such a great library Daniel! On Mar 20, 2013 7:44 AM, "Daniel Stenberg" wrote: > Hi friends, > > At this day, 15 years ago, I uploaded the first release of curl to the > world. > > I had played around with diff

Re: curl_multi_wait seems to be ignoring timeout

2013-05-07 Thread Alan Wolfe
It's a common scapegoat for mysterious problems, but have you considered that this might be a memory stomping problem? Something else corrupting memory causing select to malfunction. If you have a minimal program that is making this problem appear, you might check your data callback to make sure

Re: Question about cacert.pem on Windows with MinGW

2013-05-13 Thread Alan Wolfe
A dumb question, but just in case... did you build or download a windows libcurl binaries that have SSL enabled? There are licensing issues around SSL support so some windows binaries you can download don't have SSL enabled. On Mon, May 13, 2013 at 1:13 PM, Thomas Mayer wrote: > Hello, > > I am

Re: Regarding Usage of Custom Application Layer in Internet Protocol Suite

2013-05-31 Thread Alan Wolfe
You ought to google web sockets. Basically, with web sockets you have the initial overhead of an http request and response, but then the connection doesn't close and you can send and receive data (true bidirectional communication) all day long without the overhead of http. One of the benefits of

Compiling libcurl on unsupported platform

2010-08-19 Thread Alan Wolfe
Hey Guys, I'm looking to compile libcurl on a platform that doesnt seem to be currently supported (xbox 360) I was wondering, where would someone start with the "port" to a new platform? Is there a specific file that has the os specific functionality? I noticed the os-specific.c / .h but that d

Re: Compiling libcurl on unsupported platform

2010-08-19 Thread Alan Wolfe
Thu, Aug 19, 2010 at 11:20 AM, Daniel Stenberg wrote: > On Thu, 19 Aug 2010, Alan Wolfe wrote: > >> I'm looking to compile libcurl on a platform that doesnt seem to be >> currently supported (xbox 360) > > Isn't that running something similar to win32? > >&

libcurl and ssl

2010-08-19 Thread Alan Wolfe
Another question for you guys... I've noticed that some binaries have SSL support and others don't. I know there is some kind of legal or licensing issue associated with using SSL with libcurl but never really quite understood what it was. I was looking at this page but it didnt really clear it

Re: Compiling libcurl on Windows

2010-08-23 Thread Alan Wolfe
Heya! Compiling libcurl in windows for me was amazingly easy. I just downloaded the source and there was a dsw file. I opened it and MSVC said it was old and needed to be converted and i said ok. After that i just selected what flavor (Debug or Release and Static or Dynamic) and it compiled str

Re: curl_easy_perform occasionally responds even though the PC is disconnected from the network

2010-09-20 Thread Alan Wolfe
Do you think you could be seeing a cached response? On Sep 20, 2010 8:27 AM, "Johnny Beardsmore" wrote: Hi, I'm using the following (abreviated) code: //** curl_easy_reset(curl); curl_wr_error = curl_wr_index = 0; // setup curl options curl_eas

Re: curl_easy_perform occasionally responds even though the PC is disconnected from the network

2010-09-20 Thread Alan Wolfe
pe that helps, someone else may have some more insight too. On Mon, Sep 20, 2010 at 8:30 AM, Alan Wolfe wrote: > Do you think you could be seeing a cached response? > > On Sep 20, 2010 8:27 AM, "Johnny Beardsmore" wrote: > &g

Re: curl_easy_perform occasionally responds even though the PC is disconnected from the network

2010-09-20 Thread Alan Wolfe
I was thinking of caching happening at the OS level. Is that a possibility? On Mon, Sep 20, 2010 at 9:31 AM, Daniel Stenberg wrote: > On Mon, 20 Sep 2010, Alan Wolfe wrote: > >> To expand on that, i'm thinking if you are making a request with the same >> URL after di

Re: Locking and multi on multiple connections.

2010-12-08 Thread Alan Wolfe
Lock as in your computer freezes up and never comes back? Michael you are not really giving very good info and your attitude is bordering on belligerent... I apologize if english isn't your main language, i know that can cause communication issues :P On Wed, Dec 8, 2010 at 2:46 PM, Michael Meneg

Re: libcurl waits indefinitely for data

2011-01-10 Thread Alan Wolfe
"Can't I do some timout ? e.g. libcurl will return after 60 seconds or so whether it did or did not get the data ?" you can if you are using the multi interface. The multi interface lets you make requests that happen in the background and so if it takes too long you can just go on with your life

initializing SSL

2011-01-13 Thread Alan Wolfe
Hey Guys, I was wondering, what is the proper way to initialize ssl? Is it by passing the right flag to curl_global_init or are there other ways too? Thanks! --- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette:

Re: The future of the project

2011-01-14 Thread Alan Wolfe
No problems here. BTW i have used your lib for so much awesome stuff. Over the last couple years I've been using it to do content sharing / stat reporting from within video games. libcurl talking to a LAMP server = easy mode (but for some reason other game developers look at the results and thin

Re: initializing SSL

2011-01-14 Thread Alan Wolfe
Thanks Daniel! On Fri, Jan 14, 2011 at 2:54 AM, Daniel Stenberg wrote: > On Thu, 13 Jan 2011, Alan Wolfe wrote: > > I was wondering, what is the proper way to initialize ssl? >> >> Is it by passing the right flag to curl_global_init or are there other >> ways too?

Re: Patch: Get the OpenSSL errcode if SSL context creation fails.

2011-01-18 Thread Alan Wolfe
I agree the "CURLE_OUT_OF_MEMORY" is pretty misleading. I hit this problem last week and had to step through the source to see what the problem was. On Tue, Jan 18, 2011 at 7:39 AM, Bjoern Sikora wrote: > Hi folks, > > attached a simple patch to get the real OpenSSL errcode if SSL context > crea

Re: how to get the libcurl up and running in my C code.

2011-02-03 Thread Alan Wolfe
Heya, http://curl.haxx.se/libcurl/c/example.html I googled "libcurl FTP tutorial" and it was the 2nd result. The first result might also be of interest to you but ::shrug:: this link has the example code you were looking for. On Thu, Feb 3, 2011 at 6:12 AM, goeie spullen wrote: > Hi, Let me in

Re: compiling with C++ compiler

2011-02-03 Thread Alan Wolfe
What compiler are you using? Using microsoft visual studio i dont get the errors you are, it compiles just fine as C++ for me. On Thu, Feb 3, 2011 at 2:28 PM, Prashant R wrote: > I know that this library was intended to compile in C however I have > certain limitations where this needs to be co

multi interface perf question

2011-02-04 Thread Alan Wolfe
Hey Guys, I'm using the libcurl multi interface on windows and was wondering, how does it work under the hood? Specifically I was wondering, does it run requests on another thread or does it just use a small time slice each frame? I'm noticing something in my application where if i have a tight

Re: multi interface perf question

2011-02-04 Thread Alan Wolfe
ut not sure how much, or how that amount of time might vary from system to system. On Fri, Feb 4, 2011 at 11:55 AM, Alan Wolfe wrote: > Hey Guys, > > I'm using the libcurl multi interface on windows and was wondering, how > does it work under the hood? > > Specifically I

Re: multi interface perf question

2011-02-04 Thread Alan Wolfe
unch! On Fri, Feb 4, 2011 at 2:03 PM, Dan Fandrich wrote: > On Fri, Feb 04, 2011 at 01:29:28PM -0800, Alan Wolfe wrote: > > Quick update... i notice that if i tick the multi interface 20 times per > frame > > instead of just once, i get response time back down to the 2-3 second &g

Re: multi interface perf question

2011-02-04 Thread Alan Wolfe
ld be going on? On Fri, Feb 4, 2011 at 2:40 PM, Alan Wolfe wrote: > i'm doing a select before the curl_multi_perform with a small timeout (10 > usec's) > > Now of course it seems obvious what the problem is hehe... i probably > should be using more than 10usec's if

Re: multi interface perf question

2011-02-06 Thread Alan Wolfe
Awesome, that's probably what's going wrong then. I can't wait to give that a try. Thanks a ton! On Sun, Feb 6, 2011 at 2:18 PM, Daniel Stenberg wrote: > On Fri, 4 Feb 2011, Alan Wolfe wrote: > > so i do have a select before my curl_multi_perform with a timeout of >

Re: Modifying the example source code

2011-02-27 Thread Alan Wolfe
Heya, the malloc(1) isn't being stingy. As the comments say, it will be resized with realloc calls later on. Basically, it allocates a single byte so there's a valid memory address in chunk.memory so that realloc can be called on it later on. If it started out NULL, there would have to be an if

Re: Cancelling a callback function

2011-02-27 Thread Alan Wolfe
Hey there again. curel_easy_perform will block until the request is finished, so there is no danger of your callback getting called after the free. If ever you don't want to block your program execution while a request happens, you can check out the multi interface. >From what it sounds like, bl

Re: Cancelling a callback function

2011-02-27 Thread Alan Wolfe
oh and what i mean by saying that curl_easy_perform "blocks" is just that, by the time curl_easy_perform is done and your code moves to the next statement, your request will be finished, all your callbacks will have been called, etc. On Sun, Feb 27, 2011 at 10:30 PM, Alan Wolfe wr

Re: Why does multi_curl_perform return CURLE_UNSUPPORTED_PROTOCOL

2011-03-07 Thread Alan Wolfe
Doesn't this make you wish that C/C++ could more easily enforce type safety between different enums?? I wonder how much dev time has been lost in the world because someone was mistakenly comparing 2 different enums together. On Mon, Mar 7, 2011 at 2:31 PM, Daniel Stenberg wrote: > On Mon, 7 Mar

Re: COMET Support

2011-03-18 Thread Alan Wolfe
Yep... To reinforce what our fearless leader Daniel said, comet as i understand it (and have implemented it in the past in ajax type situations) is just the server delaying the response for a time if no data is currently available so that the client and server can have more "real time" type commun

Re: Need help for implementing full duplex support using libcurl

2011-03-20 Thread Alan Wolfe
Not sure if this will solve your issue but are you aware of the multi interface? On Sun, Mar 20, 2011 at 12:23 PM, ajil koshy wrote: > Hi, > > I have just started using libcurl library. I had a question about how we can > implement full duplex communication using libcurl library. I have writting

Re: happy anniversary!

2011-03-20 Thread Alan Wolfe
Yeah i second that! Daniel, w/o libcurl i have no idea what us folks trying to do HTTP from c++ would do (not to mention the other uses). The world would be a much darker place. On Sun, Mar 20, 2011 at 3:11 PM, Lou Picciano wrote: > Daniel, > Happy Anniversary! Even 'Happy Birthday', dare I say

Re: Potential integer overflow with write callback

2011-03-26 Thread Alan Wolfe
16 bits?? thats tiny you sure about that? fwiw size_t is 64 bits on my machine On Sat, Mar 26, 2011 at 6:37 PM, wrote: > Hi everyone, > > My write callback function looks like this: > > size_t writehttpcallback ( void *ptr, size_t size, size_t nmemb, void *data) > { >  size_t realsize = siz

Is the multi interface multithreaded?

2011-04-08 Thread Alan Wolfe
Hey Guys, I was wondering... is the multi interface multithreaded behind the scenes at all or does it all work on a single thread? Thank you!! Alan --- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://cur

Re: Is the multi interface multithreaded?

2011-04-08 Thread Alan Wolfe
Daniel <3 (: On Fri, Apr 8, 2011 at 2:17 PM, Daniel Stenberg wrote: > On Fri, 8 Apr 2011, Alan Wolfe wrote: > >> I was wondering... is the multi interface multithreaded behind the scenes >> at all or does it all work on a single thread? > > It a

Re: Language

2011-04-25 Thread Alan Wolfe
it sounds like you are getting utf8 encoded characters probably. google how to convert from utf8 characters to wide characters (i think there's a simple way to do it with std::string's) and i bet that'll give you what you want On Mon, Apr 25, 2011 at 6:42 AM, darekg11 wrote: > Hi, I have sent ma

Re: Sending password and username

2011-05-03 Thread Alan Wolfe
Essentially you have to look at how the site itself sends the username and password in the http request, and then mimic that http request with libcurl. libcurl does HTTP but it doesn't parse html or fill out web forms. On Tue, May 3, 2011 at 10:49 AM, darekg11 wrote: > Hi, how can I send passwor

Re: download a file like in popup-dialog?

2011-05-04 Thread Alan Wolfe
there may be some trickery in the download dialog - like it uses javascript to fire off the download. if so, you need to figure out what the final URL of the file you are actually getting is, and do a curl request to that file location. (View the page source to figure out what's going on) they ma

Re: Can I send only part of a file?

2011-05-09 Thread Alan Wolfe
it'll truncate the uploaded file yeah, but thats what Saqib is lookin for :P the local file that you are uploading will be untouched. you are just lying and telling curl you reached the end of file via the callback return, you aren't actually altering the source file. On Mon, May 9, 2011 at 11:1

Re: curl_multi_perform - how to know if data is entirely sent.

2011-05-19 Thread Alan Wolfe
the still_running int will drop to 0 when the request is complete. just have a loop something like this... while(still_running > 0) { Sleep(50); //yield the processor //dont forget to pump libcurl in this loop (i forget the function name) } or of course, you can do work inside the while loop

Re: curl_multi_perform - how to know if data is entirely sent.

2011-05-19 Thread Alan Wolfe
determine when the request is completely transferred. > > Thanks > > > On 5/20/11, Alan Wolfe wrote: >> the still_running int will drop to 0 when the request is complete. >> >> just have a loop something like this... >> >> while(still_running > 0) >

Re: CURLOPT_WRITEFUNCTION - cannot make it working...

2011-06-04 Thread Alan Wolfe
There has to be something crazy going on because if i'm reading this correctly... if what you said is how it worked for everyone else (i know it isn't how it works for me, or how the docs say it should work), there would be some really BIG problems with using libcurl :P your 3.07e+9 value sounds f

Re: How to scale libcurl to several thousand https connections without blocking select ()

2011-06-06 Thread Alan Wolfe
If what you are saying is what it's really doing, and no one else suggests anything, you might also try going multithreaded. Libcurl is thread safe with a few caveats (check out this page for more info http://curl.haxx.se/libcurl/features.html) On Mon, Jun 6, 2011 at 11:30 AM, Jimish Shah wrote:

Re: performance: curl_easy vs curl_multi

2011-06-11 Thread Alan Wolfe
Just to toss my 2 cents in I hit this sort of problem a couple months ago, where the multi interface took way longer than it should have to get the results. The problem if i recall correctly was that i was using too small of a timeout in my select() but i could be mistaken. On Sat, Jun 11, 2011 a

Re: curl_easy vs curl_multi - performance

2011-06-13 Thread Alan Wolfe
Out of curiosity Paolo could you elaborate on the nature of the bug? was it that select() wasn't getting enough time or something? Thanks man (: On Mon, Jun 13, 2011 at 2:34 PM, Paolo Piacentini wrote: > I want to report that I discovered a BUG in my code. > > Everything is now back to normal

Re: Curl Issue..........

2011-07-20 Thread Alan Wolfe
On Jul 20, 2011 11:28 PM, "Sumukh Anantha Manohar" wrote: Hi, I am trying to download files whose size is greater than 2GB using curl API's like curl_easy_perform ( ) and curl_easy_setopt ( ) on linux and unix platforms using c++ language. The problem is, the above functions are helping me to do

Re: maximizing performance when issuing a large number of GET/PUT requests to a single server

2011-08-11 Thread Alan Wolfe
also hey you might want to profile things to see where your bottle necks are before attempting a solution. like for instance, if your hard drive is the slow part, and it's 100% utilized, adding more threads isnt going to make the read head move any faster. just being able to see if it's CPU, stor

Re: High latency and buffer size

2011-08-17 Thread Alan Wolfe
Unfortunately all you can really do is buffer more up before beginning playback. If its latency issues and not connection speed that's the problem, buffering should fix it nicely (: On Aug 17, 2011 10:32 PM, "Konrad Scorciapino" wrote: Hi there! My music player uses libcurl to play shoutcast

Re: High latency and buffer size

2011-08-18 Thread Alan Wolfe
I dont know what i was thinking, please listen to Daniel and ignore my comment :P Like he says, if it's just latency that is the problem, you shouldn't have any issues once the data starts coming. If the problem is that you don't have enough bandwidth, you need to either buffer more up before sta

Re: Cancel request in process

2011-09-13 Thread Alan Wolfe
Is it a divide by zero crash? Look what happens in your code when utotal is 0. On Sep 13, 2011 1:06 AM, "Oleksiy" wrote: int ProgressShow(int (*fun)(double data), double dltotal, double dlnow, double ultotal, double ulnow) { printf("%f / %f (%g %%)\n", ulnow, ultotal, ulnow*100.0/ultotal);

Re: Multi-threading

2011-09-28 Thread Alan Wolfe
only a partial answer but have you seen this page? http://curl.haxx.se/libcurl/features.html libcurl is designed and implemented entirely thread safe. There are some considerations to keep in mind when using libcurl in multiple threads though, as mentioned below: *Never* share libcurl handles be

Re: A note from your maintainer

2011-10-06 Thread Alan Wolfe
DANIEL HELP I HAVE A QUESTION Teasing! Have a good one man. On Thu, Oct 6, 2011 at 5:09 PM, William Betts wrote: > On Thu, Oct 6, 2011 at 10:03 AM, Daniel Stenberg wrote: > >> Hey friends, >> >> I'm off on vacation for a week starting tomorrow. Have patience, take an >> extra beer and I'll be

Re: Please advise on how to improve libcurl HTTP GET performance

2011-10-10 Thread Alan Wolfe
Without seeing the code, 2 things come to mind #1 - Does your program block at all on disk i/o (are you reading or writing to the disk?) if so that could be bottlenecking your D/L. #2 - Are you sure the problem is on your end, not the server side? If you show us your code we can probably help a l

Re: Please advise on how to improve libcurl HTTP GET performance

2011-10-10 Thread Alan Wolfe
curl_easy_perform(curl); > stop = clock(); > curl_easy_cleanup(curl); } > > cout << "Download speed: " << page.byteArray().getSize() * 1000 / > ((stop - start) * 1024) << " KB/s\n"; > } > The code still looks p

Re: Please advise on how to improve libcurl HTTP GET performance

2011-10-10 Thread Alan Wolfe
Maybe give this a shot... the command line curl has an option that makes it spit out c code that you can compile with libcurl. You could do that and see if you get better performance. If so, you can try changing things til it goes slow again, or just use that code as a basis for your code >From

Re: [C/C++] Problem to use curl with Visual 2010

2011-10-10 Thread Alan Wolfe
not sure if it will help, but your program and libcurl need to match for some compilation settings. #1 - you need to use the same CLR (runtime). If you use "multithreaded debug dll" in your program, but libcurl is compiled with "multithreaded debug" for instance, that will cause problems. #2 - m

Re: [C/C++] Problem to use curl with Visual 2010

2011-10-11 Thread Alan Wolfe
Im glad it works! You probably want to get the release flavors matching and use that instead of the debug. You should even be able to link to the release libs from your debug exe i believe. If you use debug versions of the libraries (and your code), it will run slower, although maybe not in any

Re: Please advise on how to improve libcurl HTTP GET performance

2011-10-11 Thread Alan Wolfe
Hey Dan, FYI he ran curl with --libcurl so that it created some source code to use with libcurl to do the same request. With that code unmodified and his libraries he built, he got the slow transfer rate he saw before. With the curl command line utility he gets about 10x as much speed. On Tue,

Re: Please advise on how to improve libcurl HTTP GET performance

2011-10-11 Thread Alan Wolfe
Thats actually a really good point. Maybe libcurl is displaying kilo BITS per second, and you are calculating kilo BYTES per second. Bandwidth is often expressed in Kb, not KB and aprox 30-40KB/sec == aprox. 300Kb/sec which fits with your numbers! On Tue, Oct 11, 2011 at 1:28 PM, Vladimir Grishc

Re: Please advise on how to improve libcurl HTTP GET performance

2011-10-12 Thread Alan Wolfe
and just to make sure... are you building the release version of libcurl, and have rtti and exceptions turned off, optimizations turned on (on by default in release) and no crazy options turned on such as GS (stack checking) On Wed, Oct 12, 2011 at 1:07 AM, Guenter wrote: > Am 11.10.2011 22:13,

Re: Calling SOAP webservice from C++ using libcurl

2011-10-19 Thread Alan Wolfe
Check out this page Suneepa, particularly "Anatomy of a Soap Request". http://www.ibm.com/developerworks/webservices/library/ws-peer3/index.html That shows examples with java, which you can follow, or just ignore. Once you understand how SOAP works at it's core, it should be trivial to implement

Re: PNG Image resolution

2011-12-29 Thread Alan Wolfe
Hi there. That stuff you are seeing is the contents of the png file, like you would see if you looked at the png file in text editor. I believe the solution is that you need to set your http headers to appropriate values to display an image. Try putting this line at the very top of your php: He