-
Notifications
You must be signed in to change notification settings - Fork 853
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
log session id #1164
log session id #1164
Conversation
@@ -178,6 +178,11 @@ inline int h2o_lcstris(const char *target, size_t target_len, const char *test, | |||
return h2o__lcstris_core(target, test, test_len); | |||
} | |||
|
|||
inline size_t h2o_base64_encode_capacity(unsigned len) |
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.
The reason you are seeing CI failure is because the function is not defined is static
. Since it is not defined as static
, the function is defined multiple times as each source file includes the header file, ending up with a multiple definition error.
The rule I'd like you to follow is to declare a function as static
first, and then define a function as inline
. For example, please see the occurrences of h2o_lcstris
(you'd find the declaration and the definition within the header file).
The logic we had in #1147 is fine. The confusion is due to the fact that there are various flavors in how base64 is encoded. Depending on the encoder, the output may include line feeds or trailers (i.e. In case of And the fact that there are various flavors is why I suggested that the function should be named |
PS. I would appreciate it if you could extend the end-to-end test in https://github.com/h2o/h2o/blob/v2.1.0-beta4/t/50access-log.t#L147-L173 to cover the proposed extension. |
ok will do. thanks for the patience |
Thank you for adding the tests! Merged to master. |
replaces #1147 because somehow i messed that up.
i tried to fix the issues, but i'm unsure about the correct algo for
h2o_base64_encode_capacity
.http://stackoverflow.com/questions/1533113/calculate-the-size-to-a-base-64-encoded-message
suggests:
((len * 4) / 3) + (len / 96) + 6
also not sure why the ci fails