From df81d8b4eabd2de831413e4d41de5c1ce463c396 Mon Sep 17 00:00:00 2001 From: XieHan Date: Fri, 18 Dec 2020 22:54:19 +0800 Subject: [PATCH] update code --- src/factory/HttpTaskImpl.cc | 3 --- src/factory/WFTaskFactory.inl | 12 +----------- src/protocol/MySQLMessage.cc | 3 --- 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/factory/HttpTaskImpl.cc b/src/factory/HttpTaskImpl.cc index a76bcbb0..8f0d13b8 100644 --- a/src/factory/HttpTaskImpl.cc +++ b/src/factory/HttpTaskImpl.cc @@ -338,10 +338,7 @@ bool ComplexHttpTask::finish_once() this->disable_retry(); } else - { this->get_resp()->end_parsing(); - redirect_count_ = 0; - } return true; } diff --git a/src/factory/WFTaskFactory.inl b/src/factory/WFTaskFactory.inl index 50dba390..cb1ba83b 100644 --- a/src/factory/WFTaskFactory.inl +++ b/src/factory/WFTaskFactory.inl @@ -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::set_port() template void WFComplexClientTask::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::done() if (is_sockaddr_) set_retry(); else - set_retry(original_uri_); + set_retry(uri_); is_retry_ = true; // will influence next round dns cache time } diff --git a/src/protocol/MySQLMessage.cc b/src/protocol/MySQLMessage.cc index 12958d67..2aafbef8 100644 --- a/src/protocol/MySQLMessage.cc +++ b/src/protocol/MySQLMessage.cc @@ -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); }