Skip to content
Browse files

Add note about dispatches to stale HTTP requests

An HTTP request that have timed out will still be alive within
libspotify and libspotify will try to dispatch the result to the dead HTTP
request. Either

  1) unregister any sp_playlist_callbacks to prevent dispatching to stale
     requests, or
  2) add a single "dead-end handler" to all stale requests that does
     clean-up and whatnot
  • Loading branch information...
1 parent 08588a5 commit ff006e5433a7469017d5683444b39ad92b4a10b6 @liesen committed May 7, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 server.c
3 server.c
@@ -147,6 +147,9 @@ static void send_error_sp(struct evhttp_request *request,
static void handle_request_timeout(int fd, short ev, void *userdata) {
+ // TODO(liesen): unregister playlist callbacks to make sure the request
+ // isn't dispatched after having timed out (pass sp_playlist in
+ // playlist_handler struct)
struct playlist_handler *handler = userdata;
struct evhttp_request *request = handler->request;
syslog(LOG_DEBUG, "%s [timeout]\n", evhttp_request_get_uri(request));

0 comments on commit ff006e5

Please sign in to comment.
Something went wrong with that request. Please try again.