mirror of
https://github.com/sogou/workflow.git
synced 2026-10-21 22:56:42 +08:00
add ProtocolMessage attachment
This commit is contained in:
@@ -227,6 +227,9 @@ HttpMessage::HttpMessage(HttpMessage&& msg)
|
||||
this->size_limit = msg.size_limit;
|
||||
msg.size_limit = (size_t)-1;
|
||||
|
||||
this->attachment = msg.attachment;
|
||||
msg.attachment = NULL;
|
||||
|
||||
this->parser = msg.parser;
|
||||
msg.parser = NULL;
|
||||
|
||||
@@ -246,6 +249,9 @@ HttpMessage& HttpMessage::operator = (HttpMessage&& msg)
|
||||
this->size_limit = msg.size_limit;
|
||||
msg.size_limit = (size_t)-1;
|
||||
|
||||
this->attachment = msg.attachment;
|
||||
msg.attachment = NULL;
|
||||
|
||||
http_parser_deinit(this->parser);
|
||||
delete this->parser;
|
||||
|
||||
|
||||
@@ -1625,6 +1625,9 @@ KafkaMessage::KafkaMessage(KafkaMessage&& msg)
|
||||
this->size_limit = msg.size_limit;
|
||||
msg.size_limit = (size_t)-1;
|
||||
|
||||
this->attachment = msg.attchment;
|
||||
msg.attachment = NULL;
|
||||
|
||||
this->parser = msg.parser;
|
||||
this->stream = msg.stream;
|
||||
msg.parser = NULL;
|
||||
@@ -1654,6 +1657,9 @@ KafkaMessage& KafkaMessage::operator= (KafkaMessage &&msg)
|
||||
this->size_limit = msg.size_limit;
|
||||
msg.size_limit = (size_t)-1;
|
||||
|
||||
this->attachment = msg.attchment;
|
||||
msg.attachment = NULL;
|
||||
|
||||
kafka_parser_deinit(this->parser);
|
||||
delete this->parser;
|
||||
delete this->stream;
|
||||
|
||||
@@ -46,6 +46,9 @@ MySQLMessage::MySQLMessage(MySQLMessage&& move)
|
||||
this->size_limit = move.size_limit;
|
||||
move.size_limit = (size_t)-1;
|
||||
|
||||
this->attachment = move.attachment;
|
||||
move.attachment = NULL;
|
||||
|
||||
parser_ = move.parser_;
|
||||
stream_ = move.stream_;
|
||||
seqid_ = move.seqid_;
|
||||
@@ -64,6 +67,9 @@ MySQLMessage& MySQLMessage::operator= (MySQLMessage&& move)
|
||||
this->size_limit = move.size_limit;
|
||||
move.size_limit = (size_t)-1;
|
||||
|
||||
this->attachment = move.attachment;
|
||||
move.attachment = NULL;
|
||||
|
||||
mysql_parser_deinit(parser_);
|
||||
mysql_stream_deinit(stream_);
|
||||
delete parser_;
|
||||
|
||||
@@ -61,11 +61,28 @@ public:
|
||||
void set_size_limit(size_t limit) { this->size_limit = limit; }
|
||||
size_t get_size_limit() const { return this->size_limit; }
|
||||
|
||||
public:
|
||||
class Attachment
|
||||
{
|
||||
public:
|
||||
virtual ~Attachment() { }
|
||||
};
|
||||
|
||||
void set_attachment(Attachment *att) { this->attachment = att; }
|
||||
Attachment *get_attachment() const { return this->attachment; }
|
||||
|
||||
protected:
|
||||
size_t size_limit;
|
||||
Attachment *attachment;
|
||||
|
||||
public:
|
||||
ProtocolMessage() { this->size_limit = (size_t)-1; }
|
||||
ProtocolMessage()
|
||||
{
|
||||
this->size_limit = (size_t)-1;
|
||||
this->attachment = NULL;
|
||||
}
|
||||
|
||||
virtual ~ProtocolMessage() { delete this->attachment; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -490,6 +490,9 @@ RedisMessage::RedisMessage(RedisMessage&& move)
|
||||
this->size_limit = move.size_limit;
|
||||
move.size_limit = (size_t)-1;
|
||||
|
||||
this->attachment = move.attachment;
|
||||
move.attachment = NULL;
|
||||
|
||||
parser_ = move.parser_;
|
||||
stream_ = move.stream_;
|
||||
cur_size_ = move.cur_size_;
|
||||
|
||||
Reference in New Issue
Block a user