mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
优化网络层的GC
This commit is contained in:
@@ -265,6 +265,7 @@ func (slf *Client) Run(){
|
||||
|
||||
processor := GetProcessor(uint8(bytes[0]))
|
||||
if processor==nil {
|
||||
slf.conn.ReleaseReadMsg(bytes)
|
||||
log.Error("rpcClient %s ReadMsg head error:%+v",slf.Addr,err)
|
||||
return
|
||||
}
|
||||
@@ -274,6 +275,7 @@ func (slf *Client) Run(){
|
||||
respone.RpcResponeData =processor.MakeRpcResponse(0,nil,nil)
|
||||
|
||||
err = processor.Unmarshal(bytes[1:],respone.RpcResponeData)
|
||||
slf.conn.ReleaseReadMsg(bytes)
|
||||
if err != nil {
|
||||
processor.ReleaseRpcRespose(respone.RpcResponeData)
|
||||
log.Error("rpcClient Unmarshal head error,error:%+v",err)
|
||||
|
||||
@@ -125,6 +125,7 @@ func (agent *RpcAgent) Run() {
|
||||
}
|
||||
processor := GetProcessor(uint8(data[0]))
|
||||
if processor==nil {
|
||||
agent.conn.ReleaseReadMsg(data)
|
||||
log.Error("remote rpc %s data head error:%+v",agent.conn.RemoteAddr(),err)
|
||||
return
|
||||
}
|
||||
@@ -134,6 +135,7 @@ func (agent *RpcAgent) Run() {
|
||||
req.rpcProcessor = processor
|
||||
req.RpcRequestData = processor.MakeRpcRequest(0,"",false,nil,nil)
|
||||
err = processor.Unmarshal(data[1:],req.RpcRequestData)
|
||||
agent.conn.ReleaseReadMsg(data)
|
||||
if err != nil {
|
||||
log.Error("rpc Unmarshal request is error: %v", err)
|
||||
if req.RpcRequestData.GetSeq()>0 {
|
||||
|
||||
Reference in New Issue
Block a user