Skip to content

Commit

Permalink
Development/for r2/ipnetworks live update (#517)
Browse files Browse the repository at this point in the history
* [PluginServer] Don't clear accesor URL if IP couldn't be resolved

* [NetworkInfo] Keep adapter information always up to date

* [NetworkInfo] Remove redundant code
  • Loading branch information
sebaszm authored Mar 23, 2021
1 parent 2d4060b commit b5900cf
Show file tree
Hide file tree
Showing 4 changed files with 250 additions and 323 deletions.
27 changes: 9 additions & 18 deletions Source/WPEFramework/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,6 @@ namespace PluginHost {
return (added);
}
void UpdateAccessor() {
bool validAccessor = true;
Core::NodeId result(_binding.c_str());

if (_interface.empty() == false) {
Expand Down Expand Up @@ -759,27 +758,19 @@ namespace PluginHost {
value.sin_port = htons(_portNumber);

_accessor = value;
_URL.clear();
validAccessor = false;
} else {
if (_portNumber == 80) {
_URL = string(_T("http://")) + _accessor.HostAddress() + _webPrefix;
} else {
_URL = string(_T("http://")) + _accessor.HostAddress() + ':' + Core::NumberType<uint16_t>(_portNumber).Text() + _webPrefix;
}

_accessor.PortNumber(_portNumber);
SYSLOG(Logging::Startup, ("Invalid config information could not resolve to a proper IP"));
}

if (validAccessor == false) {
SYSLOG(Logging::Startup, ("Invalid config information could not resolve to a proper IP set to: (%s:%d)", _accessor.HostAddress().c_str(), _accessor.PortNumber()));
}
else {
SYSLOG(Logging::Startup, (_T("Accessor: %s"), _URL.c_str()));
SYSLOG(Logging::Startup, (_T("Interface IP: %s"), _accessor.HostAddress().c_str()));
if (_portNumber == 80) {
_URL = string(_T("http://")) + _accessor.HostAddress() + _webPrefix;
} else {
_URL = string(_T("http://")) + _accessor.HostAddress() + ':' + Core::NumberType<uint16_t>(_portNumber).Text() + _webPrefix;
}

return;
_accessor.PortNumber(_portNumber);

SYSLOG(Logging::Startup, (_T("Accessor: %s"), _URL.c_str()));
SYSLOG(Logging::Startup, (_T("Interface IP: %s"), _accessor.HostAddress().c_str()));
}

inline const std::vector<std::string>& LinkerPluginPaths() const
Expand Down
2 changes: 1 addition & 1 deletion Source/core/Netlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ namespace Core {

public:
SocketNetlink(const NodeId& destination)
: SocketDatagram(false, destination, NodeId(), 512, 1024)
: SocketDatagram(true, destination, NodeId(), 512, 4096)
, _adminLock()
{
}
Expand Down
Loading

0 comments on commit b5900cf

Please sign in to comment.