-
Notifications
You must be signed in to change notification settings - Fork 129
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
Replace Hyper with Warp for HTTP server #1998
Conversation
(in streams.rs) Is it really needed to do a |
d606625
to
4a70aae
Compare
I'm not sure why either! To be safe and not leak memory or resources, all stream instances should do |
I want to take ownership of the response buffer of the headers on drop to send them to Warp without a clone. And that's when I realized that we're only dropping after that the response buffer but not the headers. Also, now that I transfer ownership to Warp I'm not sure if we still need to do the drop ourselves... |
If it's allocated to an arena slab, the manual drop is necessary when the arena is dropped. If the value is dropped before then, it's arena tag should be set to |
@aarroyoc: Very impressive! One small detail I noticed: Have you thought about naming the HTTPS options |
4a70aae
to
695948b
Compare
695948b
to
5930246
Compare
One other small thing I noticed: The README still mentions hyper, this (and also the server description, such as the newly available HTTPS support that this patch provides) may benefit from a small adaption: Line 627 in 4077040
|
0bd94fa
to
9d83fc1
Compare
The last change I wanted to introduce in this PR was allowing the server to be stopped with Ctrl-C. I finally managed to do it, although I'm not 100% happy with this solution, but since POSIX signal hooks are very limited in what they can do, it's ok. |
Awesome, thank you so much! What is the issue with the CI test on windows? (@infogulch ?) |
e2e6bd5
to
91348b2
Compare
About the Windows error: https://users.rust-lang.org/t/gnu-ld-linker-errror-export-ordinal-too-large-xxxxx/84092 |
I'm blocked with this Windows error. Apparently, GNU ld on Windows has this problem (however Scryer itself doesn't export 68000 symbols at all, I've checked pub and pub use without (crate) and I can only count 68000 if we admit dependencies). MSVC toolchain doesn't have this issue and it's free for open source code, so that could be an option. In Rust they're also talking about using LLVM's lld but it's not stable and will go first to the MSVC toolchain. It seems like MSVC toolchain is the most recommended for Windows (rustup recommends you to install this right now). |
I don't see why we shouldn't switch to msvc, so I'm looking into that. Separately, I'm curious why this is an issue on this pr in particular, considering that the cause is 'too many symbols'. Looking at |
- Use Warp - Optimize clones - HTTPS server - Content-Length limit - HTTP Basic Auth - Stop server with Ctrl-C
91348b2
to
660860b
Compare
Thanks for removing the block @infogulch ! Is this PR ready to be merged? |
Thanks @infogulch! Yes, @mthom it's ready. This should be much better than the current implementation. |
Looks good to me. Maybe we can evaluate the cost/benefit proposition all the dependencies in a future discussion. |
is there a reason for pinning warp at 0.3.5? it looks like hyper was pinned as a pre-release version was used and this was just kept for warp. |
Changes: