forked from signalapp/libsignal-service-java
-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
@Override
public synchronized void onMessage(WebSocket webSocket, ByteString payload) {
Log.w(TAG, "WSC onMessage()");
try {
WebSocketMessage message = WebSocketMessage.parseFrom(payload.toByteArray());
Log.w(TAG, "Message Type: " + message.getType().getNumber());
if (message.getType().getNumber() == WebSocketMessage.Type.REQUEST_VALUE) {
incomingRequests.add(message.getRequest());
} else if (message.getType().getNumber() == WebSocketMessage.Type.RESPONSE_VALUE) {
SettableFuture<Pair<Integer, String>> listener = outgoingRequests.get(message.getResponse().getId());
if (listener != null) listener.set(new Pair<>(message.getResponse().getStatus(),
new String(message.getResponse().getBody().toByteArray())));
}
notifyAll();
} catch (InvalidProtocolBufferException e) {
Log.w(TAG, e);
}Whenever we send a message it gets added to outgoingRequests, so that the settable future can be fulfilled when confirmation arrives. However, even if it does, the reference to the future is not removed from the map, that only happens in onClosed - which I assume does not happen frequently when the ws connection is permanently open, e.g. in signal-cli in debus mode or Signal-Android without play services (?).
cc @golf1052 @mitchcapper our libsignal is affected by this issue as well
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels