Skip to content

Inconsistent default for /EC/Host in remote.conf: empty (amulecmd/amuleweb) vs localhost (amulegui) #821

Description

@ngosang

The default value stored for the /EC/Host key in remote.conf differs between the remote tools, even though they share the same config file.

amulecmd / amuleweb (via CaMuleExternalConnector) read it with an empty default and rely on a runtime fallback to localhost:

// src/ExternalConnector.cpp:610 (LoadConfigFile)
m_host = m_configFile->Read("/EC/Host", "");
// src/ExternalConnector.cpp:547-551 (OnCmdLineParsed) — empty value falls back to localhost
if ( !parser.Found("host", &m_host) ) {
    if ( m_host.IsEmpty() ) {
        m_host = "localhost";
    }
}

So SaveConfigFile() may write an empty Host= line to the file.

amulegui (via amule-remote-gui) reads it with localhost as the default directly:

// src/amule-remote-gui.cpp:84
wxConfig::Get()->Read("/EC/Host", &pref_host, "localhost");

Impact

No functional difference for the user — an empty host always resolves to localhost at runtime. This is purely a consistency/cosmetic issue: the same key gets a different default and may be written as an empty value by some tools and as localhost by others.

Proposed fix

Use localhost as the default in CaMuleExternalConnector::LoadConfigFile() too, so all three tools share the same default and remote.conf is written consistently:

m_host = m_configFile->Read("/EC/Host", "localhost");

(The runtime fallback at lines 547-551 can then stay as a harmless safety net or be removed.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions