Usman Raza | 1 Jul 04:49 2012
Picon

Re: Chunked Transfer read callback pause

Thanks Dan, i ended up using the same approach as you have suggested, and it works great.Thanks for the reaffirmation.

On Sun, Jul 1, 2012 at 12:59 AM, Dan Fandrich <dan <at> coneharvesters.com> wrote:
On Sat, Jun 30, 2012 at 06:47:38PM +0500, Usman Raza wrote:
> Hello all, im using curl for chunked transfer in a separate thread, by reading
> from a buffer, could anyone tell me how could i pause it, so i could maybe
> switch to another thread (which will write to the buffer) and then switch back
> to resume transfer? i did came across the curl_easy_pause(CURL *handle , int
> bitmask ) function which could be used with returning CURL_READFUNC_PAUSE from
> a callback, but im not sure how i can use it to accomplish thread
> synchronization.Appreciate any help on this.Thanks.

libcurl is inherently paused while in a callback, so if you're just using
the easy interface and therefore have just a single transfer
outstanding, you can ignore curl_easy_pause and just do your thread
synchronization within the read callback. Simply don't return from that
callback with valid data until it's available!  You can do any sort
of synchronization you want in that callback, just don't return before
the data is ready.

>>> Dan
-------------------------------------------------------------------
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
Marc Hoersken | 1 Jul 09:53 2012
Picon

gitignore: Added files generated by mingw32, eclipse and VC

Hello everyone,

I updated the .gitignore file to exclude files generated by mingw32,
eclipse and VC.

Would be great if someone could push it to the main repo. Thanks in advance!

Best regards,
Marc
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Peter Sylvester | 1 Jul 10:09 2012
Picon
Picon

Re: Chunked Transfer read callback pause

On 06/30/2012 03:47 PM, Usman Raza wrote:
> Hello all, im using curl for chunked transfer in a separate thread, by reading from a buffer, 
> could anyone tell me how could i pause it, so i could maybe switch to another thread (which will 
> write to the buffer) and then switch back to resume transfer? i did came across the 
> curl_easy_pause(CURL *handle , int bitmask ) function which could be used with returning 
> CURL_READFUNC_PAUSE from a callback, but im not sure how i can use it to accomplish thread 
> synchronization.Appreciate any help on this.Thanks.
You might want to take a look into the multi interface. you might be able to avoid all thread logic.
a loop with selects  calls to the necessary functions when your data or buffers are ready.

Peter Sylvester

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

pjoshi | 1 Jul 10:32 2012
Picon

Re:

Thanks Jeff for your advice. After going through stack trace in visual
studio, by doing a break all,
 This is what was actually happening.
 1. I was using same curl_handler for 3 requests, one for creating a
session and next 2 for getting responses, from two other web service
operations.
 2. After the first request as described in my earlier email,
 3. Now in the second and third request I was using writer callback
functions through CURL_EASYSETOPT to write the received contents in
buffer, which was internally using write system call. The code was getting
stuck up (hang state) here itself without crashing.
 4. first request which I was using is to create a session with user
credentials being passed in request and using the same cookies in next 2
requests.

Workaround:
 1. I didnt make any changes in writer function and instead of calling it
in second and third request through CURL_EASY_SETOPT, i associated the
writer function with the first request and it worked.

 Daniel: As per your email, the libcurl version we are using, is 7.26.0.
Possibly i dont know any issue in server side, as that has been developed
by a vendor of ours. Also i forgot to mention that code did use to run
for 45 minutes, without any issue. It was after first 45 minutes, that
issue would surface. Strange. Neways, the workaround mentioned above, did
work as after that, we could run the code continuously for 41 hours.

 Regards,

 Preetam.

> My suggestion would be to use CURLOPT_DEBUGFUNCTION to enable logging,
and in the
> debug function, print out or otherwise log the data received to find out
how far the
> library is getting.
> On 6/29/2012 3:19 AM, pjoshi <at> servowatch.co.uk wrote:
>> Hello, I am using libcurl with my C++ program on Visual Studio 2010
environment and my code hangs on curl_easy_perform inspite of
specifying
>> timeout.
>> curl_handler = curl_easy_init();																//Curl handler
>> initialization.
>> 		if(curl_handler)																{
>> 		curl_easy_setopt(curl_handler, CURLOPT_HTTPHEADER, header);
>> 		curl_easy_setopt(curl_handler, CURLOPT_URL,url_ptr);
>> 		curl_easy_setopt(curl_handler, CURLOPT_POSTFIELDS, xmlstuff);
curl_easy_setopt(curl_handler, CURLOPT_NOSIGNAL,0);
>> 		curl_easy_setopt(curl_handler, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_easy_setopt(curl_handler, CURLOPT_COOKIEFILE, "cookiefile.txt");
curl_easy_setopt(curl_handler, CURLOPT_COOKIEJAR, "cookiefile.txt");
curl_easy_setopt(curl_handler, CURLOPT_CONNECTTIMEOUT_MS,6000);
response = curl_easy_perform(curl_handler);
>>                  /*Other Logic follows*/
>> }
>> Any clues ?
> ------------------------------------------------------------------- List
admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette:  http://curl.haxx.se/mail/etiquette.html
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.

--

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Marc Hoersken | 1 Jul 11:38 2012
Picon

Makefile.m32: Run del and copy commands through cmd

Hello everyone,

here is a follow-up patch to my previous .gitignore patch. It makes it
possible to build and clean curl using the eclipse CDT MinGW
compatible compiler tool chain.

It introduces one small regression: The del command will now show
errors/warnings if a file cannot be deleted since I was unable to find
a way to redirect stderr from a mingw32-make that is not executing
under cmd process.

Best regards,
Marc
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Marc Hoersken | 1 Jul 12:00 2012
Picon

Re: warning: ISO C does not support the 'I64' ms_printf length modifier

Hi Guenter,

2012/6/30 Guenter <lists <at> gknw.net>:
> so my build has the additional flag -Wno-pedantic-ms-format - my guess is
> that this might fix the warnings for your build too, and that your compiler
> is not correctly detected as mingw in configure, probably due to no correct
> triplet (i586-mingw32msvc-gcc vs. i686-pc-mingw32-gcc) ...

i586-mingw32msvc may not be a valid triplet, but that is the name
Debian uses for the mingw32 toolchain.

> BTW. would be nice if you could add your gcc version to the autobuild
> description too ...

Yes, I just added the GCC version to the description of my Linux and
Windows builds (both on Debian 6).

Best regards,
Marc
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

SM | 1 Jul 12:36 2012
Picon

Re: SMTP recipient issues

At 09:57 15-06-2012, Dan wrote:
>A slightly off topic question about smtp: I haven't seen anything 
>about UTF-8 Support through SMTP- is this already supported or 
>something that would need to be added on?

That would require a mail server which supports EAI.

Regards,
-sm 

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Guenter | 1 Jul 13:41 2012
Picon

Re: Makefile.m32: Run del and copy commands through cmd

Hi Marc,
Am 01.07.2012 11:38, schrieb Marc Hoersken:
> here is a follow-up patch to my previous .gitignore patch. It makes it
> possible to build and clean curl using the eclipse CDT MinGW
> compatible compiler tool chain.
>
> It introduces one small regression: The del command will now show
> errors/warnings if a file cannot be deleted since I was unable to find
> a way to redirect stderr from a mingw32-make that is not executing
> under cmd process.
can we please put this on hold? I've in mind to change the makefiles in 
a way so that they can also run from MSYS or Linux bash, and this will 
exactly tweak at these commands ...
give me a day or two for looking into it - I did this recently already 
for the libssh2 makefiles, and want to sync the libcurl ones ...

Gün.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Guenter | 1 Jul 13:47 2012
Picon

Re: warning: ISO C does not support the 'I64' ms_printf length modifier

Marc,
Am 01.07.2012 12:00, schrieb Marc Hoersken:
> 2012/6/30 Guenter<lists <at> gknw.net>:
>> so my build has the additional flag -Wno-pedantic-ms-format - my guess is
>> that this might fix the warnings for your build too, and that your compiler
>> is not correctly detected as mingw in configure, probably due to no correct
>> triplet (i586-mingw32msvc-gcc vs. i686-pc-mingw32-gcc) ...
>
> i586-mingw32msvc may not be a valid triplet, but that is the name
> Debian uses for the mingw32 toolchain.
no, its not related - as I posted in my follow-up ...

> Yes, I just added the GCC version to the description of my Linux and
> Windows builds (both on Debian 6).
ah, thanks! now seems clear: 4.4.4 seems not to support the 
-Wno-pedantic-ms-format flag; it seems this was introduced with 4.5.x:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25502

Gün.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Usman Raza | 1 Jul 16:31 2012
Picon

Re: Chunked Transfer read callback pause

Will check it out ! ty.

On Sun, Jul 1, 2012 at 1:09 PM, Peter Sylvester <peter.sylvester <at> edelweb.fr> wrote:
On 06/30/2012 03:47 PM, Usman Raza wrote:
Hello all, im using curl for chunked transfer in a separate thread, by reading from a buffer, could anyone tell me how could i pause it, so i could maybe switch to another thread (which will write to the buffer) and then switch back to resume transfer? i did came across the curl_easy_pause(CURL *handle , int bitmask ) function which could be used with returning CURL_READFUNC_PAUSE from a callback, but im not sure how i can use it to accomplish thread synchronization.Appreciate any help on this.Thanks.
You might want to take a look into the multi interface. you might be able to avoid all thread logic.
a loop with selects  calls to the necessary functions when your data or buffers are ready.

Peter Sylvester


-------------------------------------------------------------------
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

Gmane