Waterfall/BungeeCord-Patches/0008-Presize-the-HTTP-response-buffer.patch
_tomcraft 85c0a35f0b
Updated Upstream (BungeeCord) (#695)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

BungeeCord Changes:
6613aaea Add test fix for library classes being visible to non-dependent plugins
53ce6b93 #3200: Fix protocol for 21w40a
d8e29384 #2466: Use switch in "BungeeCord" plugin message handling
5cf869df #3198: Remove terminally deprecated SecurityManager
f26f7d88 Add optional 1.18 (21w40a) snapshot protocol support
2021-10-09 10:43:12 +01:00

24 lines
1.0 KiB
Diff

From 0cf87c789c24e97cbadb74d50597c15d85006b26 Mon Sep 17 00:00:00 2001
From: Tux <write@imaginarycode.com>
Date: Wed, 13 Apr 2016 15:17:05 -0400
Subject: [PATCH] Presize the HTTP response buffer
16 characters is extremely small, and all responses start around 256 bytes. 640 characters seems to be good (covering skins and capes), based on sampling profile API responses.
diff --git a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java
index 596ced71..b91981e6 100644
--- a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java
+++ b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java
@@ -16,7 +16,7 @@ public class HttpHandler extends SimpleChannelInboundHandler<HttpObject>
{
private final Callback<String> callback;
- private final StringBuilder buffer = new StringBuilder();
+ private final StringBuilder buffer = new StringBuilder(640);
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception
--
2.30.1 (Apple Git-130)