Skip to content

Commit

Permalink
fixed windows compile
Browse files Browse the repository at this point in the history
  • Loading branch information
jehoochen committed Jul 26, 2017
1 parent 80e43c6 commit f4f0dab
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion mars/comm/network/netinfo_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ std::string GetDetailNetInfo() {
break;
}
detail_net_info << "--------NetConfig Info----------"<< "\n";
//2.网络配置信息(默认网关、dns svr、路由表)
//2.网络配置信息(默认网关、dns svr、路由表)
in6_addr addr6_gateway;
memset(&addr6_gateway, 0, sizeof(addr6_gateway));
if (0 == getdefaultgateway6(&addr6_gateway)) {
Expand Down
4 changes: 2 additions & 2 deletions mars/sdt/src/checkimpl/dnsquery.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ int socket_gethostbyname(const char* _host, socket_ipinfo_t* _ipinfo, int _timeo
dns = (struct DNS_HEADER*)recv_buf; // 指向recv_buf的header
ReadRecvAnswer(recv_buf, dns, reader, answers);

// 把查询到的IP放入返回参数_ipinfo结构体中
// 把查询到的IP放入返回参数_ipinfo结构体中
int answer_count = std::min(SOCKET_MAX_IP_COUNT, (int)ntohs(dns->ans_count));
_ipinfo->size = 0;

Expand All @@ -233,7 +233,7 @@ int socket_gethostbyname(const char* _host, socket_ipinfo_t* _ipinfo, int _timeo
FreeAll(answers);
xinfo2(TSF"close fd in dnsquery,sock=%0", sock);
::socket_close(sock);
return ret; //* 查询DNS服务器超时
return ret; //* 查询DNS服务器超时
}

int socket_gethostbyname(const char* _host, socket_ipinfo_t* _ipinfo, int _timeout /*ms*/, const char* _dnsserver) {
Expand Down
20 changes: 10 additions & 10 deletions mars/stn/stn.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,18 +218,18 @@ extern bool (*MakesureAuthed)();
//流量统计
extern void (*TrafficData)(ssize_t _send, ssize_t _recv);

//底层询问上层该host对应的ip列表
//底层询问上层该host对应的ip列表
extern std::vector<std::string> (*OnNewDns)(const std::string& host);
//网络层收到push消息回调
//网络层收到push消息回调
extern void (*OnPush)(uint64_t _channel_id, uint32_t _cmdid, uint32_t _taskid, const AutoBuffer& _body, const AutoBuffer& _extend);
//底层获取task要发送的数据
//底层获取task要发送的数据
extern bool (*Req2Buf)(uint32_t taskid, void* const user_context, AutoBuffer& outbuffer, AutoBuffer& extend, int& error_code, const int channel_select);
//底层回包返回给上层解析
//底层回包返回给上层解析
extern int (*Buf2Resp)(uint32_t taskid, void* const user_context, const AutoBuffer& inbuffer, const AutoBuffer& extend, int& error_code, const int channel_select);
//任务执行结束
//任务执行结束
extern int (*OnTaskEnd)(uint32_t taskid, void* const user_context, int error_type, int error_code);

//上报网络连接状态
//上报网络连接状态
extern void (*ReportConnectStatus)(int status, int longlink_status);

extern void (*OnLongLinkNetworkError)(ErrCmdType _err_type, int _err_code, const std::string& _ip, uint16_t _port);
Expand All @@ -243,13 +243,13 @@ extern bool (*OnLonglinkIdentifyResponse)(const AutoBuffer& response_buffer, con
extern void (*RequestSync)();


//底层询问上层http网络检查的域名列表
//底层询问上层http网络检查的域名列表
extern void (*RequestNetCheckShortLinkHosts)(std::vector<std::string>& _hostlist);
//底层向上层上报cgi执行结果
//底层向上层上报cgi执行结果
extern void (*ReportTaskProfile)(const TaskProfile& _task_profile);
//底层通知上层cgi命中限制
//底层通知上层cgi命中限制
extern void (*ReportTaskLimited)(int _check_type, const Task& _task, unsigned int& _param);
//底层上报域名dns结果
//底层上报域名dns结果
extern void (*ReportDnsProfile)(const DnsProfile& _dns_profile);

}}
Expand Down
14 changes: 7 additions & 7 deletions mars/stn/stn_logic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -255,46 +255,46 @@ bool (*MakesureAuthed)()
return sg_callback->MakesureAuthed();
};

// 流量统计
// 流量统计
void (*TrafficData)(ssize_t _send, ssize_t _recv)
= [](ssize_t _send, ssize_t _recv) {
xassert2(sg_callback != NULL);
return sg_callback->TrafficData(_send, _recv);
};

//底层询问上层该host对应的ip列表
//底层询问上层该host对应的ip列表
std::vector<std::string> (*OnNewDns)(const std::string& host)
= [](const std::string& host) {
xassert2(sg_callback != NULL);
return sg_callback->OnNewDns(host);
};

//网络层收到push消息回调
//网络层收到push消息回调
void (*OnPush)(uint64_t _channel_id, uint32_t _cmdid, uint32_t _taskid, const AutoBuffer& _body, const AutoBuffer& _extend)
= [](uint64_t _channel_id, uint32_t _cmdid, uint32_t _taskid, const AutoBuffer& _body, const AutoBuffer& _extend) {
xassert2(sg_callback != NULL);
sg_callback->OnPush(_channel_id, _cmdid, _taskid, _body, _extend);
};
//底层获取task要发送的数据
//底层获取task要发送的数据
bool (*Req2Buf)(uint32_t taskid, void* const user_context, AutoBuffer& outbuffer, AutoBuffer& extend, int& error_code, const int channel_select)
= [](uint32_t taskid, void* const user_context, AutoBuffer& outbuffer, AutoBuffer& extend, int& error_code, const int channel_select) {
xassert2(sg_callback != NULL);
return sg_callback->Req2Buf(taskid, user_context, outbuffer, extend, error_code, channel_select);
};
//底层回包返回给上层解析
//底层回包返回给上层解析
int (*Buf2Resp)(uint32_t taskid, void* const user_context, const AutoBuffer& inbuffer, const AutoBuffer& extend, int& error_code, const int channel_select)
= [](uint32_t taskid, void* const user_context, const AutoBuffer& inbuffer, const AutoBuffer& extend, int& error_code, const int channel_select) {
xassert2(sg_callback != NULL);
return sg_callback->Buf2Resp(taskid, user_context, inbuffer, extend, error_code, channel_select);
};
//任务执行结束
//任务执行结束
int (*OnTaskEnd)(uint32_t taskid, void* const user_context, int error_type, int error_code)
= [](uint32_t taskid, void* const user_context, int error_type, int error_code) {
xassert2(sg_callback != NULL);
return sg_callback->OnTaskEnd(taskid, user_context, error_type, error_code);
};

//上报网络连接状态
//上报网络连接状态
void (*ReportConnectStatus)(int status, int longlink_status)
= [](int status, int longlink_status) {
xassert2(sg_callback != NULL);
Expand Down
12 changes: 6 additions & 6 deletions mars/stn/stn_logic.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,22 @@ namespace stn{
//流量统计
virtual void TrafficData(ssize_t _send, ssize_t _recv) = 0;

//底层询问上层该host对应的ip列表
//底层询问上层该host对应的ip列表
virtual std::vector<std::string> OnNewDns(const std::string& host) = 0;
//网络层收到push消息回调
//网络层收到push消息回调
virtual void OnPush(uint64_t _channel_id, uint32_t _cmdid, uint32_t _taskid, const AutoBuffer& _body, const AutoBuffer& _extend) = 0;
//底层获取task要发送的数据
//底层获取task要发送的数据
virtual bool Req2Buf(uint32_t _taskid, void* const _user_context, AutoBuffer& outbuffer, AutoBuffer& extend, int& error_code, const int channel_select) = 0;
//底层回包返回给上层解析
//底层回包返回给上层解析
virtual int Buf2Resp(uint32_t _taskid, void* const _user_context, const AutoBuffer& _inbuffer, const AutoBuffer& _extend, int& _error_code, const int _channel_select) = 0;
//任务执行结束
virtual int OnTaskEnd(uint32_t _taskid, void* const _user_context, int _error_type, int _error_code) = 0;

//上报网络连接状态
//上报网络连接状态
virtual void ReportConnectStatus(int _status, int _longlink_status) = 0;
//长连信令校验 ECHECK_NOW = 0, ECHECK_NEXT = 1, ECHECK_NEVER = 2
virtual int GetLonglinkIdentifyCheckBuffer(AutoBuffer& _identify_buffer, AutoBuffer& _buffer_hash, int32_t& _cmdid) = 0;
//长连信令校验回包
//长连信令校验回包
virtual bool OnLonglinkIdentifyResponse(const AutoBuffer& _response_buffer, const AutoBuffer& _identify_buffer_hash) = 0;


Expand Down

0 comments on commit f4f0dab

Please sign in to comment.