Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log ip #811

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions java/org/apache/coyote/http2/Http2AsyncParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class Http2AsyncParser extends Http2Parser {
private volatile Throwable error = null;

Http2AsyncParser(String connectionId, Input input, Output output, SocketWrapperBase<?> socketWrapper,
Http2AsyncUpgradeHandler upgradeHandler) {
super(connectionId, input, output);
Http2AsyncUpgradeHandler upgradeHandler, String rip) {
super(connectionId, input, output, rip);
this.socketWrapper = socketWrapper;
socketWrapper.getSocketBufferHandler().expand(input.getMaxFrameSize());
this.upgradeHandler = upgradeHandler;
Expand Down
4 changes: 2 additions & 2 deletions java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public void failed(Throwable t, Void attachment) {
};

@Override
protected Http2Parser getParser(String connectionId) {
return new Http2AsyncParser(connectionId, this, this, socketWrapper, this);
protected Http2Parser getParser(String connectionId, String rip) {
return new Http2AsyncParser(connectionId, this, this, socketWrapper, this, rip);
}


Expand Down
6 changes: 4 additions & 2 deletions java/org/apache/coyote/http2/Http2Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,19 @@ class Http2Parser {
protected final String connectionId;
protected final Input input;
private final Output output;
private final String rip;
private final byte[] frameHeaderBuffer = new byte[9];

private volatile HpackDecoder hpackDecoder;
private volatile ByteBuffer headerReadBuffer = ByteBuffer.allocate(Constants.DEFAULT_HEADER_READ_BUFFER_SIZE);
private volatile int headersCurrentStream = -1;
private volatile boolean headersEndStream = false;

Http2Parser(String connectionId, Input input, Output output) {
Http2Parser(String connectionId, Input input, Output output, String rip) {
this.connectionId = connectionId;
this.input = input;
this.output = output;
this.rip = rip;
}


Expand Down Expand Up @@ -328,7 +330,7 @@ protected void readSettingsFrame(int flags, int payloadSize, ByteBuffer buffer)
Setting key = Setting.valueOf(id);
if (key == Setting.UNKNOWN) {
log.warn(sm.getString("connectionSettings.unknown", connectionId, Integer.toString(id),
Long.toString(value)));
Long.toString(value), rip));
}
output.setting(key, value);
}
Expand Down
13 changes: 7 additions & 6 deletions java/org/apache/coyote/http2/Http2UpgradeHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ public void init(WebConnection webConnection) {
if (log.isTraceEnabled()) {
log.trace(sm.getString("upgradeHandler.init", connectionId, connectionState.get()));
}

if (!connectionState.compareAndSet(ConnectionState.NEW, ConnectionState.CONNECTED)) {
return;
}
Expand All @@ -202,9 +201,8 @@ public void init(WebConnection webConnection) {
queuedRunnable = new ConcurrentLinkedQueue<>();
}

parser = getParser(connectionId);

Stream stream = null;
String rip = "-";

socketWrapper.setReadTimeout(protocol.getReadTimeout());
socketWrapper.setWriteTimeout(protocol.getWriteTimeout());
Expand All @@ -216,6 +214,7 @@ public void init(WebConnection webConnection) {
try {
// Process the initial settings frame
stream = getStream(1, true);
rip = stream.getCoyoteRequest().getRequestProcessor().getRemoteAddr();
String base64Settings = stream.getCoyoteRequest().getHeader(HTTP2_SETTINGS_HEADER);
byte[] settings = Base64.getUrlDecoder().decode(base64Settings);

Expand All @@ -228,7 +227,7 @@ public void init(WebConnection webConnection) {
Setting key = Setting.valueOf(id);
if (key == Setting.UNKNOWN) {
log.warn(sm.getString("connectionSettings.unknown", connectionId, Integer.toString(id),
Long.toString(value)));
Long.toString(value), rip));
}
remoteSettings.set(key, value);
}
Expand All @@ -237,6 +236,8 @@ public void init(WebConnection webConnection) {
}
}

parser = getParser(connectionId, rip);

// Send the initial settings frame
writeSettings();

Expand Down Expand Up @@ -275,8 +276,8 @@ protected void processConnection(WebConnection webConnection, Stream stream) {
}
}

protected Http2Parser getParser(String connectionId) {
return new Http2Parser(connectionId, this, this);
protected Http2Parser getParser(String connectionId, String rip) {
return new Http2Parser(connectionId, this, this, rip);
}


Expand Down
2 changes: 1 addition & 1 deletion java/org/apache/coyote/http2/LocalStrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ connectionSettings.enablePushInvalid=Connection [{0}], The requested value for e
connectionSettings.headerTableSizeLimit=Connection [{0}], Attempted to set a header table size of [{1}] but the limit is 16k
connectionSettings.maxFrameSizeInvalid=Connection [{0}], The requested maximum frame size of [{1}] is outside the permitted range of [{2}] to [{3}]
connectionSettings.noRfc7540PrioritiesInvalid=Connection [{0}], The requested no RFC 7540 priorities setting [{1}] was not zero or one
connectionSettings.unknown=Connection [{0}], An unknown setting with identifier [{1}] and value [{2}] was ignored
connectionSettings.unknown=Connection [{0}], An unknown setting with identifier [{1}] and value [{2}] was ignored from ip [{3}]
connectionSettings.windowSizeTooBig=Connection [{0}], The requested window size of [{1}] is bigger than the maximum permitted value of [{2}]

frameType.checkPayloadSize=Payload size of [{0}] is not valid for frame type [{1}]
Expand Down
2 changes: 1 addition & 1 deletion java/org/apache/coyote/http2/LocalStrings_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ connectionPrefaceParser.mismatch=Una sequencia de byte no esperada fue recibida
connectionSettings.debug=Conexión [{0}], Parámetro tipo [{1}] fijado a [{2}]
connectionSettings.headerTableSizeLimit=La conexión [{0}], intentó fijar un tamaño de cabecera de [{1}] pero el límite es 16k\n
connectionSettings.maxFrameSizeInvalid=Conexión [{0}], El tamaño de cuadro máximo solicitado de [{1}] esta fuera del rango permitido de [{2}] hasta [{3}]\n
connectionSettings.unknown=Conexión [{0}], Un parámetro desconocido con identificador [{1}] y valor [{2}] fue ignorado\n
connectionSettings.unknown=Conexión [{0}], Un parámetro desconocido con identificador [{1}] y valor [{2}] fue ignorado, ip [{3}]\n

hpack.invalidCharacter=El carácter Unicode [{0}] en el punto del código [{1}] no puede ser codificado al estar fuera del rango permitido de 0 a 255.

Expand Down
2 changes: 1 addition & 1 deletion java/org/apache/coyote/http2/LocalStrings_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ connectionSettings.enablePushInvalid=Connection [{0}], La valeur demandée pour
connectionSettings.headerTableSizeLimit=La Connection [{0}] a essayé de configurer une taille de [{1}] pour la table des en-têtes (headers), mais la limite est 16k
connectionSettings.maxFrameSizeInvalid=Connection [{0}], la taille maximum de trame demandée [{1}] est en-dehors des limites permises [{2}] - [{3}]
connectionSettings.noRfc7540PrioritiesInvalid=Connection [{0}], Le paramètre "no RFC 7540 priorities" [{1}] n''était pas zéro ou un
connectionSettings.unknown=Connection [{0}], Un paramètre inconnu avec l''identifiant [{1}] et la valeur [{2}] a été ignoré
connectionSettings.unknown=Connection [{0}], Un paramètre inconnu avec l''identifiant [{1}] et la valeur [{2}] a été ignoré, ip [{3}]
connectionSettings.windowSizeTooBig=Connection [{0}], La taille de fenêtre demandée [{1}] est plus grande que la valeur maximale autorisée [{2}]

frameType.checkPayloadSize=La taille de données [{0}] n''est pas valide pour une trame de type [{1}]
Expand Down
2 changes: 1 addition & 1 deletion java/org/apache/coyote/http2/LocalStrings_ja.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ connectionSettings.enablePushInvalid=コネクション[{0}]、有効プッシ
connectionSettings.headerTableSizeLimit=コネクション [{0}]、ヘッダーテーブルサイズに [{1}] を指定されましたが上限は 16k です。
connectionSettings.maxFrameSizeInvalid=コネクション [{0}]、要求された最大フレームサイズ [{1}] は可能な範囲の [{2}] から [{3}] を超えています。
connectionSettings.noRfc7540PrioritiesInvalid=接続 [{0}] では、要求された RFC 7540 優先度設定 [{1}] が 0 でも 1 でもありませんでした
connectionSettings.unknown=コネクション [{0}]、未知の設定名 [{1}] の値 [{2}] を無視しました。
connectionSettings.unknown=コネクション [{0}]、未知の設定名 [{1}] の値 [{2}] を無視しました。, ip [{3}]
connectionSettings.windowSizeTooBig=コネクション [{0}]、要求されたウインドウサイズ [{1}] は上限値 [{2}] を越えています。

frameType.checkPayloadSize=[{0}] のペイロードサイズがフレームタイプ [{1}] に無効です
Expand Down
2 changes: 1 addition & 1 deletion java/org/apache/coyote/http2/LocalStrings_ko.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ connectionSettings.debug=연결 [{0}]: 파라미터 타입 [{1}]을(를) [{2}](
connectionSettings.enablePushInvalid=연결 [{0}], enablePush를 위해 요청된 값 [{1}]은(는), 허용된 값들(0 또는 1) 중의 하나가 아닙니다.
connectionSettings.headerTableSizeLimit=연결 [{0}]: 헤더 테이블 크기로 [{1}]을(를) 설정하려 시도했으나, 한계값은 16k입니다.
connectionSettings.maxFrameSizeInvalid=연결 [{0}]: [{1}]의 요청된 최대 프레임 크기가 허용된 범위([{2}] - [{3}])의 바깥에 존재합니다.
connectionSettings.unknown=연결 [{0}]: 식별자가 [{1}](이)고 값이 [{2}]인 알 수 없는 설정이 무시되었습니다.
connectionSettings.unknown=연결 [{0}]: 식별자가 [{1}](이)고 값이 [{2}]인 알 수 없는 설정이 무시되었습니다, ip [{3}].
connectionSettings.windowSizeTooBig=연결 [{0}]: 요청된 윈도우 크기 [{1}]이(가) 최대 허용치 [{2}] 보다 큽니다.

frameType.checkPayloadSize=Payload의 크기 [{0}]은(는) 프레임 타입 [{1}]을(를) 위해 유효하지 않습니다.
Expand Down
2 changes: 1 addition & 1 deletion java/org/apache/coyote/http2/LocalStrings_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ connectionSettings.debug=连接[{0}],参数类型[{1}]设置为[{2}]
connectionSettings.enablePushInvalid=连接[{0}],请求的enable push[{1}]值不是允许的值之一(零或一)
connectionSettings.headerTableSizeLimit=连接 [{0}],尝试将 header 表大小设置为 [{1}],但限制为 16k
connectionSettings.maxFrameSizeInvalid=连接[{0}],请求的最大帧大小[{1}]在[{2}]到[{3}]的允许范围之外
connectionSettings.unknown=连接[{0}],标识为[{1}]和值为[{2}]的未知设置被忽略
connectionSettings.unknown=连接[{0}],标识为[{1}]和值为[{2}]的未知设置被忽略, ip [{3}]
connectionSettings.windowSizeTooBig=连接[{0}],请求窗口大小[{0}],大于最大允许的值[{1}]

frameType.checkPayloadSize=对帧类型[{1}]来说,负载[{0}]是无效的
Expand Down