-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Expose the ServerConnection created timestamp #801
base: main
Are you sure you want to change the base?
Conversation
Can one of the admins verify this patch? |
This is ok to test |
Hi @eagleshine ! Thanks for your PR! |
We have an HTTPS server that has some logic to decide when to return the header "Connection: close" to the client using the connection created timestamp. We are using some internally developed web framework but want to migrate to either Jetty or Undertow. |
@@ -110,6 +111,7 @@ public Http2ServerConnection(Http2Channel channel, Http2StreamSourceChannel requ | |||
originalSourceConduit = new StreamSourceChannelWrappingConduit(requestChannel); | |||
this.conduitStreamSinkChannel = new ConduitStreamSinkChannel(responseChannel, originalSinkConduit); | |||
this.conduitStreamSourceChannel = new ConduitStreamSourceChannel(channel, originalSourceConduit); | |||
this.createdTimestamp = System.currentTimeMillis(); |
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.
Is this correct? If memory serves, a new Http2ServerConnection
object is created for each request, so the createdTimestamp will be set at the same time as HttpServerExchange.requestStartTime
(which uses the high resolution nanoTime, and is default disabled for performance).
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.
OK. Looks like the semantics of the Connection changed in Http2: the equivalent to that of Http in Http2 is Http2Channel
. And you're right that a new Http2ServerConnection
object is created for each request, however, this is still the connection created timestamp, just not useful anymore.
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.
@eagleshine does that mean that this PR won't work the way you intended it to? If it is no longer valid, please close it. If that's not the case, please let me know
No description provided.