File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -109,13 +109,13 @@ rpc_client::~rpc_client()
109
109
}
110
110
}
111
111
112
- void rpc_client::set_http_conn ( net_connect *hptr )
112
+ void rpc_client::set_http_conn ( tcp_connect *hptr )
113
113
{
114
114
hptr_ = hptr;
115
115
hptr_->set_net_parser ( &hp_ );
116
116
}
117
117
118
- net_connect *rpc_client::get_http_conn () const
118
+ tcp_connect *rpc_client::get_http_conn () const
119
119
{
120
120
return hptr_;
121
121
}
@@ -170,6 +170,7 @@ void rpc_client::send( rpc_request *rptr )
170
170
// submit http POST request
171
171
http_request msg;
172
172
msg.init ( " POST" , " /" );
173
+ msg.add_hdr ( " Host" , hptr_->get_host () );
173
174
msg.add_hdr ( " Content-Type" , " application/json" );
174
175
msg.commit ( jw );
175
176
hptr_->add_send ( msg );
Original file line number Diff line number Diff line change @@ -71,8 +71,8 @@ namespace pc
71
71
~rpc_client ();
72
72
73
73
// rpc http connection
74
- void set_http_conn ( net_connect * );
75
- net_connect *get_http_conn () const ;
74
+ void set_http_conn ( tcp_connect * );
75
+ tcp_connect *get_http_conn () const ;
76
76
77
77
// rpc web socket connection
78
78
void set_ws_conn ( net_connect * );
@@ -128,7 +128,7 @@ namespace pc
128
128
typedef std::vector<char > acc_buf_t ;
129
129
typedef hash_map<trait> sub_map_t ;
130
130
131
- net_connect *hptr_;
131
+ tcp_connect *hptr_;
132
132
net_connect *wptr_;
133
133
rpc_http hp_; // http parser wrapper
134
134
rpc_ws wp_; // websocket parser wrapper
You can’t perform that action at this time.
0 commit comments