mirror of
https://github.com/Motion-Project/motion.git
synced 2026-01-29 17:11:32 -05:00
Patch netcam url with proxy
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
Summary of Changes
|
||||
* Add patch for ports on proxy netcams from GVautier (issue 144906)
|
||||
* Add patch from JonGuess(issue 151452) for treatment of partial netcam images.
|
||||
* Consolidate the Sqlite3 options into the code standard.
|
||||
* Draft revised motion_guide.html with new options.
|
||||
|
||||
12
netcam.c
12
netcam.c
@@ -2186,10 +2186,14 @@ static int netcam_http_build_url(netcam_context_ptr netcam, struct url_t *url)
|
||||
* Allocate space for a working string to contain the path.
|
||||
* The extra 4 is for "://" and string terminator.
|
||||
*/
|
||||
ptr = mymalloc(strlen(url->service) + strlen(url->host)
|
||||
+ strlen(url->path) + 4);
|
||||
sprintf((char *)ptr, "http://%s%s", url->host, url->path);
|
||||
|
||||
if (url->port != 0) {
|
||||
ptr = mymalloc(strlen(url->service) + strlen(url->host) + 7 + strlen(url->path) + 4);
|
||||
sprintf((char *)ptr, "http://%s:%d%s", url->host, url->port , url->path);
|
||||
}else {
|
||||
ptr = mymalloc(strlen(url->service) + strlen(url->host) + strlen(url->path) + 4);
|
||||
sprintf((char *)ptr, "http://%s%s", url->host, url->path);
|
||||
}
|
||||
|
||||
netcam->connect_keepalive = FALSE; /* Disable Keepalive if proxy */
|
||||
free((void *)netcam->cnt->conf.netcam_keepalive);
|
||||
netcam->cnt->conf.netcam_keepalive = strdup("off");
|
||||
|
||||
Reference in New Issue
Block a user