Skip to content

Feature/hc5 serverbootstrap convenience methods#555

Closed
cdw8j wants to merge 133 commits intoapache:5.3.xfrom
cdw8j:feature/hc5-serverbootstrap-convenience-methods
Closed

Feature/hc5 serverbootstrap convenience methods#555
cdw8j wants to merge 133 commits intoapache:5.3.xfrom
cdw8j:feature/hc5-serverbootstrap-convenience-methods

Conversation

@cdw8j
Copy link
Copy Markdown
Contributor

@cdw8j cdw8j commented Sep 11, 2025

I have added two convenience methods to the ServerBootstrap that allow simple customization of the RequestRouter in the HttpServer (custom server info string and switching LOCAL_AUTHORITY_RESOLVER scheme). While it is possible to create an HttpServer with such a custom RequestRouter within the application, this results in really messy and complicated code, which can easily be spared with these very simple convenience methods.

ok2c and others added 30 commits September 16, 2024 17:49
…ation

- Added `plusAsBlank` flag to `URIBuilder` to dynamically configure whether '+' should be interpreted as a space in query parameters.
- Implemented `setPlusAsBlank` method to update the flag and re-parse the query accordingly.
- Fix Javadoc warnings
- Add missing Javadoc tags
- Normalize some comments
- Reduces boilerplate when the same pattern is used
…oring (#490)

This change enhances monitoring capabilities for the IOReactor thread pool, providing better insights into performance and potential bottlenecks.
…cefully shutting classic SSL sockets for compatibility with Oracle JDK 1.8
…ncorrectly reporting its state as CLOSED immediately after its instantiation until #onConnect event has been triggered
…nd extensibility; added classic i/o and TLS compatibility tests
This change ensures compliance with RFC 9110, Section 6.6.1, by guaranteeing that a valid Date header is always present.
- The class was package-private so I made the method also
package-private
- The method could be private
- The method being final allows the JVM the option to inline it at
runtime
- Fail-fast in SingleAuthorityResolver construction for null
URIAuthority input instead of NPE in apply()
- Note: A null router has no negative side-effects in
SingleAuthorityResolver itself
call

The following now define singletons:
- org.apache.hc.core5.http.impl.routing.UriPathRouter.BestMatcher
- org.apache.hc.core5.http.impl.routing.UriPathRouter.OrderedMatcher
- org.apache.hc.core5.http.impl.routing.UriPathRouter.RegexMatcher
- Use the result value Args.notNull() to assign instance variable
- Resolves all Javadoc warnings in URIAuthority
instances

Note: Host is immutable and therefore safe to pass on and reuse
ok2c added 20 commits August 19, 2025 18:53
…when failing enqueued requests that never got executed
…r in case of abnormal / premature exchange termination
…terminates the request on the client if the server has sent the complete response (the stream has been closed remotely)
…e endpoint failing to send GOAWAY frame (corrected)
…ommand queue to activate streams reserved with a push promise
return this;
}

public final ServerBootstrap setLocalAuthResolver() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is really not worth the API clutter IMO.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree the setServerInfo() is arguable, but the setLocalAuthResolver() really makes life easier on application side, because it avoids the clutter related to creating a custom RequestRouter. Should I create a pull request only for the setLocalAuthResolver()?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the setServerInfo() from pull request

@ok2c
Copy link
Copy Markdown
Member

ok2c commented Sep 12, 2025

@cdw8j

  1. You need to make symmetric changes to AsyncServerBootstrap as well
  2. Please add @since 5.4 for all new public methods
  3. Please give the method a better name. #setLocalAuthResolver is actually not a setter and Auth abbreviation is more customary for authentication rather than aurhority

@cdw8j
Copy link
Copy Markdown
Contributor Author

cdw8j commented Sep 12, 2025

Hello @ok2c , so I changed my request as you suggested and removed the setServerInfo(), I am unsure though concerning the @since annotation, as I was requesting to merge into the 5.3.x branch I guess it should be @since 5.3.6, not @since 5.4? Or should I request merge into a different branch? Thanks

@ok2c
Copy link
Copy Markdown
Member

ok2c commented Sep 12, 2025

Hello @ok2c , so I changed my request as you suggested and removed the setServerInfo(), I am unsure though concerning the @since annotation, as I was requesting to merge into the 5.3.x branch I guess it should be @since 5.3.6, not @since 5.4? Or should I request merge into a different branch? Thanks

@cdw8j Sorry I missed that. No, there will be no API changes in the stable branch. No way. Please change the target branch to master if you want your changes accepted.

*
* @since 5.3.6
*/
public final ServerBootstrap enableLocalAuthorityResolver() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cdw8j #useLocalAuthorityResolver maybe?

@cdw8j
Copy link
Copy Markdown
Contributor Author

cdw8j commented Sep 12, 2025

My git rebase completely messed things up .. sorry I will close this request and create a new one.

@cdw8j cdw8j closed this Sep 12, 2025
@cdw8j cdw8j deleted the feature/hc5-serverbootstrap-convenience-methods branch September 12, 2025 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.