PtokaX forum

PtokaX => Bugs => Topic started by: dmvn on 24 December, 2013, 08:11:52

Title: Magic PtokaX behavior on Settings.xml file with XML syntax errors
Post by: dmvn on 24 December, 2013, 08:11:52
I've spent rather long time to dig out following problem:
PtokaX silently loads default settings without notifying user, if Settings.xml could not be loaded by tinyXML library.
But this appears as some kind of magic to user:

When I start PtokaX (v5.0.1 or SVN latest), it says 'Server start failed', and system.log contains message like
Tue 24 Dec 2013 10:52:02 AM MSK - Resolving of hostname '<Enter hub address here>' has failed.

I looked to Settings.xml - there was specified a valid IP address. I've checked network settings - all was pretty good, but where is the problem?
Only strace and looking through the sources helped me to find out the problem:

SettingManager.cpp:

Code (cpp) Select
    if(doc.LoadFile()) {
        TiXmlHandle cfg(&doc);
       // XML reading
     }
    // else DO NOTHING!


Here should be some diagnostics using methods
doc.ErrorDesc(), ErrorRow(), doc.ErrorColumn()

And I think server should NOT start if settings file is syntactically incorrect.
Title: Re: Magic PtokaX behavior on Settings.xml file with XML syntax errors
Post by: PPK on 27 December, 2013, 01:39:57
Ops :angel: I will fix that  ;)