This repository has been archived by the owner on Jun 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 59
http: embed http server in both meta and replica #139
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We don't need factory2, the only place use it is `network::get_message_parser_info`. ``` ➜ rdsn git:(master) ✗ ag factory2 src/core/core/message_parser.cpp 174: message_parser::factory2 f2, 184: info.factory2 = f2; src/core/core/tool_api.cpp 211: message_parser::factory2 f2, src/core/core/network.cpp 465:std::pair<message_parser::factory2, size_t> 470: pinfo.factory2, "message parser '%s' not registerd or invalid!", hdr_format.to_string()); 471: return std::make_pair(pinfo.factory2, pinfo.parser_size); src/core/core/message_parser_manager.h 47: : fmt(NET_HDR_INVALID), factory(nullptr), factory2(nullptr), parser_size(0) 53: message_parser::factory2 factory2; 64: message_parser::factory2 f2, include/dsn/tool_api.h 167: message_parser::factory2 f2, include/dsn/tool-api/network.h 134: DSN_API std::pair<message_parser::factory2, size_t> include/dsn/tool-api/message_parser.h 98: typedef message_parser *(*factory2)(void *); ``` However there's nowhere calling this function ``` ➜ rdsn git:(master) ✗ ag get_message_parser_info src/core/core/network.cpp 466:network::get_message_parser_info(network_header_format hdr_format) include/dsn/tool-api/network.h 135: get_message_parser_info(network_header_format hdr_format); ``` Thus I removed it to simplify the design.
# Conflicts: # include/dsn/utility/blob.h # src/dist/replication/lib/replication_service_app.cpp
neverchanje
requested review from
shengofsun and
qinzuoyan
and removed request for
qinzuoyan and
shengofsun
July 18, 2018 08:01
neverchanje
requested review from
shengofsun and
qinzuoyan
and removed request for
shengofsun
July 19, 2018 05:45
Closed
shengofsun
previously approved these changes
Aug 10, 2018
include/dsn/tool-api/rpc_message.h
Outdated
@@ -67,7 +67,11 @@ struct fast_code | |||
|
|||
typedef struct message_header | |||
{ | |||
// For thrift protocol this is "THRT". |
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.
THFT
shengofsun
approved these changes
Aug 10, 2018
qinzuoyan
approved these changes
Aug 10, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR involves rewrite of the original HTTP message parser and implementation of a simple http service framework. Note that before this PR, rDSN does actually not support HTTP.
The old http parser suppose the user always sending request like:
which is not a humanable way to use on browser.
On the current design, user can simply access the url path which is registered by a valid http_sevice.
This PR effects little on the other modules of rDSN. It creates a http server for both the meta server and replica sever (not for collector). Tasks of http rpc are handled via rpc_code
RPC_HTTP_SERVICE
:DEFINE_TASK_CODE_RPC(RPC_HTTP_SERVICE, TASK_PRIORITY_LOW, THREAD_POOL_DEFAULT);
Related issues
Results: