mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[GH-ISSUE #37] unwraps in network code #25
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#25
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sashahilton00 on GitHub (Jan 29, 2018).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/37
Saturday Nov 12, 2016 at 17:32 GMT
Originally opened as https://github.com/plietar/librespot/issues/127
The network-related code (e.g. in
session.rs) uses unwrap, even in places where failure is kinda likely. For example:Connection resets are a normal thing, esp. in Wifi-environments. So the
recvmethod should probably return a Result-type instead and the layer above (poll) should handle failed connection attempts, e.g. by reconnect/retry.@sashahilton00 commented on GitHub (Jan 29, 2018):
Saturday Nov 12, 2016 at 17:33 GMT
Apart from it, I can happily report that librespot runs perfectly on a ODROID-C2, which is an AArch64 platform 😃
@sashahilton00 commented on GitHub (Jan 29, 2018):
Saturday Nov 12, 2016 at 17:53 GMT
Yeah, I wrote librespot while I was still reverse engineering the protocol, so these issues weren't really my priority.
There's a lot of things I'm not too happy with in the code, including this, but I don't really have much time to work on it. One day though ...
Glad to hear it still works 😄
@sashahilton00 commented on GitHub (Jan 29, 2018):
Saturday Nov 19, 2016 at 21:49 GMT
FYI, I'm working on a (partial) rewrite which should be much better at handling network issues
@sashahilton00 commented on GitHub (Jan 29, 2018):
Tuesday Jan 10, 2017 at 19:22 GMT
I am getting the "Connection reset by peer", too. Any idea why the connection is reset? How can the panic be handled properly?
@sashahilton00 commented on GitHub (Jan 29, 2018):
Friday Jan 13, 2017 at 06:47 GMT
I guess the reset means that either the Spotify server directly or some node in between cuts the TCP connection. This ain't uncommon, expecially when the server suffers under high loads. Network problems are (IMHO) such normal that they shouldn't produce a panic. But as @plietar already mentioned, proof of concept code does hit always follow this rule.
@ComlOnline commented on GitHub (Jan 29, 2018):
Please see #103 for more on this issue.