fix download issue

This commit is contained in:
Mohamed Kallel 2013-09-26 08:25:37 +01:00 committed by Strhuan Blomquist
parent 003a7aa2ce
commit b3db549d24
3 changed files with 11 additions and 5 deletions

View file

@ -228,6 +228,9 @@ void external_init()
close(pfds_in[1]);
close(pfds_out[0]);
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
DD(ERROR, "freecwmp script intialization: signal ignoring error");
external_read_pipe_input(NULL);
DD(INFO, "freecwmp script is listening");
@ -254,11 +257,11 @@ void external_exit()
while (wait(&status) != pid) {
DD(DEBUG, "waiting for child to exit");
}
}
close(pfds_in[0]);
close(pfds_out[1]);
}
}
int external_handle_action(int (*external_handler)(char *msg))
{
@ -292,7 +295,7 @@ int external_get_action(char *action, char *name, char *next_level)
json_object_put(json_obj_out);
return 0;
}
}
int external_set_action(char *action, char *name, char *value, char *change)
{

View file

@ -328,7 +328,7 @@ handle_action() {
if [ "$?" != "0" ];then
let fault_code=$fault_code+$FAULT_CPE_DOWNLOAD_FAILURE
freecwmp_fault_output "" "$fault_code"
exit 1
return 1
fi
else
local url="http://$__arg4:$__arg5@`echo $__arg1|sed 's/http:\/\///g'`"
@ -336,7 +336,7 @@ handle_action() {
if [ "$?" != "0" ];then
let fault_code=$fault_code+$FAULT_CPE_DOWNLOAD_FAILURE
freecwmp_fault_output "" "$fault_code"
exit 1
return 1
fi
fi

3
xml.c
View file

@ -1848,6 +1848,9 @@ int cwmp_launch_download(struct download *pdownload, struct transfer_complete **
}
free(fault_code);
}
else {
error = FAULT_CPE_INTERNAL_ERROR;
}
p = calloc (1,sizeof(struct transfer_complete));
if(p == NULL)