"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "webu.c" between
motion-release-4.2.2.tar.gz and motion-Release-4.3.0.tar.gz

About: Motion monitors the video signal from one or more cameras and is able to detect motion.

webu.c  (motion-release-4.2.2):webu.c  (motion-Release-4.3.0)
skipping to change at line 385 skipping to change at line 385
last_parm = TRUE; last_parm = TRUE;
} else { } else {
parm_len = en_pos - st_pos + 1; parm_len = en_pos - st_pos + 1;
} }
if (parm_len >= WEBUI_LEN_PARM) return; if (parm_len >= WEBUI_LEN_PARM) return;
snprintf(webui->uri_parm1, parm_len,"%s", st_pos); snprintf(webui->uri_parm1, parm_len,"%s", st_pos);
if (!last_parm){ if (!last_parm){
/* Get the parameter value */ /* Get the parameter value */
st_pos = st_pos + parm_len; /* Move past the equals sign */ st_pos = st_pos + parm_len; /* Move past the equals sign */
en_pos = strstr(st_pos,"&"); if (!strcasecmp(webui->uri_parm1,"x") || !strcasecmp(webui->uri_parm
1,"pan") ){
en_pos = strstr(st_pos,"&");
} else {
en_pos = NULL;
}
if (en_pos == NULL){ if (en_pos == NULL){
parm_len = strlen(webui->url) - parm_len; parm_len = strlen(webui->url) - parm_len;
last_parm = TRUE; last_parm = TRUE;
} else { } else {
parm_len = en_pos - st_pos + 1; parm_len = en_pos - st_pos + 1;
} }
if (parm_len >= WEBUI_LEN_PARM) return; if (parm_len >= WEBUI_LEN_PARM) return;
snprintf(webui->uri_value1, parm_len,"%s", st_pos); snprintf(webui->uri_value1, parm_len,"%s", st_pos);
} }
skipping to change at line 1295 skipping to change at line 1299
(void)version; (void)version;
(void)upload_data; (void)upload_data;
(void)upload_data_size; (void)upload_data_size;
/* Per docs, this is called twice and we should process the second call */ /* Per docs, this is called twice and we should process the second call */
if (webui->mhd_first) { if (webui->mhd_first) {
webui->mhd_first = FALSE; webui->mhd_first = FALSE;
return MHD_YES; return MHD_YES;
} }
/* Do not answer a request until the motion loop has completed at least once
*/
if (webui->cnt->passflag == 0) return MHD_NO;
if (strcmp (method, "GET") != 0){ if (strcmp (method, "GET") != 0){
MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO ,_("Invalid Method requested: %s") ,method); MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO ,_("Invalid Method requested: %s") ,method);
return MHD_NO; return MHD_NO;
} }
util_threadname_set("st", 0,NULL); util_threadname_set("st", 0,NULL);
webui->connection = connection; webui->connection = connection;
/* Throw bad URLS back to user*/ /* Throw bad URLS back to user*/
if ((webui->cnt == NULL) || (strlen(webui->url) == 0)){ if ((webui->cnt == NULL) || (strlen(webui->url) == 0)){
webu_badreq(webui); webu_badreq(webui);
retcd = webu_mhd_send(webui, FALSE); retcd = webu_mhd_send(webui, FALSE);
return retcd; return retcd;
} }
/* Do not answer a request until the motion loop has completed at least once
*/
if (webui->cnt->passflag == 0) return MHD_NO;
if (webui->cnt->webcontrol_finish) return MHD_NO; if (webui->cnt->webcontrol_finish) return MHD_NO;
if (strlen(webui->clientip) == 0){ if (strlen(webui->clientip) == 0){
webu_clientip(webui); webu_clientip(webui);
} }
webu_hostname(webui, FALSE); webu_hostname(webui, FALSE);
if (!webui->authenticated) { if (!webui->authenticated) {
retcd = webu_mhd_auth(webui, FALSE); retcd = webu_mhd_auth(webui, FALSE);
skipping to change at line 1826 skipping to change at line 1830
mhdst->mhd_ops[mhdst->mhd_opt_nbr].option = MHD_OPTION_END; mhdst->mhd_ops[mhdst->mhd_opt_nbr].option = MHD_OPTION_END;
mhdst->mhd_ops[mhdst->mhd_opt_nbr].value = 0; mhdst->mhd_ops[mhdst->mhd_opt_nbr].value = 0;
mhdst->mhd_ops[mhdst->mhd_opt_nbr].ptr_value = NULL; mhdst->mhd_ops[mhdst->mhd_opt_nbr].ptr_value = NULL;
mhdst->mhd_opt_nbr++; mhdst->mhd_opt_nbr++;
} }
static void webu_mhd_flags(struct mhdstart_ctx *mhdst){ static void webu_mhd_flags(struct mhdstart_ctx *mhdst){
/* This sets the MHD startup flags based upon what user put into configurati on */ /* This sets the MHD startup flags based upon what user put into configurati on */
mhdst->mhd_flags = MHD_USE_THREAD_PER_CONNECTION | MHD_USE_POLL| MHD_USE_SEL ECT_INTERNALLY; mhdst->mhd_flags = MHD_USE_THREAD_PER_CONNECTION;
if (mhdst->ipv6) mhdst->mhd_flags = mhdst->mhd_flags | MHD_USE_DUAL_STACK; if (mhdst->ipv6) mhdst->mhd_flags = mhdst->mhd_flags | MHD_USE_DUAL_STACK;
if ((mhdst->ctrl) && (mhdst->cnt[mhdst->indxthrd]->conf.webcontrol_tls)){ if ((mhdst->ctrl) && (mhdst->cnt[mhdst->indxthrd]->conf.webcontrol_tls)){
mhdst->mhd_flags = mhdst->mhd_flags | MHD_USE_SSL; mhdst->mhd_flags = mhdst->mhd_flags | MHD_USE_SSL;
} else if ((!mhdst->ctrl) && (mhdst->cnt[mhdst->indxthrd]->conf.stream_tls)) { } else if ((!mhdst->ctrl) && (mhdst->cnt[mhdst->indxthrd]->conf.stream_tls)) {
mhdst->mhd_flags = mhdst->mhd_flags | MHD_USE_SSL; mhdst->mhd_flags = mhdst->mhd_flags | MHD_USE_SSL;
} }
} }
 End of changes. 4 change blocks. 
6 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)