sf::Http::sendRequest never returns
<p>I've written a simple web service using <a href="http://pistache.io/" rel="nofollow noreferrer"><code>pistache</code></a>. I'm seding requests to it using <a href="http://www.sfml-dev.org/documentation/2.4.1/classsf_1_1Http.php" rel="nofollow noreferrer"><code>sf::Http</code></a> and <a href="http://www.sfml-dev.org/documentation/2.4.1/classsf_1_1Http_1_1Request.php" rel="nofollow noreferrer"><code>sf::Http::Request</code></a> classes. However, call of <code>sf::Http::sendRequest</code> never returns, even though I specified a 250 ms timeout. The thing happens only with requests to my website. If I send <code>GET</code> request to <a href="http://www.google.com" rel="nofollow noreferrer">www.google.com</a> the method returns correct response quite quickly.</p>

<p>Here's the client-side code sample:</p>

<pre><code>sf::Http http("http://192.168.1.10", 8080);
sf::Http::Request request("/highscores", sf::Http::Request::Method::Get);
request.setHttpVersion(1, 1);
//the call below never returns
auto response = http.sendRequest(request, sf::seconds(0.25f));
std::cout &lt;&lt; response.getBody();
</code></pre>

<p>The service response seems correct in browser and in curl:</p>

<pre><code>$ curl -v 192.168.1.10:8080/highscores
*   Trying 192.168.1.10...
* Connected to 192.168.1.10 (192.168.1.10) port 8080 (#0)
&gt; GET /highscores HTTP/1.1
&gt; Host: 192.168.1.10:8080
&gt; User-Agent: curl/7.47.1
&gt; Accept: */*
&gt; 
&lt; HTTP/1.1 200 OK
&lt; Content-Type: application/json
&lt; Connection: Keep-Alive
&lt; Content-Length: 2
&lt; 
* Connection #0 to host 192.168.1.10 left intact
[]%      
</code></pre>

<p>Using <code>strace</code> on my application shows that it sends correct request and even at some point it receives the correct response:</p>

<pre><code>$ strace -s 192 ./sfmlApplication
...
sendto(20, "GET /highscores HTTP/1.1\r\nconnection: close\r\ncontent-length: 0\r\ncontent-type: application/json\r\nfrom: user@sfml-dev.org\r\nhost: 192.168.1.10\r\nuser-agent: libsfml-network/2.x\r\n\r\n", 176, MSG_NOSIGNAL, NULL, 0) = 176
recvfrom(20, "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\nConnection: Keep-Alive\r\nContent-Length: 2\r\n\r\n[]", 1024, MSG_NOSIGNAL, NULL, NULL) = 96
recvfrom(20, 
</code></pre>

<p>These are the last lines from <code>strace</code> output, after <code>recvfrom(20,</code> the program stops responding and has to be killed. </p>

<p>And the top of stack trace of blocked operation is:</p>

<pre><code>recv() at 0x7ffff7bcd10f    
sf::TcpSocket::receive() at 0x7ffff77b12c0  
sf::Http::sendRequest() at 0x7ffff77ad5ed   
</code></pre>

<p>SFML Version: 2.3.2</p>

<p>System: Fedora 4.8.4-200.fc24.x86_64</p>

<p><strong>Any ideas why the <code>sf::Http::sendRequest</code> method call never returns?</strong></p>