-
-
Notifications
You must be signed in to change notification settings - Fork 319
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
#692 Add the possibility to specify "Sec-WebSocket-Protocol" #693
base: master
Are you sure you want to change the base?
Conversation
I could use your split function in my websocket compression PR, if yours is merged first :D |
I rewrote find_first_of algorithm and put it in utility.h :) |
If I don't miss it, I think a getter is needed for the selected subprotocol in the connection. Otherwise looks good to me. |
Currently, the "subprotocol_" is only a private variable and is only used in the Connection::start but I can add a getter in the interface and implementation if it's needed. |
I think that's it :) I asked for the getter, because users must be able to know which subprotocol was selected and probably switch code paths accordingly. |
build fails on ubuntu at least, other os will run later. |
Apparently missed the include of for utility::find_first_of ... |
@@ -721,6 +746,7 @@ namespace crow | |||
uint16_t remaining_length16_{0}; | |||
uint64_t remaining_length_{0}; | |||
uint64_t max_payload_bytes_{UINT64_MAX}; | |||
std::string subprotocol_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe more specific name as it is only connected with one header?
May I ask you also to add unit tests? |
I took the liberty to add some documentation as well. Feel free if you have any feedback :)