Skip to content

Commit 05cd043

Browse files
committed
Azure function improvement
1 parent e0aa2e0 commit 05cd043

File tree

1 file changed

+3
-2
lines changed
  • extensions/azure-functions-http/runtime/src/main/java/io/quarkus/azure/functions/resteasy/runtime

1 file changed

+3
-2
lines changed

extensions/azure-functions-http/runtime/src/main/java/io/quarkus/azure/functions/resteasy/runtime/BaseFunction.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ public class BaseFunction {
3737
protected static final String deploymentStatus;
3838
protected static boolean started = false;
3939

40+
private static final int BUFFER_SIZE = 8096;
41+
4042
static {
4143
StringWriter error = new StringWriter();
4244
PrintWriter errorWriter = new PrintWriter(error, true);
@@ -106,7 +108,7 @@ protected HttpResponseMessage nettyDispatch(HttpRequestMessage<Optional<byte[]>>
106108

107109
private ByteArrayOutputStream createByteStream() {
108110
ByteArrayOutputStream baos;
109-
baos = new ByteArrayOutputStream(500);
111+
baos = new ByteArrayOutputStream(BUFFER_SIZE);
110112
return baos;
111113
}
112114

@@ -136,7 +138,6 @@ public void handleMessage(Object msg) {
136138
if (msg instanceof HttpContent) {
137139
HttpContent content = (HttpContent) msg;
138140
if (baos == null) {
139-
// todo what is right size?
140141
baos = createByteStream();
141142
}
142143
int readable = content.content().readableBytes();

0 commit comments

Comments
 (0)