Skip to content
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

Fix http message #250

Merged
merged 6 commits into from
Nov 17, 2023
Merged

Fix http message #250

merged 6 commits into from
Nov 17, 2023

Conversation

lihuiba
Copy link
Collaborator

@lihuiba lihuiba commented Nov 16, 2023

fix operator priority bug in http/status.cpp;
enhance estring;

ret = ret * 16 + (c - 'A' + 10);
} else if (c >= 'a' && c <= 'f') {
ret = ret * 16 + (c - 'a' + 10);
unsigned char cc = c - '0';
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reducing branches in machine code

@@ -55,27 +55,34 @@ size_t estring_view::find_last_not_of(const charset& set) const

bool estring_view::to_uint64_check(uint64_t* v) const
{
v ? (*v = 0) : 0;
uint64_t val = 0;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simplify the syntax

@@ -331,7 +331,7 @@ int Request::redirect(Verb v, estring_view location, bool enable_proxy) {
}
StoredURL u(location);
auto new_request_line_size = verbstr[v].size() + sizeof(" HTTP/1.1\r\n") +
enable_proxy ? full_url_size(u) : u.target().size();
(enable_proxy ? full_url_size(u) : u.target().size());
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops...

@lihuiba lihuiba marked this pull request as ready for review November 16, 2023 10:07
auto x = *(xlator *)(&v);
*(uint32_t *)out = ((tbl[x.a] << 24) + (tbl[x.b] << 16) +
(tbl[x.c] << 8) + (tbl[x.d] << 0));
auto x = (xlator*) &v;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to eliminate a warning

@lihuiba lihuiba merged commit 9245e93 into alibaba:release/0.7 Nov 17, 2023
7 checks passed
@lihuiba lihuiba deleted the fix_http_message branch January 3, 2024 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants