cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Infinite loop when calling curl_multi_cleanup

From: Miloš Ljumović <milos_at_expert.its.me>
Date: Wed, 19 Oct 2016 01:16:53 +0200

"Your example is not complete, but based on what you have provided here
is what you should look at:"
Yes - as I said, pseudo code. It was meant to give you an idea.

"Strings passed to libcurl as 'char *' arguments, are copied by the
library" [1] with the exception of CURLOPT_POSTFIELDS."
This is what I needed to know. Thanks!

"If your program is crashing when you delete the buffer after setting it
as the URL then the problem is elsewhere."
Program is not crashing. Try it.

"Handles. You must never share the same handle in multiple threads. You
can pass the handles around among threads, but you must never use a
single handle from more than one thread at any given time."
I'm not sharing handles. Take a look at ServerProc. That's the thread
responsible for multi_* interface. It's the only thread operating on
hMultiHandle without protection. While other threads that uses
PushRequest are locking the section where they use hMultiHandle. If
libcurl is thread safe then my concept is fine.

"Also, I notice you didn't give your curl_version() information. libcurl
is continuously improving, and so is nghttp2. I would try the latest of
both."

7.51.0 - DEV
openssl - 1.0.2h
nghttp2 1.15.0

As I said - I have no problems. Program is working fine. After I added
"connclose" in close_all_connections as suggested at the begging of this
email chain - everything worked fine.

Though I was worried that maybe I haven't implemented:
multi_perform
multi_wait
multi_read

in a way they were intended. That's all.
Try the program (in the attachment) and we'll continue discussion.

-- 
Miloš Ljumović
Operating systems specialist Spec.App.
http://milos.expert.its.me


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

Received on 2016-10-19