Hello folks, I’m trying to get a sense of the correct way to handle a couple corner cases while using httpcommons-core 5.x as a generic H2 server framework.
First, I would like idle connections to timeout (ie, client initiates a socket connection to a IO reactor and does nothing). I would assume this would be part of the IORector config but I couldn’t find anything in there related to idle connections. Second, I’m trying to write an AsyncEntityConsumer that limits the amount of data it will accept (to limit the max POST body allowed), stops processing once a limit is reached and sends back an sensible HTTP response, here’s my latest failed attempt: https://github.com/rferreira/jujube/blob/master/jujube-core/src/main/java/org/ophion/jujube/internal/MultipartEntityConsumer.java#L76 <https://github.com/rferreira/jujube/blob/master/jujube-core/src/main/java/org/ophion/jujube/internal/MultipartEntityConsumer.java#L76> And https://github.com/rferreira/jujube/blob/master/jujube-core/src/main/java/org/ophion/jujube/internal/JujubeServerExchangeHandler.java#L70 <https://github.com/rferreira/jujube/blob/master/jujube-core/src/main/java/org/ophion/jujube/internal/JujubeServerExchangeHandler.java#L70> Needless to say, the above doesn’t work since it doesn’t tell the underlying IO handler to stop reading bytes off the stream. Lastly, I’m confused what types of exception in the H2ServerBootstrap are supposed to trigger the callback method (https://github.com/rferreira/jujube/blob/master/jujube-core/src/main/java/org/ophion/jujube/Jujube.java#L55 <https://github.com/rferreira/jujube/blob/master/jujube-core/src/main/java/org/ophion/jujube/Jujube.java#L55>) - in my testing, I haven’t seen that callback method being called even once. Big thanks and if anything I’m asking for above requires changes to httpcommons-core itself, I’m happy to submit patches with some minor guidance. Happy new year, - Rafael
