Motion - Web Http Many Threads
You are here: Foswiki>Motion Web>WebHttpManyThreads (10 Jan 2015, DavidPowell)Edit Attach

webhttpd for more than 9 threads

Introduction

The distributed version of motion 3.2.4 fails to set camera status if the camera thread number is more than 9. This patch adjusts local pointers to permit dozens of threads to be controlled. It is untested, but should work up to any number of threads supported by the rest of the code

Description of Patch

Simple patch file. It is against version 3.2.4 downloaded March 2006.

Installation of Patch

Please review the patch and include it in test versions before distributing. I am not a full time programmer.

It goes in webhttpd.c in function handle_get.

* webhttpd.c.patch: The patch

Change History of Patch

Patch

[root@venus motion-3.2.4]# diff webhttpd.c.dist webhttpd.c > webhttpd.c.patch
[root@venus motion-3.2.4]# cat webhttpd.c.patch
1612a1613,1614
>                               /* adjust pointer for trailing slash, then */
>                               /* adjust for more than single digit thread numbers */
1619a1622,1627
>                               int temp_thread=thread;
>                               while ( temp_thread > 9 ){
>                                       pointer++;
>                                       length_uri--;
>                                       temp_thread/=10;
>                               }
[root@venus motion-3.2.4]#

Discussion and Comments

I have been using a similar patch, for only two digits, successfully for six months on our site. Using scripts and crontab we can turn the cameras on or off multiple times daily.

I've patched motion , but not with your patch . Now web interface allow up to 99 threads , i've tried with 18 threads and works fine .

If you want to test it , take the last daily snap.

-- AngelCarpintero - 13 Mar 2006

SVN 62/63. Daily snap 20060313


Update status , i forgot :-/

-- AngelCarpintero - 20 Oct 2007

This patch is apparently not in 3.2.12. Can we get it put there?

-- DavidPowell - 10 Jan 2015

Never mind, it's there... having a senior moment. Sorry.

-- DavidPowell - 10 Jan 2015
Topic revision: r6 - 10 Jan 2015, DavidPowell
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.