Some small improvements (#11564)
Signed-off-by: xingrufei <xingrufei@sogou-inc.com>
This commit is contained in:
parent
b9ac4b62bf
commit
00d1dfb686
@ -411,7 +411,7 @@ public class DefaultHttp2LocalFlowController implements Http2LocalFlowController
|
|||||||
|
|
||||||
window += delta;
|
window += delta;
|
||||||
processedWindow += delta;
|
processedWindow += delta;
|
||||||
lowerBound = delta < 0 ? delta : 0;
|
lowerBound = Math.min(delta, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -128,7 +128,7 @@ public class Http2ServerUpgradeCodec implements HttpServerUpgradeHandler.Upgrade
|
|||||||
// Decode the HTTP2-Settings header and set the settings on the handler to make
|
// Decode the HTTP2-Settings header and set the settings on the handler to make
|
||||||
// sure everything is fine with the request.
|
// sure everything is fine with the request.
|
||||||
List<String> upgradeHeaders = upgradeRequest.headers().getAll(HTTP_UPGRADE_SETTINGS_HEADER);
|
List<String> upgradeHeaders = upgradeRequest.headers().getAll(HTTP_UPGRADE_SETTINGS_HEADER);
|
||||||
if (upgradeHeaders.isEmpty() || upgradeHeaders.size() > 1) {
|
if (upgradeHeaders.size() != 1) {
|
||||||
throw new IllegalArgumentException("There must be 1 and only 1 "
|
throw new IllegalArgumentException("There must be 1 and only 1 "
|
||||||
+ HTTP_UPGRADE_SETTINGS_HEADER + " header.");
|
+ HTTP_UPGRADE_SETTINGS_HEADER + " header.");
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ public final class HostsFileParser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Map<String, ?> toMapWithSingleValue(Map<String, List<InetAddress>> fromMapWithListValue) {
|
private static Map<String, ?> toMapWithSingleValue(Map<String, List<InetAddress>> fromMapWithListValue) {
|
||||||
Map<String, InetAddress> result = new HashMap<>();
|
Map<String, InetAddress> result = new HashMap<>(fromMapWithListValue.size());
|
||||||
for (Map.Entry<String, List<InetAddress>> entry : fromMapWithListValue.entrySet()) {
|
for (Map.Entry<String, List<InetAddress>> entry : fromMapWithListValue.entrySet()) {
|
||||||
List<InetAddress> value = entry.getValue();
|
List<InetAddress> value = entry.getValue();
|
||||||
if (!value.isEmpty()) {
|
if (!value.isEmpty()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user