From 15fbc7b6e35c1b0b4d25412546d4a1ef5219f17c Mon Sep 17 00:00:00 2001 From: Achim Kraus Date: Wed, 21 Sep 2022 16:43:48 +0200 Subject: [PATCH] Add message size to status-title. Signed-off-by: Achim Kraus --- .../californium/tools/GUIController.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cf-browser/src/main/java/org/eclipse/californium/tools/GUIController.java b/cf-browser/src/main/java/org/eclipse/californium/tools/GUIController.java index f7920a4..b7cb18d 100644 --- a/cf-browser/src/main/java/org/eclipse/californium/tools/GUIController.java +++ b/cf-browser/src/main/java/org/eclipse/californium/tools/GUIController.java @@ -959,7 +959,7 @@ private void showResponse(Response response, List path) { } text = links.toString(); if (!show) { - text = "(DISCOVER to update Resources for new host " + getHost() + ")\n" + text; + text = "(DISCOVER to update Resources for new host " + getHost() + ")\n" + text; } } catch (Throwable t) { LOG.error("Link response:", t); @@ -996,9 +996,7 @@ private void showResponse(Response response, List path) { if (!mediaTypeShown) { info += ", mediaType=" + mediaType; } - if (response.getBytes() != null) { - info += ", " + response.getBytes().length + " bytes."; - } + info += ", " + response.getPayloadSize() + "/" + response.getMessageSize() + " bytes."; responseTitle.setText(info); } @@ -1123,6 +1121,7 @@ private void showEndpointContext(String scheme, EndpointContext context) { private static final SimpleDateFormat FORMAT = new SimpleDateFormat("MMM d. HH:mm:ss [SSS]"); private class ResponsePrinter extends MessageObserverAdapter { + private final AtomicBoolean connect = new AtomicBoolean(); private final AtomicBoolean reconnect = new AtomicBoolean(); private final AtomicInteger retransmission = new AtomicInteger(); @@ -1145,9 +1144,9 @@ public void onReadyToSend() { text.append(" ").append(request.getType()); text.append(", token=").append(request.getTokenString()); text.append(", mid=").append(request.getMID()); - if (request.getBytes() != null) { - text.append(", ").append(request.getBytes().length).append(" bytes."); - } + text.append(", ").append(request.getPayloadSize()); + text.append("/").append(request.getMessageSize()); + text.append(" bytes."); requestTitle.setText(text.toString()); } }); @@ -1365,8 +1364,9 @@ public static String logMessage(Request request, Exception ex) { } private static class PathElement { - private String displayElement; - private String uriElement; + + private final String displayElement; + private final String uriElement; private PathElement(String uriElement) { this.uriElement = uriElement;