<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p><tt>It's the same process doing both the connect and the
transfer. The problem is that libcurl, as it stands now,<br>
is not able to give me a file descriptor to poll on, until it
connects [1]. See this section:<br>
<br>
"When libcurl returns -1 in max_fd, it is because libcurl
currently does something that isn't possible<br>
for your application to monitor with a socket and unfortunately
you can then not know exactly when the<br>
current action is completed using select(). You then need to
wait a while before you proceed and call<br>
curl_multi_perform anyway. How long to wait? Unless
curl_multi_timeout gives you a lower number, we<br>
suggest 100 milliseconds or so, but you may want to test it out
in your own particular conditions to<br>
find a suitable value."</tt></p>
<p><tt>Regarding your issue: I would investigate further the reason
why the connect is hanging, and not getting<br>
rejected immediately when your server is down. That would solve
all your blocking issues.</tt></p>
<p><tt>The same with MySQL connections which go down: only after the
connection is up are we able to obtain<br>
its file descriptor to asynchronously poll on. So if connect to
DB_HOST:3306 hangs, so will OpenSIPS.<br>
</tt></p>
<p><tt>Regards,<br>
</tt></p>
<p><tt>[1]: </tt><tt><a
href="https://curl.haxx.se/libcurl/c/curl_multi_fdset.html">https://curl.haxx.se/libcurl/c/curl_multi_fdset.html</a></tt></p>
<pre class="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<div class="moz-cite-prefix">On 25.06.2019 18:41, Ben Newlin wrote:<br>
</div>
<blockquote type="cite"
cite="mid:4D9686A3-C7F3-4316-B9AF-C938797D6D78@genesys.com"><span
style="font-size:11.0pt">but I guess my question would be why
isn’t the entire operation run in async? Why must the connect be
performed in the current process and only the transfer be in
another process?</span></blockquote>
</body>
</html>