Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/sogou/workflow into subsc…
Browse files Browse the repository at this point in the history
…ribe
  • Loading branch information
Barenboim committed Aug 19, 2024
2 parents b262623 + 218681e commit 9be7b6d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/client/WFMySQLConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class WFMySQLConnection
* address resovled will be used. Don't use upstream name as a host. */
int init(const std::string& url)
{
return init(url, NULL);
return this->init(url, NULL);
}

int init(const std::string& url, SSL_CTX *ssl_ctx);
Expand Down Expand Up @@ -79,7 +79,7 @@ class WFMySQLConnection
int id;

public:
/* Make sure that cocurrent connections have different id.
/* Make sure that concurrent connections have different id.
* When a connection object is deleted, id can be reused. */
WFMySQLConnection(int id) { this->id = id; }
virtual ~WFMySQLConnection() { }
Expand Down
6 changes: 3 additions & 3 deletions src/factory/WFTaskFactory.inl
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ protected:

void clear_resp()
{
size_t size = this->resp.get_size_limit();
protocol::ProtocolMessage msg(std::move(this->resp));

this->resp.~RESP();
new(&this->resp) RESP();
this->resp.set_size_limit(size);
new(&this->resp) RESP;
*(protocol::ProtocolMessage *)&this->resp = std::move(msg);
}

void disable_retry()
Expand Down
4 changes: 4 additions & 0 deletions src/protocol/ProtocolMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ class ProtocolMessage : public CommMessageOut, public CommMessageIn
message.size_limit = (size_t)-1;
this->attachment = message.attachment;
message.attachment = NULL;
this->wrapper = message.wrapper;
message.wrapper = NULL;
}

ProtocolMessage& operator = (ProtocolMessage&& message)
Expand All @@ -126,6 +128,8 @@ class ProtocolMessage : public CommMessageOut, public CommMessageIn
delete this->attachment;
this->attachment = message.attachment;
message.attachment = NULL;
this->wrapper = message.wrapper;
message.wrapper = NULL;
}

return *this;
Expand Down

0 comments on commit 9be7b6d

Please sign in to comment.