Skip to content

impl<R: Responder> Responder for MutexGuard<R> #2615

Discussion options

You must be logged in to vote

It sounds like this is a problem with your approach, not functionality missing in Rocket. Your data probably is 'static, seeing as you're sharing it across the application, so this isn't part of the problem. Returning a MutexGuard from a handler would mean maintaining the lock until the response is completely written, which is prone to DoS issues (the client can effectively hold your lock as long as they want.) You probably want to find some way of avoiding trying to hold a lock across a handler invocation.

I'm not sure what you're doing, but perhaps if you gave an example we could be of more help. I'm converting this to a discussion.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@cubodix
Comment options

Answer selected by cubodix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request Request for new functionality
2 participants
Converted from issue

This discussion was converted from issue #2614 on September 19, 2023 20:39.