Skip to content

Commit 2fbc075

Browse files
committed
rxtx/sdp: stop the server with stopServer
consult the commit 924150a
1 parent aab015d commit 2fbc075

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

src/utils/sdp.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
/**
4343
* @file
4444
* @todo
45-
* * consider using serverStop() to stop the thread - likely doesn't work now
4645
* * createResponseForRequest() should be probably static (in case that other
4746
* modules want also to use EmbeddableWebServer)
4847
* @todo
@@ -470,7 +469,7 @@ static THREAD_RETURN_TYPE STDCALL_ON_WIN32 acceptConnectionsThread(void* param)
470469
sin6->sin6_port = htons(portInHostOrder);
471470
}
472471
acceptConnectionsUntilStopped(param, (struct sockaddr *) &ss, sa_len);
473-
log_msg(LOG_LEVEL_WARNING, "Warning: HTTP/SDP thread has exited.\n");
472+
MSG(VERBOSE, "Warning: HTTP/SDP thread has exited.\n");
474473
return (THREAD_RETURN_TYPE) 0;
475474
}
476475

@@ -560,13 +559,7 @@ void sdp_stop_http_server(struct sdp *sdp)
560559
if (!sdp->server_started) {
561560
return;
562561
}
563-
///@todo use "serverStop(&sdp->http_server);" instead
564-
serverMutexLock(&sdp->http_server);
565-
sdp->http_server.shouldRun = false;
566-
serverMutexUnlock(&sdp->http_server);
567-
pthread_cancel(sdp->http_server_thr);
568-
569-
pthread_join(sdp->http_server_thr, NULL);
562+
serverStop(&sdp->http_server);
570563
}
571564
#endif // defined SDP_HTTP
572565

0 commit comments

Comments
 (0)