Motion - Sanity Checkfor Config Options
You are here: Foswiki>Motion Web>SanityCheckforConfigOptions (11 Nov 2007, JoergWeber)Edit Attach

Sanity Check for Config Options

Description of Patch

Next milestone on the roadmap will be a better handling of config options. A sanity check has to be performed when the config file is parsed and also when options are changed from http interface.

Today the user can enter anything and we do some basic checks inside the main loop every frame. That makes the main loop unnecessary complex quite vulnerable. I want to simplify this by splitting the process of validating options and actually accepting them into the running process. That way, Motion can better decide what is the right time to accept changes and when a restart will be necessary when certain option are changed by the user during operation.

In a first step, I will implement the valid ranges into the existing config structure. When this is done, a split has to be done between the user provided 'raw' options and the 'hot end' inside Motion.

Installation of Patch

Download the patch file. If it is packed as a gz or tar.gz unpack it first. Then copy it to the motion source directory and issue the command (assuming the patch file is called filename_of_patch_file.diff)

patch < filename_of_patch_file.diff

Then re-build Motion and test the patch.

Change History of Patch

  • 1.0 Initial revision

Discussion and Comments

I have confused the title and the wiki-word by accident. Kenneth, can you change that for me please? I don't know exactly where the tables are stored. Thanks.

-- JoergWeber - 07 Nov 2007

Kenneth, does it really make sense to allow 4096 characters for a config option? I would guess that 255 should be enough - maybe plus option name. What do you think?

-- JoergWeber - 09 Nov 2007
Joerg , i think you are referirng to :

I think it's not necesary at all , i didn't check RFC but 255 seems a good choice.

-- AngelCarpintero - 11 Nov 2007

No, I was looking at and noticed that most of the string options are defiined with a maximum of 4096 in this table. I'm still unsure what to use best. It has to fit into the read buffer when we read a line from the config file. In that place it is with option name. When I look at the table, it more looks like without the option name.

-- JoergWeber - 11 Nov 2007
Topic revision: r5 - 11 Nov 2007, JoergWeber
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.