mirror of
https://gitee.com/TarsCloud/TarsCpp.git
synced 2024-12-22 22:16:38 +08:00
update compiler bug
This commit is contained in:
parent
83b1d6e4e6
commit
c7b451eedf
@ -80,11 +80,13 @@ public:
|
||||
virtual int onDispatchResponse(const RequestPacket &req, const ResponsePacket &rsp)
|
||||
{
|
||||
cout << "async response:" << rsp.sBuffer.data() << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int onDispatchException(const RequestPacket &req, const ResponsePacket &rsp)
|
||||
{
|
||||
cout << "async exception:" << rsp.iRet << endl;
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -165,6 +165,9 @@ void syncTupCall(int c)
|
||||
|
||||
int ret = rsp.get<int>("");
|
||||
string sRsp = rsp.get<string>("sRsp");
|
||||
|
||||
// assert(ret == 0);
|
||||
// assert(sRsp == buffer);
|
||||
}
|
||||
catch(exception& e)
|
||||
{
|
||||
|
@ -258,7 +258,7 @@ void TarsCurrent::sendResponse(const char* buff, uint32_t len)
|
||||
}
|
||||
|
||||
|
||||
void TarsCurrent::sendResponse(int iRet, const vector<char> &buff, bool push)
|
||||
void TarsCurrent::sendResponse(int iRet, const vector<char> &buff)
|
||||
{
|
||||
//单向调用不需要返回
|
||||
if (_request.cPacketType == TARSONEWAY)
|
||||
@ -268,35 +268,35 @@ void TarsCurrent::sendResponse(int iRet, const vector<char> &buff, bool push)
|
||||
|
||||
// ResponsePacket response;
|
||||
// response.sBuffer = buff;
|
||||
sendResponse(iRet, buff, TARS_STATUS(), "", push);
|
||||
sendResponse(iRet, buff, TARS_STATUS(), "");
|
||||
}
|
||||
|
||||
void TarsCurrent::sendResponse(int iRet)
|
||||
{
|
||||
// ResponsePacket response;
|
||||
sendResponse(iRet, vector<char>(), TARS_STATUS(), "", false);
|
||||
sendResponse(iRet, vector<char>(), TARS_STATUS(), "");
|
||||
}
|
||||
|
||||
void TarsCurrent::sendResponse(int iRet, tars::TarsOutputStream<tars::BufferWriterVector>& os, bool push)
|
||||
void TarsCurrent::sendResponse(int iRet, tars::TarsOutputStream<tars::BufferWriterVector>& os)
|
||||
{
|
||||
// ResponsePacket response;
|
||||
// os.swap(response.sBuffer);
|
||||
sendResponse(iRet, os.getByteBuffer(), TARS_STATUS(), "", push);
|
||||
sendResponse(iRet, os.getByteBuffer(), TARS_STATUS(), "");
|
||||
}
|
||||
|
||||
void TarsCurrent::sendResponse(int iRet, tup::UniAttribute<tars::BufferWriterVector, tars::BufferReader>& attr, bool push)
|
||||
void TarsCurrent::sendResponse(int iRet, tup::UniAttribute<tars::BufferWriterVector, tars::BufferReader>& attr)
|
||||
{
|
||||
ResponsePacket response;
|
||||
attr.encode(response.sBuffer);
|
||||
sendResponse(iRet, response.sBuffer, TARS_STATUS(), "", push);
|
||||
sendResponse(iRet, response.sBuffer, TARS_STATUS(), "");
|
||||
}
|
||||
|
||||
void TarsCurrent::sendResponse(int iRet, const vector<char> &buffer, const map<string, string>& status, const string & sResultDesc, bool push)
|
||||
void TarsCurrent::sendResponse(int iRet, const vector<char> &buffer, const map<string, string>& status, const string & sResultDesc)
|
||||
{
|
||||
_ret = iRet;
|
||||
|
||||
//单向调用不需要返回
|
||||
if (_request.cPacketType == TARSONEWAY && !push)
|
||||
if (_request.cPacketType == TARSONEWAY)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -318,14 +318,7 @@ void TarsCurrent::sendResponse(int iRet, const vector<char> &buffer, const map<
|
||||
|
||||
response.iRequestId = _request.iRequestId;
|
||||
response.iMessageType = _request.iMessageType;
|
||||
if(push)
|
||||
{
|
||||
response.cPacketType = TARSPUSH;
|
||||
}
|
||||
else
|
||||
{
|
||||
response.cPacketType = TARSNORMAL;
|
||||
}
|
||||
response.cPacketType = TARSNORMAL;
|
||||
|
||||
response.iVersion = _request.iVersion;
|
||||
response.status = status;
|
||||
@ -349,14 +342,7 @@ void TarsCurrent::sendResponse(int iRet, const vector<char> &buffer, const map<
|
||||
|
||||
response.iRequestId = _request.iRequestId;
|
||||
response.iMessageType = _request.iMessageType;
|
||||
if(push)
|
||||
{
|
||||
response.cPacketType = TARSPUSH;
|
||||
}
|
||||
else
|
||||
{
|
||||
response.cPacketType = TARSNORMAL;
|
||||
}
|
||||
response.cPacketType = TARSNORMAL;
|
||||
|
||||
response.iVersion = _request.iVersion;
|
||||
response.status = status;
|
||||
|
@ -199,7 +199,7 @@ public:
|
||||
* @param status
|
||||
* @param buffer
|
||||
*/
|
||||
void sendResponse(int iRet, tars::TarsOutputStream<tars::BufferWriterVector>& os, bool push = false);
|
||||
void sendResponse(int iRet, tars::TarsOutputStream<tars::BufferWriterVector>& os);
|
||||
|
||||
/**
|
||||
* taf协议的发送响应数据(仅TAF协议有效), 直接swapbuffer , 这样可以不用copy 数据
|
||||
@ -207,14 +207,14 @@ public:
|
||||
* @param status
|
||||
* @param buffer
|
||||
*/
|
||||
void sendResponse(int iRet, tup::UniAttribute<tars::BufferWriterVector, tars::BufferReader>& attr, bool push = false);
|
||||
void sendResponse(int iRet, tup::UniAttribute<tars::BufferWriterVector, tars::BufferReader>& attr);
|
||||
|
||||
/**
|
||||
* taf协议的发送响应数据(仅TAF协议有效)
|
||||
* @param iRet
|
||||
* @param buff
|
||||
*/
|
||||
void sendResponse(int iRet, const vector<char> &buff, bool push = false);
|
||||
void sendResponse(int iRet, const vector<char> &buff);
|
||||
|
||||
/**
|
||||
* 普通协议的发送响应数据(非TAF协议有效)
|
||||
@ -287,7 +287,7 @@ protected:
|
||||
* @param sResultDesc
|
||||
* @param push
|
||||
*/
|
||||
void sendResponse(int iRet, const vector<char> &buffer, const map<string, string>& status, const string& sResultDesc, bool push = false);
|
||||
void sendResponse(int iRet, const vector<char> &buffer, const map<string, string>& status, const string& sResultDesc);
|
||||
|
||||
protected:
|
||||
/**
|
||||
|
@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
#include "util/tc_timeprovider.h"
|
||||
#include <cmath>
|
||||
|
||||
namespace tars
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user