From f4f0dab91dd4f8b78b718bccb312dc755d63c58e Mon Sep 17 00:00:00 2001 From: jehoochen Date: Wed, 26 Jul 2017 17:26:41 +0800 Subject: [PATCH] fixed windows compile --- mars/comm/network/netinfo_util.cc | 2 +- mars/sdt/src/checkimpl/dnsquery.cc | 4 ++-- mars/stn/stn.h | 20 ++++++++++---------- mars/stn/stn_logic.cc | 14 +++++++------- mars/stn/stn_logic.h | 12 ++++++------ 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/mars/comm/network/netinfo_util.cc b/mars/comm/network/netinfo_util.cc index 77c54aa4c..eff7f1b8d 100644 --- a/mars/comm/network/netinfo_util.cc +++ b/mars/comm/network/netinfo_util.cc @@ -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)) { diff --git a/mars/sdt/src/checkimpl/dnsquery.cc b/mars/sdt/src/checkimpl/dnsquery.cc index f9d0ace82..1ac43ee45 100644 --- a/mars/sdt/src/checkimpl/dnsquery.cc +++ b/mars/sdt/src/checkimpl/dnsquery.cc @@ -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; @@ -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) { diff --git a/mars/stn/stn.h b/mars/stn/stn.h index b2c9ce9c9..78280f536 100644 --- a/mars/stn/stn.h +++ b/mars/stn/stn.h @@ -218,18 +218,18 @@ extern bool (*MakesureAuthed)(); //流量统计 extern void (*TrafficData)(ssize_t _send, ssize_t _recv); -//底层询问上层该host对应的ip列表 +//底层询问上层该host对应的ip列表 extern std::vector (*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); @@ -243,13 +243,13 @@ extern bool (*OnLonglinkIdentifyResponse)(const AutoBuffer& response_buffer, con extern void (*RequestSync)(); -//底层询问上层http网络检查的域名列表 +//底层询问上层http网络检查的域名列表 extern void (*RequestNetCheckShortLinkHosts)(std::vector& _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); }} diff --git a/mars/stn/stn_logic.cc b/mars/stn/stn_logic.cc index 1aace2573..ae6510a13 100644 --- a/mars/stn/stn_logic.cc +++ b/mars/stn/stn_logic.cc @@ -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 (*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); diff --git a/mars/stn/stn_logic.h b/mars/stn/stn_logic.h index 4b78e4cbf..e02f8eece 100644 --- a/mars/stn/stn_logic.h +++ b/mars/stn/stn_logic.h @@ -46,22 +46,22 @@ namespace stn{ //流量统计 virtual void TrafficData(ssize_t _send, ssize_t _recv) = 0; - //底层询问上层该host对应的ip列表 + //底层询问上层该host对应的ip列表 virtual std::vector 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;