This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit c1aaa4ed16b6410a602074132c75da6c85d6a8ed Author: Mark Thomas <ma...@apache.org> AuthorDate: Mon Sep 21 14:52:33 2020 +0100 Consistent formatting of stream ID in HTTP/2 debug log messages --- java/org/apache/coyote/http2/AbstractStream.java | 11 ++++- .../coyote/http2/Http2AsyncUpgradeHandler.java | 4 +- .../apache/coyote/http2/Http2UpgradeHandler.java | 24 +++++----- java/org/apache/coyote/http2/Stream.java | 54 +++++++++++----------- java/org/apache/coyote/http2/StreamProcessor.java | 12 ++--- .../apache/coyote/http2/StreamStateMachine.java | 8 ++-- .../coyote/http2/WindowAllocationManager.java | 18 ++++---- webapps/docs/changelog.xml | 4 ++ 8 files changed, 73 insertions(+), 62 deletions(-) diff --git a/java/org/apache/coyote/http2/AbstractStream.java b/java/org/apache/coyote/http2/AbstractStream.java index 3c8c904..088d5b0 100644 --- a/java/org/apache/coyote/http2/AbstractStream.java +++ b/java/org/apache/coyote/http2/AbstractStream.java @@ -33,6 +33,7 @@ abstract class AbstractStream { private static final StringManager sm = StringManager.getManager(AbstractStream.class); private final Integer identifier; + private final String idAsString; private volatile AbstractStream parentStream = null; private final Set<Stream> childStreams = Collections.newSetFromMap(new ConcurrentHashMap<>()); @@ -41,6 +42,7 @@ abstract class AbstractStream { AbstractStream(Integer identifier) { this.identifier = identifier; + this.idAsString = identifier.toString(); } @@ -49,6 +51,11 @@ abstract class AbstractStream { } + final String getIdAsString() { + return idAsString; + } + + final int getIdAsInt() { return identifier.intValue(); } @@ -118,7 +125,7 @@ abstract class AbstractStream { if (log.isDebugEnabled()) { log.debug(sm.getString("abstractStream.windowSizeInc", getConnectionId(), - getIdentifier(), Integer.toString(increment), Long.toString(windowSize))); + getIdAsString(), Integer.toString(increment), Long.toString(windowSize))); } if (windowSize > ConnectionSettingsBase.MAX_WINDOW_SIZE) { @@ -141,7 +148,7 @@ abstract class AbstractStream { windowSize -= decrement; if (log.isDebugEnabled()) { log.debug(sm.getString("abstractStream.windowSizeDec", getConnectionId(), - getIdentifier(), Integer.toString(decrement), Long.toString(windowSize))); + getIdAsString(), Integer.toString(decrement), Long.toString(windowSize))); } } diff --git a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java index ff58a7e..951c21c 100644 --- a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java +++ b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java @@ -198,7 +198,7 @@ public class Http2AsyncUpgradeHandler extends Http2UpgradeHandler { @Override void writeBody(Stream stream, ByteBuffer data, int len, boolean finished) throws IOException { if (log.isDebugEnabled()) { - log.debug(sm.getString("upgradeHandler.writeBody", connectionId, stream.getIdentifier(), + log.debug(sm.getString("upgradeHandler.writeBody", connectionId, stream.getIdAsString(), Integer.toString(len))); } // Need to check this now since sending end of stream will change this. @@ -258,7 +258,7 @@ public class Http2AsyncUpgradeHandler extends Http2UpgradeHandler { if (ack) { if (!localSettings.ack()) { // Ack was unexpected - log.warn(sm.getString("upgradeHandler.unexpectedAck", connectionId, getIdentifier())); + log.warn(sm.getString("upgradeHandler.unexpectedAck", connectionId, getIdAsString())); } } else { socketWrapper.write(BlockingMode.SEMI_BLOCK, protocol.getWriteTimeout(), diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java b/java/org/apache/coyote/http2/Http2UpgradeHandler.java index 0d72451..b1c44d9 100644 --- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java +++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java @@ -665,10 +665,10 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH if (log.isDebugEnabled()) { if (pushedStreamId == 0) { log.debug(sm.getString("upgradeHandler.writeHeaders", connectionId, - stream.getIdentifier())); + stream.getIdAsString())); } else { log.debug(sm.getString("upgradeHandler.writePushHeaders", connectionId, - stream.getIdentifier(), Integer.valueOf(pushedStreamId), + stream.getIdAsString(), Integer.valueOf(pushedStreamId), Boolean.valueOf(endOfStream))); } } @@ -743,7 +743,7 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH void writeBody(Stream stream, ByteBuffer data, int len, boolean finished) throws IOException { if (log.isDebugEnabled()) { - log.debug(sm.getString("upgradeHandler.writeBody", connectionId, stream.getIdentifier(), + log.debug(sm.getString("upgradeHandler.writeBody", connectionId, stream.getIdAsString(), Integer.toString(len))); } @@ -911,7 +911,7 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH if (stream.isActive()) { if (log.isDebugEnabled()) { log.debug(sm.getString("upgradeHandler.noAllocation", - connectionId, stream.getIdentifier())); + connectionId, stream.getIdAsString())); } // No allocation // Close the connection. Do this first since @@ -932,7 +932,7 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH } catch (InterruptedException e) { throw new IOException(sm.getString( "upgradeHandler.windowSizeReservationInterrupted", connectionId, - stream.getIdentifier(), Integer.toString(reservation)), e); + stream.getIdAsString(), Integer.toString(reservation)), e); } } else { stream.waitForConnectionAllocationNonBlocking(); @@ -964,7 +964,7 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH for (AbstractStream stream : streamsToNotify) { if (log.isDebugEnabled()) { log.debug(sm.getString("upgradeHandler.releaseBacklog", - connectionId, stream.getIdentifier())); + connectionId, stream.getIdAsString())); } // There is never any O/P on stream zero but it is included in // the backlog as it simplifies the code. Skip it if it appears @@ -1021,7 +1021,7 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH private int allocate(AbstractStream stream, int allocation) { if (log.isDebugEnabled()) { log.debug(sm.getString("upgradeHandler.allocate.debug", getConnectionId(), - stream.getIdentifier(), Integer.toString(allocation))); + stream.getIdAsString(), Integer.toString(allocation))); } // Allocate to the specified stream BacklogTracker tracker = backLogStreams.get(stream); @@ -1034,7 +1034,7 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH if (log.isDebugEnabled()) { log.debug(sm.getString("upgradeHandler.allocate.left", - getConnectionId(), stream.getIdentifier(), Integer.toString(leftToAllocate))); + getConnectionId(), stream.getIdAsString(), Integer.toString(leftToAllocate))); } // Recipients are children of the current stream that are in the @@ -1053,7 +1053,7 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH for (AbstractStream recipient : recipients) { if (log.isDebugEnabled()) { log.debug(sm.getString("upgradeHandler.allocate.recipient", - getConnectionId(), stream.getIdentifier(), recipient.getIdentifier(), + getConnectionId(), stream.getIdAsString(), recipient.getIdAsString(), Integer.toString(recipient.getWeight()))); } totalWeight += recipient.getWeight(); @@ -1092,7 +1092,7 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH Stream result = streams.get(key); if (result == null && unknownIsError) { // Stream has been closed and removed from the map - throw new ConnectionException(sm.getString("upgradeHandler.stream.closed", key), + throw new ConnectionException(sm.getString("upgradeHandler.stream.closed", key.toString()), Http2Error.PROTOCOL_ERROR); } return result; @@ -1602,7 +1602,7 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH } catch (Http2Exception h2e) { stream.close(new StreamException(sm.getString( "upgradeHandler.windowSizeTooBig", connectionId, - stream.getIdentifier()), + stream.getIdAsString()), h2e.getError(), stream.getIdAsInt())); } } @@ -1618,7 +1618,7 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH if (!localSettings.ack()) { // Ack was unexpected log.warn(sm.getString( - "upgradeHandler.unexpectedAck", connectionId, getIdentifier())); + "upgradeHandler.unexpectedAck", connectionId, getIdAsString())); } } else { synchronized (socketWrapper) { diff --git a/java/org/apache/coyote/http2/Stream.java b/java/org/apache/coyote/http2/Stream.java index 5089456..7625624 100644 --- a/java/org/apache/coyote/http2/Stream.java +++ b/java/org/apache/coyote/http2/Stream.java @@ -178,8 +178,8 @@ class Stream extends AbstractStream implements HeaderEmitter { final void rePrioritise(AbstractStream parent, boolean exclusive, int weight) { if (log.isDebugEnabled()) { log.debug(sm.getString("stream.reprioritisation.debug", - getConnectionId(), getIdentifier(), Boolean.toString(exclusive), - parent.getIdentifier(), Integer.toString(weight))); + getConnectionId(), getIdAsString(), Boolean.toString(exclusive), + parent.getIdAsString(), Integer.toString(weight))); } // Check if new parent is a descendant of this stream @@ -213,8 +213,8 @@ class Stream extends AbstractStream implements HeaderEmitter { final void rePrioritise(AbstractStream parent, int weight) { if (log.isDebugEnabled()) { log.debug(sm.getString("stream.reprioritisation.debug", - getConnectionId(), getIdentifier(), Boolean.FALSE, - parent.getIdentifier(), Integer.toString(weight))); + getConnectionId(), getIdAsString(), Boolean.FALSE, + parent.getIdAsString(), Integer.toString(weight))); } parent.addChild(this); @@ -224,7 +224,7 @@ class Stream extends AbstractStream implements HeaderEmitter { final void receiveReset(long errorCode) { if (log.isDebugEnabled()) { - log.debug(sm.getString("stream.reset.receive", getConnectionId(), getIdentifier(), + log.debug(sm.getString("stream.reset.receive", getConnectionId(), getIdAsString(), Long.toString(errorCode))); } // Set the new state first since read and write both check this @@ -267,7 +267,7 @@ class Stream extends AbstractStream implements HeaderEmitter { while (windowSize < 1) { if (!canWrite()) { throw new CloseNowException(sm.getString("stream.notWritable", - getConnectionId(), getIdentifier())); + getConnectionId(), getIdAsString())); } if (block) { try { @@ -330,25 +330,25 @@ class Stream extends AbstractStream implements HeaderEmitter { @Override public final void emitHeader(String name, String value) throws HpackException { if (log.isDebugEnabled()) { - log.debug(sm.getString("stream.header.debug", getConnectionId(), getIdentifier(), + log.debug(sm.getString("stream.header.debug", getConnectionId(), getIdAsString(), name, value)); } // Header names must be lower case if (!name.toLowerCase(Locale.US).equals(name)) { throw new HpackException(sm.getString("stream.header.case", - getConnectionId(), getIdentifier(), name)); + getConnectionId(), getIdAsString(), name)); } if ("connection".equals(name)) { throw new HpackException(sm.getString("stream.header.connection", - getConnectionId(), getIdentifier())); + getConnectionId(), getIdAsString())); } if ("te".equals(name)) { if (!"trailers".equals(value)) { throw new HpackException(sm.getString("stream.header.te", - getConnectionId(), getIdentifier(), value)); + getConnectionId(), getIdAsString(), value)); } } @@ -360,14 +360,14 @@ class Stream extends AbstractStream implements HeaderEmitter { if (name.length() == 0) { throw new HpackException(sm.getString("stream.header.empty", - getConnectionId(), getIdentifier())); + getConnectionId(), getIdAsString())); } boolean pseudoHeader = name.charAt(0) == ':'; if (pseudoHeader && headerState != HEADER_STATE_PSEUDO) { headerException = new StreamException(sm.getString( - "stream.header.unexpectedPseudoHeader", getConnectionId(), getIdentifier(), + "stream.header.unexpectedPseudoHeader", getConnectionId(), getIdAsString(), name), Http2Error.PROTOCOL_ERROR, getIdAsInt()); // No need for further processing. The stream will be reset. return; @@ -383,7 +383,7 @@ class Stream extends AbstractStream implements HeaderEmitter { coyoteRequest.method().setString(value); } else { throw new HpackException(sm.getString("stream.header.duplicate", - getConnectionId(), getIdentifier(), ":method" )); + getConnectionId(), getIdAsString(), ":method" )); } break; } @@ -392,18 +392,18 @@ class Stream extends AbstractStream implements HeaderEmitter { coyoteRequest.scheme().setString(value); } else { throw new HpackException(sm.getString("stream.header.duplicate", - getConnectionId(), getIdentifier(), ":scheme" )); + getConnectionId(), getIdAsString(), ":scheme" )); } break; } case ":path": { if (!coyoteRequest.requestURI().isNull()) { throw new HpackException(sm.getString("stream.header.duplicate", - getConnectionId(), getIdentifier(), ":path" )); + getConnectionId(), getIdAsString(), ":path" )); } if (value.length() == 0) { throw new HpackException(sm.getString("stream.header.noPath", - getConnectionId(), getIdentifier())); + getConnectionId(), getIdAsString())); } int queryStart = value.indexOf('?'); String uri; @@ -430,7 +430,7 @@ class Stream extends AbstractStream implements HeaderEmitter { } catch (IllegalArgumentException iae) { // Host value invalid throw new HpackException(sm.getString("stream.header.invalid", - getConnectionId(), getIdentifier(), ":authority", value)); + getConnectionId(), getIdAsString(), ":authority", value)); } if (i > -1) { coyoteRequest.serverName().setString(value.substring(0, i)); @@ -440,7 +440,7 @@ class Stream extends AbstractStream implements HeaderEmitter { } } else { throw new HpackException(sm.getString("stream.header.duplicate", - getConnectionId(), getIdentifier(), ":authority" )); + getConnectionId(), getIdAsString(), ":authority" )); } break; } @@ -465,7 +465,7 @@ class Stream extends AbstractStream implements HeaderEmitter { } if (pseudoHeader) { headerException = new StreamException(sm.getString( - "stream.header.unknownPseudoHeader", getConnectionId(), getIdentifier(), + "stream.header.unknownPseudoHeader", getConnectionId(), getIdAsString(), name), Http2Error.PROTOCOL_ERROR, getIdAsInt()); } @@ -502,7 +502,7 @@ class Stream extends AbstractStream implements HeaderEmitter { if (coyoteRequest.method().isNull() || coyoteRequest.scheme().isNull() || coyoteRequest.requestURI().isNull()) { throw new ConnectionException(sm.getString("stream.header.required", - getConnectionId(), getIdentifier()), Http2Error.PROTOCOL_ERROR); + getConnectionId(), getIdAsString()), Http2Error.PROTOCOL_ERROR); } // Cookie headers need to be concatenated into a single header // See RFC 7540 8.1.2.5 @@ -607,7 +607,7 @@ class Stream extends AbstractStream implements HeaderEmitter { handler.getProtocol().getMaxTrailerSize()); } else { throw new ConnectionException(sm.getString("stream.trailerHeader.noEndOfStream", - getConnectionId(), getIdentifier()), Http2Error.PROTOCOL_ERROR); + getConnectionId(), getIdAsString()), Http2Error.PROTOCOL_ERROR); } } // Parser will catch attempt to send a headers frame after the stream @@ -626,7 +626,7 @@ class Stream extends AbstractStream implements HeaderEmitter { long contentLengthHeader = coyoteRequest.getContentLengthLong(); if (contentLengthHeader > -1 && contentLengthReceived > contentLengthHeader) { throw new ConnectionException(sm.getString("stream.header.contentLength", - getConnectionId(), getIdentifier(), Long.valueOf(contentLengthHeader), + getConnectionId(), getIdAsString(), Long.valueOf(contentLengthHeader), Long.valueOf(contentLengthReceived)), Http2Error.PROTOCOL_ERROR); } } @@ -635,7 +635,7 @@ class Stream extends AbstractStream implements HeaderEmitter { final void receivedEndOfStream() throws ConnectionException { if (isContentLengthInconsistent()) { throw new ConnectionException(sm.getString("stream.header.contentLength", - getConnectionId(), getIdentifier(), + getConnectionId(), getIdAsString(), Long.valueOf(coyoteRequest.getContentLengthLong()), Long.valueOf(contentLengthReceived)), Http2Error.PROTOCOL_ERROR); } @@ -721,7 +721,7 @@ class Stream extends AbstractStream implements HeaderEmitter { try { StreamException se = (StreamException) http2Exception; if (log.isDebugEnabled()) { - log.debug(sm.getString("stream.reset.send", getConnectionId(), getIdentifier(), + log.debug(sm.getString("stream.reset.send", getConnectionId(), getIdAsString(), se.getError())); } state.sendReset(); @@ -749,7 +749,7 @@ class Stream extends AbstractStream implements HeaderEmitter { */ final void recycle() { if (log.isDebugEnabled()) { - log.debug(sm.getString("stream.recycle", getConnectionId(), getIdentifier())); + log.debug(sm.getString("stream.recycle", getConnectionId(), getIdAsString())); } /* * Temporarily disabled due to multiple regressions (NPEs) @@ -877,7 +877,7 @@ class Stream extends AbstractStream implements HeaderEmitter { public final synchronized int doWrite(ByteBuffer chunk) throws IOException { if (closed) { throw new IllegalStateException( - sm.getString("stream.closed", getConnectionId(), getIdentifier())); + sm.getString("stream.closed", getConnectionId(), getIdAsString())); } // chunk is always fully written int result = chunk.remaining(); @@ -944,7 +944,7 @@ class Stream extends AbstractStream implements HeaderEmitter { throws IOException { if (log.isDebugEnabled()) { log.debug(sm.getString("stream.outputBuffer.flush.debug", getConnectionId(), - getIdentifier(), Integer.toString(buffer.position()), + getIdAsString(), Integer.toString(buffer.position()), Boolean.toString(writeInProgress), Boolean.toString(closed))); } if (buffer.position() == 0) { diff --git a/java/org/apache/coyote/http2/StreamProcessor.java b/java/org/apache/coyote/http2/StreamProcessor.java index 7eab7ee..94904c0 100644 --- a/java/org/apache/coyote/http2/StreamProcessor.java +++ b/java/org/apache/coyote/http2/StreamProcessor.java @@ -79,14 +79,14 @@ class StreamProcessor extends AbstractProcessor { if (!getErrorState().isConnectionIoAllowed()) { ConnectionException ce = new ConnectionException(sm.getString( "streamProcessor.error.connection", stream.getConnectionId(), - stream.getIdentifier()), Http2Error.INTERNAL_ERROR); + stream.getIdAsString()), Http2Error.INTERNAL_ERROR); stream.close(ce); } else if (!getErrorState().isIoAllowed()) { StreamException se = stream.getResetException(); if (se == null) { se = new StreamException(sm.getString( "streamProcessor.error.stream", stream.getConnectionId(), - stream.getIdentifier()), Http2Error.INTERNAL_ERROR, + stream.getIdAsString()), Http2Error.INTERNAL_ERROR, stream.getIdAsInt()); } stream.close(se); @@ -99,7 +99,7 @@ class StreamProcessor extends AbstractProcessor { } } catch (Exception e) { String msg = sm.getString("streamProcessor.error.connection", - stream.getConnectionId(), stream.getIdentifier()); + stream.getConnectionId(), stream.getIdAsString()); if (log.isDebugEnabled()) { log.debug(msg, e); } @@ -364,7 +364,7 @@ class StreamProcessor extends AbstractProcessor { @Override protected Object getStreamID() { - return stream.getIdentifier().toString(); + return stream.getIdAsString().toString(); } @@ -428,7 +428,7 @@ class StreamProcessor extends AbstractProcessor { protected final boolean flushBufferedWrite() throws IOException { if (log.isDebugEnabled()) { log.debug(sm.getString("streamProcessor.flushBufferedWrite.entry", - stream.getConnectionId(), stream.getIdentifier())); + stream.getConnectionId(), stream.getIdAsString())); } if (stream.flush(false)) { // The buffer wasn't fully flushed so re-register the @@ -472,7 +472,7 @@ class StreamProcessor extends AbstractProcessor { // triggered. StreamException se = new StreamException( sm.getString("streamProcessor.cancel", stream.getConnectionId(), - stream.getIdentifier()), Http2Error.CANCEL, stream.getIdAsInt()); + stream.getIdAsString()), Http2Error.CANCEL, stream.getIdAsInt()); handler.sendStreamReset(se); } } diff --git a/java/org/apache/coyote/http2/StreamStateMachine.java b/java/org/apache/coyote/http2/StreamStateMachine.java index 948e7cd..851e1a8 100644 --- a/java/org/apache/coyote/http2/StreamStateMachine.java +++ b/java/org/apache/coyote/http2/StreamStateMachine.java @@ -92,7 +92,7 @@ class StreamStateMachine { public synchronized void sendReset() { if (state == State.IDLE) { throw new IllegalStateException(sm.getString("streamStateMachine.debug.change", - stream.getConnectionId(), stream.getIdentifier(), state)); + stream.getConnectionId(), stream.getIdAsString(), state)); } if (state.canReset()) { stateChange(state, State.CLOSED_RST_TX); @@ -110,7 +110,7 @@ class StreamStateMachine { state = newState; if (log.isDebugEnabled()) { log.debug(sm.getString("streamStateMachine.debug.change", stream.getConnectionId(), - stream.getIdentifier(), oldState, newState)); + stream.getIdAsString(), oldState, newState)); } } } @@ -122,11 +122,11 @@ class StreamStateMachine { if (!isFrameTypePermitted(frameType)) { if (state.connectionErrorForInvalidFrame) { throw new ConnectionException(sm.getString("streamStateMachine.invalidFrame", - stream.getConnectionId(), stream.getIdentifier(), state, frameType), + stream.getConnectionId(), stream.getIdAsString(), state, frameType), state.errorCodeForInvalidFrame); } else { throw new StreamException(sm.getString("streamStateMachine.invalidFrame", - stream.getConnectionId(), stream.getIdentifier(), state, frameType), + stream.getConnectionId(), stream.getIdAsString(), state, frameType), state.errorCodeForInvalidFrame, stream.getIdAsInt()); } } diff --git a/java/org/apache/coyote/http2/WindowAllocationManager.java b/java/org/apache/coyote/http2/WindowAllocationManager.java index 973ce59..96016cc 100644 --- a/java/org/apache/coyote/http2/WindowAllocationManager.java +++ b/java/org/apache/coyote/http2/WindowAllocationManager.java @@ -68,7 +68,7 @@ class WindowAllocationManager { void waitForStream(long timeout) throws InterruptedException { if (log.isDebugEnabled()) { log.debug(sm.getString("windowAllocationManager.waitFor.stream", - stream.getConnectionId(), stream.getIdentifier(), Long.toString(timeout))); + stream.getConnectionId(), stream.getIdAsString(), Long.toString(timeout))); } waitFor(STREAM, timeout); @@ -78,7 +78,7 @@ class WindowAllocationManager { void waitForConnection(long timeout) throws InterruptedException { if (log.isDebugEnabled()) { log.debug(sm.getString("windowAllocationManager.waitFor.connection", - stream.getConnectionId(), stream.getIdentifier(), Long.toString(timeout))); + stream.getConnectionId(), stream.getIdAsString(), Long.toString(timeout))); } waitFor(CONNECTION, timeout); @@ -88,7 +88,7 @@ class WindowAllocationManager { void waitForStreamNonBlocking() { if (log.isDebugEnabled()) { log.debug(sm.getString("windowAllocationManager.waitForNonBlocking.stream", - stream.getConnectionId(), stream.getIdentifier())); + stream.getConnectionId(), stream.getIdAsString())); } waitForNonBlocking(STREAM); @@ -98,7 +98,7 @@ class WindowAllocationManager { void waitForConnectionNonBlocking() { if (log.isDebugEnabled()) { log.debug(sm.getString("windowAllocationManager.waitForNonBlocking.connection", - stream.getConnectionId(), stream.getIdentifier())); + stream.getConnectionId(), stream.getIdAsString())); } waitForNonBlocking(CONNECTION); @@ -141,7 +141,7 @@ class WindowAllocationManager { synchronized (stream) { if (waitingFor != NONE) { throw new IllegalStateException(sm.getString("windowAllocationManager.waitFor.ise", - stream.getConnectionId(), stream.getIdentifier())); + stream.getConnectionId(), stream.getIdAsString())); } waitingFor = waitTarget; @@ -164,7 +164,7 @@ class WindowAllocationManager { // Non-blocking post-processing may attempt to flush } else { throw new IllegalStateException(sm.getString("windowAllocationManager.waitFor.ise", - stream.getConnectionId(), stream.getIdentifier())); + stream.getConnectionId(), stream.getIdAsString())); } } @@ -174,7 +174,7 @@ class WindowAllocationManager { private void notify(int notifyTarget) { if (log.isDebugEnabled()) { log.debug(sm.getString("windowAllocationManager.notify", stream.getConnectionId(), - stream.getIdentifier(), Integer.toString(waitingFor), Integer.toString(notifyTarget))); + stream.getIdAsString(), Integer.toString(waitingFor), Integer.toString(notifyTarget))); } synchronized (stream) { @@ -191,14 +191,14 @@ class WindowAllocationManager { // Blocking, so use notify to release StreamOutputBuffer if (log.isDebugEnabled()) { log.debug(sm.getString("windowAllocationManager.notified", - stream.getConnectionId(), stream.getIdentifier())); + stream.getConnectionId(), stream.getIdAsString())); } stream.notify(); } else { // Non-blocking so dispatch if (log.isDebugEnabled()) { log.debug(sm.getString("windowAllocationManager.dispatched", - stream.getConnectionId(), stream.getIdentifier())); + stream.getConnectionId(), stream.getIdAsString())); } response.action(ActionCode.DISPATCH_WRITE, null); // Need to explicitly execute dispatches on the StreamProcessor diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index b8124a8..6dd713f 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -96,6 +96,10 @@ response if the Connector was configured with <code>maxSwallowSize=-1</code>. (markt) </fix> + <fix> + When logging HTTP/2 debug messages, use consistent formatting for stream + idnetifiers. (markt) + </fix> </changelog> </subsection> <subsection name="Jasper"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org