Skip to content

Commit b5900cf

Browse files
authored
Development/for r2/ipnetworks live update (#517)
* [PluginServer] Don't clear accesor URL if IP couldn't be resolved * [NetworkInfo] Keep adapter information always up to date * [NetworkInfo] Remove redundant code
1 parent 2d4060b commit b5900cf

File tree

4 files changed

+250
-323
lines changed

4 files changed

+250
-323
lines changed

Source/WPEFramework/Config.h

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,6 @@ namespace PluginHost {
728728
return (added);
729729
}
730730
void UpdateAccessor() {
731-
bool validAccessor = true;
732731
Core::NodeId result(_binding.c_str());
733732

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

761760
_accessor = value;
762-
_URL.clear();
763-
validAccessor = false;
764-
} else {
765-
if (_portNumber == 80) {
766-
_URL = string(_T("http://")) + _accessor.HostAddress() + _webPrefix;
767-
} else {
768-
_URL = string(_T("http://")) + _accessor.HostAddress() + ':' + Core::NumberType<uint16_t>(_portNumber).Text() + _webPrefix;
769-
}
770-
771-
_accessor.PortNumber(_portNumber);
761+
SYSLOG(Logging::Startup, ("Invalid config information could not resolve to a proper IP"));
772762
}
773763

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

782-
return;
770+
_accessor.PortNumber(_portNumber);
771+
772+
SYSLOG(Logging::Startup, (_T("Accessor: %s"), _URL.c_str()));
773+
SYSLOG(Logging::Startup, (_T("Interface IP: %s"), _accessor.HostAddress().c_str()));
783774
}
784775

785776
inline const std::vector<std::string>& LinkerPluginPaths() const

Source/core/Netlink.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ namespace Core {
379379

380380
public:
381381
SocketNetlink(const NodeId& destination)
382-
: SocketDatagram(false, destination, NodeId(), 512, 1024)
382+
: SocketDatagram(true, destination, NodeId(), 512, 4096)
383383
, _adminLock()
384384
{
385385
}

0 commit comments

Comments
 (0)