equal
deleted
inserted
replaced
24 */ |
24 */ |
25 |
25 |
26 package jdk.internal.net.http; |
26 package jdk.internal.net.http; |
27 |
27 |
28 import java.io.IOException; |
28 import java.io.IOException; |
|
29 import java.io.UncheckedIOException; |
29 import java.lang.System.Logger.Level; |
30 import java.lang.System.Logger.Level; |
30 import java.net.URI; |
31 import java.net.URI; |
31 import java.nio.ByteBuffer; |
32 import java.nio.ByteBuffer; |
32 import java.util.ArrayList; |
33 import java.util.ArrayList; |
33 import java.util.Collections; |
34 import java.util.Collections; |
302 this.connection = connection; |
303 this.connection = connection; |
303 this.windowController = windowController; |
304 this.windowController = windowController; |
304 this.request = e.request(); |
305 this.request = e.request(); |
305 this.requestPublisher = request.requestPublisher; // may be null |
306 this.requestPublisher = request.requestPublisher; // may be null |
306 responseHeaders = new HttpHeadersImpl(); |
307 responseHeaders = new HttpHeadersImpl(); |
307 rspHeadersConsumer = (name, value) -> { |
308 rspHeadersConsumer = new HeadersConsumer(); |
308 responseHeaders.addHeader(name.toString(), value.toString()); |
|
309 if (Log.headers() && Log.trace()) { |
|
310 Log.logTrace("RECEIVED HEADER (streamid={0}): {1}: {2}", |
|
311 streamid, name, value); |
|
312 } |
|
313 }; |
|
314 this.requestPseudoHeaders = new HttpHeadersImpl(); |
309 this.requestPseudoHeaders = new HttpHeadersImpl(); |
315 // NEW |
310 // NEW |
316 this.windowUpdater = new StreamWindowUpdateSender(connection); |
311 this.windowUpdater = new StreamWindowUpdateSender(connection); |
317 } |
312 } |
318 |
313 |
1175 } |
1170 } |
1176 |
1171 |
1177 final String dbgString() { |
1172 final String dbgString() { |
1178 return connection.dbgString() + "/Stream("+streamid+")"; |
1173 return connection.dbgString() + "/Stream("+streamid+")"; |
1179 } |
1174 } |
|
1175 |
|
1176 private class HeadersConsumer extends Http2Connection.ValidatingHeadersConsumer { |
|
1177 |
|
1178 @Override |
|
1179 public void onDecoded(CharSequence name, CharSequence value) |
|
1180 throws UncheckedIOException |
|
1181 { |
|
1182 String n = name.toString(); |
|
1183 String v = value.toString(); |
|
1184 super.onDecoded(n, v); |
|
1185 responseHeaders.addHeader(n, v); |
|
1186 if (Log.headers() && Log.trace()) { |
|
1187 Log.logTrace("RECEIVED HEADER (streamid={0}): {1}: {2}", |
|
1188 streamid, n, v); |
|
1189 } |
|
1190 } |
|
1191 } |
1180 } |
1192 } |