Patch netcam url with proxy

This commit is contained in:
Mr Dave
2015-09-14 21:08:15 -06:00
parent 0c77371ad3
commit b8f657dec5
2 changed files with 9 additions and 4 deletions

View File

@@ -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.

View File

@@ -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");