Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It's better to use UNIX line endings (LF) in ini #22

Closed
dartraiden opened this issue Nov 6, 2018 · 5 comments
Closed

It's better to use UNIX line endings (LF) in ini #22

dartraiden opened this issue Nov 6, 2018 · 5 comments
Assignees

Comments

@dartraiden
Copy link

dartraiden commented Nov 6, 2018

vlmcsd.ini uses Windows line endings (CR LF)

This cause problems on some UNIX systems. For example, my Mi Router 3G with Padavan firmware

My vlmcsd.ini:

# Listen on all private IP addresses and reject incoming requests from public IP addresses
# Command line: -o
PublicIPProtectionLevel = 3
/etc/storage # ./vlmcsd -i /etc/storage/vlmcsd.ini
". Must be integer between 0 and 3ine 55: "PublicIPProtectionLevel = 3

Converting ini to LF solves problem.

@rouben
Copy link
Collaborator

rouben commented Nov 21, 2018

Line endings are platform dependent, and since vlmcsd is cross-platform, I would imagine it would make sense to make the code handles both LF and CRLF on any platform... I can suggest that upstream to the developer, and in the meantime, will look at the source code to see where ini file parsing is handled.

@rouben
Copy link
Collaborator

rouben commented Dec 30, 2018

I’ve looked at the config file parsing code and it’s... rather unorthodox. vlmcsd bootstraps itself while reading the config file. Not sure why the dev (Hotbird64) chose this path, whether it’s just laziness, i.e. “evolution” of a quick hack into the codebase it is today, or whether there’s a “good” reason for doing this, such as efficiency or optimizing memory usage, for example.

I’m probably completely wrong here, but I think this “fix” would entail modifying multiple lines rather than changing a single function dealing with the config file, because there is no single function dealing with the config file. I am probably completely wrong on this, though.

In either case, it’s best to make the suggestion to the author upstream, not here.

@rouben
Copy link
Collaborator

rouben commented May 13, 2019

The author (HotBird64) is aware of this issue and has committed to fixing it in future releases.

@rouben
Copy link
Collaborator

rouben commented Dec 21, 2019

Still no new releases with fixes for this upstream. I did not forget about this issue. :)

@rouben
Copy link
Collaborator

rouben commented Mar 30, 2020

This has been resolved in release svn1113.

@rouben rouben closed this as completed Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants