-
Notifications
You must be signed in to change notification settings - Fork 986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[UNDERTOW-2372] Add request size and response size exchange attribute… #1579
base: main
Are you sure you want to change the base?
Conversation
This seems like a bit of duplicate of #1536 |
} | ||
requestSize += calculateRequestLineSize(exchange); | ||
requestSize += exchange.getRequestHeaders().getHeadersBytes(); | ||
// add 2 bytes for CRLF, and 2 bytes for ": " between header name and value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ive already talked with Marek. This type of code needs detailed exaplanation.
Ive removed duplicate, as its vaguely connected to other PR, which has tad different way of getting size. |
…s(sizes include headers).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is correct. The underlying protocol can be either AJP or HTTP 1.1 or HTTP2.
public static final ExchangeAttribute INSTANCE = new RequestSizeAttribute(); | ||
|
||
@Override | ||
public String readAttribute(HttpServerExchange exchange) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if HTTP 2 protocol is in use? The calculations here expect HTTP 1.1 is being used.
public static final ExchangeAttribute INSTANCE = new ResponseSizeAttribute(); | ||
|
||
@Override | ||
public String readAttribute(HttpServerExchange exchange) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if HTTP 2 protocol is in use? The calculations here expect HTTP 1.1 is being used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, but AFAIR we cant account for, for instance, header compression? Also, even for H1 with compression this will be off?
@xjusko ^^ ?
…s(sizes include headers).
https://issues.redhat.com/browse/UNDERTOW-2372