- Notifications
You must be signed in to change notification settings - Fork472
ssl_options: use std::vector<unsigned char> for the ALPN protocol list in wire format#544
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…t in wire formatThe library used std::basic_string<unsigned char> which requires std::char_traits<unsigned char> and is technically not defined by the standard. libc++ no longer supports it as of LLVM 19.Signed-off-by: Friedrich Wilckens <frwilckens@gmail.com>
| opts_.protos = protos_.data(); | ||
| opts_.protos_len =unsigned(protos_.length()); | ||
| opts_.protos_len =unsigned(protos_.size()); |
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.
Wouldn'tstatic_cast<unsigned> be better than a C-style cast?
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.
Yes. But in@frwilckens 's defense, this was taken from my code!
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.
Yep, but I thought it would be good to fix it if we're already changing that lines :)
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.
I agree, this should be changed. I just did not want to distract from the main point.
Argh. This is unfortunate. It's always pained me that the signed-ness of This is a little painful, as I have often used The methods for find and replace in the string class are often useful for binary data as well. That probably isn't too helpful for a field or two in the option classes in this library, but I will consider the best thing to do. Using a |
strega-nil-re commentedApr 1, 2025
This woulddefinitely break user code, I think, and even if it wouldn't it would certainly break the standard library's API. |
frwilckens commentedApr 2, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I'm not a language lawyer but as far as I know a user-defined specialization |
Hey. Apologies that I'm slammed at work and haven't had much time to jump on this. I also want to make it clear that the proposed PR, and any number of other solutions would be perfectly adequate to fix the ALPN field in First, it always seemed idiotic to me that C++ has And now, Ugh. After looking at a few things, I agree that actuallydefining Couldn't I just define a |
strega-nil-re commentedApr 14, 2025
You absolutely can, and it's a reasonable thing to do. |
I agree, that would work. There is even more wonky stuff written about this topic inp0551r3.pdf, where it says that for a template specialization in namespace std to be fine it needs to have at least one template parameter depend on a user-defined type. The libc++ authors argue that they can't provide a base implementation of template char_traits because there is none that would work for all parameters. That makes sense but I still don't see a good reason to remove the explicit specialization for unsigned char. I think they could have offered it as a vendor extension, even in light of the above-mentioned paper. |
kuroneko commentedApr 28, 2025
This is now a pressing matter as Apple recently updated XCode and the new release has a clang and libc++ version that barfs on this issue. |
4c7f15d intoeclipse-paho:developUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
This change is needed to compile the library with clang/libc++ since version 19.
The library used
std::basic_string<unsigned char>which requiresstd::char_traits<unsigned char>and is technically not defined by the standard. libc++ no longer supports it as of LLVM 19.