- 修复RouteService中错误过滤home路由的问题 - 后端现在正确返回所有用户有权限的路由 - 添加设备管理相关功能(列表、在线监控、电源管理、远程监控) - 添加详细的修复文档和重启脚本 - 更新权限配置脚本 问题根源:后端代码中有逻辑会过滤掉home路由,导致前端收到空数组,无法生成菜单 解决方案:移除过滤home路由的逻辑,让后端返回所有有权限的路由
69 lines
2.2 KiB
C++
69 lines
2.2 KiB
C++
///----------------------------------------------------------------------------
|
|
//
|
|
// Copyright (C) Intel Corporation, 2006 - 2007.
|
|
//
|
|
// File: connector.cpp
|
|
//
|
|
// Contents: Connector that handles connection to peers
|
|
//
|
|
// Notes:
|
|
//----------------------------------------------------------------------------
|
|
|
|
#include "connector.h"
|
|
#include <ace/os_include/os_netdb.h>
|
|
#include "global.h"
|
|
#include "SOCKSv5.h"
|
|
|
|
Connection_Handler_Connector::Connection_Handler_Connector (void)
|
|
{
|
|
}
|
|
|
|
//-------------------------------------------------------
|
|
// Initiate (or reinitiate) a connection on the
|
|
// Connection_Handler.
|
|
//-------------------------------------------------------
|
|
int
|
|
Connection_Handler_Connector::initiate_connection (Tcp_Svc_Handler *connection_handler,
|
|
ACE_Synch_Options &synch_options)
|
|
{
|
|
ACE_TCHAR addr_buf[MAX_HOST_NAME_LEN];
|
|
|
|
// Mark ourselves as idle so that the various iterators will ignore
|
|
// us until we are reconnected.
|
|
connection_handler->state (Tcp_Svc_Handler::IDLE);
|
|
|
|
// We check the remote addr second so that it remains in the
|
|
// addr_buf.
|
|
if (connection_handler->local_addr ().addr_to_string (addr_buf, sizeof addr_buf) == -1
|
|
|| connection_handler->remote_addr ().addr_to_string (addr_buf, sizeof addr_buf) == -1)
|
|
ACE_ERROR_RETURN ((MY_ERROR ACE_TEXT ("can't obtain peer's address\n")), -1);
|
|
|
|
// Try to connect to the Peer.
|
|
if (this->connect (connection_handler,
|
|
connection_handler->remote_addr (),
|
|
synch_options) == -1)
|
|
{
|
|
if (errno != EWOULDBLOCK)
|
|
{
|
|
ACE_DEBUG ((MY_DEBUG ACE_TEXT("connect on address %s FAILED\n"), addr_buf));
|
|
|
|
ACE_DEBUG((MY_INFO ACE_TEXT("increasing counter=%x before reducing it later.\n"),MAX_TCP_COUNTER));
|
|
TCP_COUNTER.IncrementCheckMax();
|
|
return -1;
|
|
}
|
|
else
|
|
{
|
|
ACE_DEBUG ((MY_DEBUG
|
|
ACE_TEXT (" in the process of connecting to %s\n"), addr_buf));
|
|
}
|
|
}
|
|
else
|
|
{
|
|
ACE_DEBUG ((MY_DEBUG
|
|
ACE_TEXT ("connected to %s on %d\n"),
|
|
addr_buf, connection_handler->get_handle ()));
|
|
}
|
|
return 0;
|
|
}
|
|
|