Improve performance of HttpRequestEncoder.encodeInitialLine(...)
This commit is contained in:
parent
46f6e1d360
commit
9c49322b9c
@ -35,7 +35,7 @@ public class HttpRequestEncoder extends HttpObjectEncoder<HttpRequest> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void encodeInitialLine(ByteBuf buf, HttpRequest request) throws Exception {
|
protected void encodeInitialLine(ByteBuf buf, HttpRequest request) throws Exception {
|
||||||
buf.writeBytes(request.getMethod().toString().getBytes(CharsetUtil.US_ASCII));
|
encodeAscii(request.getMethod().toString(), buf);
|
||||||
buf.writeByte(SP);
|
buf.writeByte(SP);
|
||||||
|
|
||||||
// Add / as absolute path if no is present.
|
// Add / as absolute path if no is present.
|
||||||
@ -51,7 +51,7 @@ public class HttpRequestEncoder extends HttpObjectEncoder<HttpRequest> {
|
|||||||
buf.writeBytes(uri.getBytes(CharsetUtil.UTF_8));
|
buf.writeBytes(uri.getBytes(CharsetUtil.UTF_8));
|
||||||
|
|
||||||
buf.writeByte(SP);
|
buf.writeByte(SP);
|
||||||
buf.writeBytes(request.getProtocolVersion().toString().getBytes(CharsetUtil.US_ASCII));
|
encodeAscii(request.getProtocolVersion().toString(), buf);
|
||||||
buf.writeBytes(CRLF);
|
buf.writeBytes(CRLF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user