Skip to content

Commit 6cb5960

Browse files
committed
Synchronize on Zeroconf requests (#229)
1 parent 2dba753 commit 6cb5960

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

core/src/main/java/xyz/gianlu/librespot/core/ZeroconfServer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ private boolean hasValidSession() {
230230
}
231231
}
232232

233-
private void handleGetInfo(OutputStream out, String httpVersion) throws IOException {
233+
private synchronized void handleGetInfo(OutputStream out, String httpVersion) throws IOException {
234234
JsonObject info = DEFAULT_GET_INFO_FIELDS.deepCopy();
235235
info.addProperty("activeUser", hasValidSession() ? session.username() : "");
236236
info.addProperty("deviceID", inner.deviceId);
@@ -252,7 +252,7 @@ private void handleGetInfo(OutputStream out, String httpVersion) throws IOExcept
252252
out.flush();
253253
}
254254

255-
private void handleAddUser(OutputStream out, Map<String, String> params, String httpVersion) throws GeneralSecurityException, IOException {
255+
private synchronized void handleAddUser(OutputStream out, Map<String, String> params, String httpVersion) throws GeneralSecurityException, IOException {
256256
String username = params.get("userName");
257257
if (username == null || username.isEmpty()) {
258258
LOGGER.fatal("Missing userName!");

0 commit comments

Comments
 (0)