mirror of
https://github.com/sogou/workflow.git
synced 2026-02-08 01:33:17 +08:00
Make Communicator::push() works with multiple message wrappers.
This commit is contained in:
@@ -2004,7 +2004,7 @@ int Communicator::push(const void *buf, size_t size, CommSession *session)
|
||||
(!session->passive && in->entry->session == session) ||
|
||||
session->passive == 1)
|
||||
{
|
||||
ret = in->CommMessageIn::feedback(buf, size);
|
||||
ret = in->inner()->feedback(buf, size);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -116,6 +116,9 @@ protected:
|
||||
/* In append(), reset the begin time of receiving to current time. */
|
||||
virtual void renew();
|
||||
|
||||
/* Return the deepest wrapped message. */
|
||||
virtual CommMessageIn *inner() { return this; }
|
||||
|
||||
private:
|
||||
struct CommConnEntry *entry;
|
||||
|
||||
|
||||
@@ -89,6 +89,8 @@ protected:
|
||||
return this->CommMessageIn::renew();
|
||||
}
|
||||
|
||||
virtual ProtocolMessage *inner() { return this; }
|
||||
|
||||
protected:
|
||||
size_t size_limit;
|
||||
|
||||
@@ -145,6 +147,12 @@ protected:
|
||||
return this->msg->append(buf, size);
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual ProtocolMessage *inner()
|
||||
{
|
||||
return this->msg->inner();
|
||||
}
|
||||
|
||||
protected:
|
||||
ProtocolMessage *msg;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user