Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http.get/post connection close #72

Closed
bla-ckbox opened this issue May 3, 2013 · 3 comments
Closed

http.get/post connection close #72

bla-ckbox opened this issue May 3, 2013 · 3 comments
Assignees

Comments

@bla-ckbox
Copy link

http.get/post functions do not close http connection when the server sends the "Connection: close" header.

@ghost ghost assigned toots May 4, 2013
@toots
Copy link
Member

toots commented May 11, 2013

Hi,

I'm not sure how to reproduce this. All http requests' sockets are closed after one request, which is not optimal but should thus not entail the issue your describing.

Could tell us more about your issue and how to reproduce it? Thanks!

@bla-ckbox
Copy link
Author

Hello

I use http.post for scrobbling on a function called by on_metadata. My problem is that the server where are sent data takes a long time to respond causing "We must catchup" messages.

Scrobbing serveur sends http header "Connection: close" to release the client but liquidsoap does not take into account and waits for the server closes the connection.

In php, you can send "Connection: close" like this

<?php
ignore_user_abort(true);
ob_start();
header("Connection: close", true);
header("Content-Length: 0", true);
ob_end_flush();
flush();
// Client must close the connection

// Continue processing after
Sleep(25);
echo("Text user will never see");

A workaround is to use curl (he takes "Connection: close" into account) in system function.

@toots toots closed this as completed in 7477f17 May 17, 2013
@toots
Copy link
Member

toots commented May 17, 2013

Last commit should have fixed this issue. Please re-open if needed..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants