2021-10-09 11:43:12 +02:00
From 0cf87c789c24e97cbadb74d50597c15d85006b26 Mon Sep 17 00:00:00 2001
2016-05-28 18:34:39 +02:00
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
2021-10-09 11:43:12 +02:00
index 596ced71..b91981e6 100644
2016-05-28 18:34:39 +02:00
--- 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
--
2021-10-09 11:43:12 +02:00
2.30.1 (Apple Git-130)
2016-05-28 18:34:39 +02:00