偏移量大于主数据区规定长度,转向写入配置数据区

This commit is contained in:
cdyong 2015-11-04 08:37:24 +00:00
parent ea88a63ebe
commit 0c27d93ab9
2 changed files with 7 additions and 1 deletions

View File

@ -21,6 +21,7 @@ TinyServer::TinyServer(TinyController* control)
Control->Param = this;
Control->Mode = 2; // 服务端接收所有消息
DataStoreLent =64;
Received = NULL;
Param = NULL;
@ -438,6 +439,10 @@ bool TinyServer::OnWrite(TinyMessage& msg, Device& dv)
Stream ms = msg.ToStream();
uint offset = ms.ReadEncodeInt();
if(offset>DataStoreLent)
{
return true;
}
// 计算还有多少数据可写
uint len = ms.Remain();
int remain = dv.Store.Capacity() - offset;

View File

@ -14,6 +14,7 @@
class TinyServer
{
private:
byte DataStoreLent;
public:
TinyController* Control;