mirror of
https://github.com/sogou/workflow.git
synced 2026-10-29 03:27:04 +08:00
update code
This commit is contained in:
@@ -338,10 +338,7 @@ bool ComplexHttpTask::finish_once()
|
||||
this->disable_retry();
|
||||
}
|
||||
else
|
||||
{
|
||||
this->get_resp()->end_parsing();
|
||||
redirect_count_ = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -243,7 +243,6 @@ public:
|
||||
type_(TT_TCP),
|
||||
retry_times_(0),
|
||||
is_retry_(false),
|
||||
has_original_uri_(true),
|
||||
redirect_(false)
|
||||
{}
|
||||
|
||||
@@ -292,7 +291,6 @@ public:
|
||||
socklen_t addrlen,
|
||||
const std::string& info);
|
||||
|
||||
const ParsedURI *get_original_uri() const { return &original_uri_; }
|
||||
const ParsedURI *get_current_uri() const { return &uri_; }
|
||||
|
||||
void set_redirect(const ParsedURI& uri)
|
||||
@@ -350,7 +348,6 @@ protected:
|
||||
TransportType get_transport_type() const { return type_; }
|
||||
|
||||
ParsedURI uri_;
|
||||
ParsedURI original_uri_;
|
||||
|
||||
int retry_max_;
|
||||
bool is_sockaddr_;
|
||||
@@ -378,7 +375,6 @@ private:
|
||||
/* state 0: uninited or failed; 1: inited but not checked; 2: checked. */
|
||||
char init_state_;
|
||||
bool is_retry_;
|
||||
bool has_original_uri_;
|
||||
bool redirect_;
|
||||
};
|
||||
|
||||
@@ -473,12 +469,6 @@ bool WFComplexClientTask<REQ, RESP, CTX>::set_port()
|
||||
template<class REQ, class RESP, typename CTX>
|
||||
void WFComplexClientTask<REQ, RESP, CTX>::init_with_uri()
|
||||
{
|
||||
if (has_original_uri_)
|
||||
{
|
||||
original_uri_ = uri_;
|
||||
has_original_uri_ = true;
|
||||
}
|
||||
|
||||
route_result_.clear();
|
||||
if (uri_.state == URI_STATE_SUCCESS && this->set_port())
|
||||
{
|
||||
@@ -716,7 +706,7 @@ SubTask *WFComplexClientTask<REQ, RESP, CTX>::done()
|
||||
if (is_sockaddr_)
|
||||
set_retry();
|
||||
else
|
||||
set_retry(original_uri_);
|
||||
set_retry(uri_);
|
||||
|
||||
is_retry_ = true; // will influence next round dns cache time
|
||||
}
|
||||
|
||||
@@ -254,7 +254,6 @@ static inline std::string __sha1_bin(const std::string& str)
|
||||
#define MYSQL_CAPFLAG_CLIENT_PROTOCOL_41 0x00000200
|
||||
#define MYSQL_CAPFLAG_CLIENT_SECURE_CONNECTION 0x00008000
|
||||
#define MYSQL_CAPFLAG_CLIENT_CONNECT_WITH_DB 0x00000008
|
||||
#define MYSQL_CAPFLAG_CLIENT_PLUGIN_AUTH 0x00080000
|
||||
#define MYSQL_CAPFLAG_CLIENT_MULTI_STATEMENTS 0x00010000
|
||||
#define MYSQL_CAPFLAG_CLIENT_MULTI_RESULTS 0x00020000
|
||||
#define MYSQL_CAPFLAG_CLIENT_PS_MULTI_RESULTS 0x00040000
|
||||
@@ -269,7 +268,6 @@ int MySQLAuthRequest::encode(struct iovec vectors[], int max)
|
||||
int4store(pos, MYSQL_CAPFLAG_CLIENT_PROTOCOL_41 |
|
||||
MYSQL_CAPFLAG_CLIENT_SECURE_CONNECTION |
|
||||
MYSQL_CAPFLAG_CLIENT_CONNECT_WITH_DB |
|
||||
MYSQL_CAPFLAG_CLIENT_PLUGIN_AUTH |
|
||||
MYSQL_CAPFLAG_CLIENT_MULTI_RESULTS|
|
||||
MYSQL_CAPFLAG_CLIENT_LOCAL_FILES |
|
||||
MYSQL_CAPFLAG_CLIENT_MULTI_STATEMENTS |
|
||||
@@ -296,7 +294,6 @@ int MySQLAuthRequest::encode(struct iovec vectors[], int max)
|
||||
buf_.append(username_.c_str(), username_.size() + 1);
|
||||
buf_.append(native);
|
||||
buf_.append(db_.c_str(), db_.size() + 1);
|
||||
buf_.append("mysql_native_password", 22);
|
||||
return this->MySQLMessage::encode(vectors, max);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user