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

socket hangs on "<station>.status" if request for URL gets no response from http.input source #367

Closed
liquidpeter opened this issue Nov 20, 2016 · 4 comments
Assignees

Comments

@liquidpeter
Copy link

liquidpeter commented Nov 20, 2016

We are using telnet command station.url [url] to dynamically set an HTTP input URL.
Afterwards we use station.status to check if the url is polling, matchs to the URL set before, and further checks.
In case a HTTP request to the URL gets no response from audio stream server, the status command in telnet interface will hang and not return. This will result the client in hanging, too.
A workaround at client is to read from liquidsoap telnet interface using a timeout. From user view it would be better if the status command returns after some time, if connection status cannot be received.

@toots
Copy link
Member

toots commented Jan 9, 2017

Hi,

Is the station.status a custom telnet command? We have asynchronous functionalities that it may be possible to use here..

@toots toots self-assigned this Jan 11, 2017
@liquidpeter
Copy link
Author

liquidpeter commented Mar 3, 2017

source.status is the built-in input.http telnet command.
In opposite to source.url it does not just contain the URL value, but additionally the current status like "polling" or "connected". If the source URL does not respond, the "status" call will hang.
source.url works, but it does not contain the current status nor the URL.
The issue occurs if the source stream hangs and you can connect but get no response from it.

an example script:

`set("log.stdout", true)
set("log.file", false)

set("server.telnet", true)
set("server.telnet.port", 1234)
set("server.telnet.bind_addr", "127.0.0.1")

radio = input.http(id="station", "http://127.0.0.1:8000/radio")
radio = audio_to_stereo(radio)
radio = mksafe(radio)
output.dummy(fallible=true, radio);

$ telnet localhost 1234

station.status
polling
END

station.url http://not-responding-url:8000
Done
END

station.url
http://not-responding-url:8000
END

station.status
... hangs ...`

@patrykkrz
Copy link

I have the same problem in version 1.3.3.
How to avoid this? Do you have a solution for this?

@toots
Copy link
Member

toots commented Mar 21, 2019

Thanks for the report and insisting. I have just pushed a fix that will go with the next 1.3.7 bugfix release.

@toots toots closed this as completed Mar 21, 2019
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

3 participants