ufairiya / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

Server does not start if config file is specified in command line #226

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create mongoose.conf - file is valid, because with empty command line server 
finds it and starts properly.
2. run serser: mongoose.exe mongoose.conf

What is the expected output? What do you see instead?
I don't expect anything. I see: message about parsing config file and then 
usage message.

What version of the product are you using? On what operating system?
2.11, windows xp

Please provide any additional information below.
I think error is in the function process_command_line_arguments in the next 
condition:
  // Now handle command line flags. They override config file settings.
  for (i = 1; argv[i] != NULL; i += 2) {
    if (argv[i][0] != '-' || argv[i + 1] == NULL) {
      show_usage_and_exit();
    }
because argv[1][0] != '-' never equals '-', it will contain first letter of the 
config file - it is first argument.

Original issue reported on code.google.com by aleksey....@gmail.com on 5 Feb 2011 at 12:51

GoogleCodeExporter commented 9 years ago
Supported scenarios using the attached patch file:

0) mongoose
1) mongoose config_file
2) mongoose -x y -w z ...

apply the patch to main.c:

patch -p0 < patch_file

Original comment by barros.s...@gmail.com on 20 Jun 2011 at 12:33

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the patch, integrated - 
https://code.google.com/p/mongoose/source/detail?r=7306a1056673e13291974b38da29f
71140b1e48c.

Original comment by valenok on 21 Jun 2011 at 9:06

GoogleCodeExporter commented 9 years ago
Issue 197 has been merged into this issue.

Original comment by valenok on 21 Jun 2011 at 9:07