Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #342
I know I should wait for a discussion before opening a PR, but I had to implement this regardless due to having to support windows developers in our project. So I thought I could add the PR here as well until you have time to think about it, but ofc no pressure to merge, it is merely opened as a suggestion for how this could be implemented if you are open to the feature, I'm also happy to take feedback if you would like it to be implemented differently somehow.
This adds basic support for windows, it excludes all Unix socket features (e.g
transfer_fd
), it excludes daemonization (the library used in unix-only).For all uses of
std::os::unix::io::RawFd
on unix systems, windows usestd::os::windows::io::RawSocket
.For the libc calls
getpeername
andgetsockname
that on unix systems uses the implementation in thenix
-crate, windows uses a implementation that is based on similar functionality in the std lib (but that unfortunately is private)I've been testing this with the
x86_64-pc-windows-gnu
target, but I have not been able to cross compile pingora-boringssl to windows. Not sure if it important to test for windows, so didnt spend very much time on it as it is likely just a problem with my local developement environment.