[Feature][ZXW-33]merge ZXW 0428 version
Change-Id: I11f167edfea428d9fab198ff00ff1364932d1b0b
diff --git a/ap/app/goahead/interface5.0/zte_web_httpshare.c b/ap/app/goahead/interface5.0/zte_web_httpshare.c
index e77e0db..6d1f382 100644
--- a/ap/app/goahead/interface5.0/zte_web_httpshare.c
+++ b/ap/app/goahead/interface5.0/zte_web_httpshare.c
@@ -20,10 +20,10 @@
int zte_httpshare_call_system(char * cmd)
{
if (NULL == cmd) {
- slog(MISC_PRINT,SLOG_DEBUG,"[httpshare]zte_httpshare_call_system: NULL-------------------------------\n");
+ slog(MISC_PRINT,SLOG_DEBUG,"[httpshare]httpshare_call_system: NULL-------------------------------\n");
return -1;
}
- slog(MISC_PRINT,SLOG_NORMAL,"[httpshare]zte_httpshare_call_system: [%s] \n", cmd);
+ slog(MISC_PRINT,SLOG_NORMAL,"[httpshare]httpshare_call_system: [%s] \n", cmd);
#if 0
return system(cmd);
#else
@@ -34,10 +34,10 @@
static int zte_httpshare_call_system_echo(char * cmd)
{
if (NULL == cmd) {
- slog(MISC_PRINT,SLOG_DEBUG,"[httpshare]zte_httpshare_call_system_echo: NULL-------------------------------\n");
+ slog(MISC_PRINT,SLOG_DEBUG,"[httpshare]httpshare_call_system_echo: NULL-------------------------------\n");
return -1;
}
- slog(MISC_PRINT,SLOG_NORMAL,"[httpshare]zte_httpshare_call_system_echo: [%s] \n", cmd);
+ slog(MISC_PRINT,SLOG_NORMAL,"[httpshare]httpshare_call_system_echo: [%s] \n", cmd);
return soft_system(cmd);
}
@@ -51,7 +51,7 @@
char *newenviron[] = { NULL };
// cmd array's size is unknown
-// slog(MISC_PRINT,SLOG_NORMAL,"[httpshare]zte_httpshare_call_zte_system: [%s %s %s] \n", cmd[0],cmd[1],cmd[2]);
+// slog(MISC_PRINT,SLOG_NORMAL,"[httpshare]httpshare_call_system: [%s %s %s] \n", cmd[0],cmd[1],cmd[2]);
pid = fork();
if (pid == -1) {
@@ -82,14 +82,14 @@
int rc = 0;
if (NULL == db) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_db_open:invalide inputs.\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_db_open:invalide inputs.\n");
return ZTE_HTTPSHARE_DB_ERROR_INVAILD_PTR;
}
rc = sqlite3_open(ZTE_HTTPSHARE_DB_PATH, &tmp_db);
if (rc) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_db_open:can not open db,sqlite3_errmsg:%s\n", sqlite3_errmsg(tmp_db));
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_db_open:can not open db,sqlite3_errmsg:%s\n", sqlite3_errmsg(tmp_db));
(void)sqlite3_close(tmp_db);
return ZTE_HTTPSHARE_DB_ERROR_NOT_OPEN_DB;
}
@@ -102,12 +102,12 @@
int rc = 0;
if (NULL == db) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_db_close:invalide inputs.\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_db_close:invalide inputs.\n");
return ZTE_HTTPSHARE_DB_ERROR_INVAILD_PTR;
}
rc = sqlite3_close(db);
if (rc) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_db_close:can not close db.\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_db_close:can not close db.\n");
return ZTE_HTTPSHARE_DB_ERROR;
}
return ZTE_HTTPSHARE_DB_OK;
@@ -118,18 +118,18 @@
int rc = 0;
if (NULL == sql) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_db_exec_sql:invalide inputs.\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_db_exec_sql:invalide inputs.\n");
return ZTE_HTTPSHARE_DB_ERROR_INVAILD_PTR;
}
if (0 != zte_httpshare_db_open(&db)) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_db_exec_sql:open httpshare.db failed.\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_db_exec_sql:open httpshare.db failed.\n");
return ZTE_HTTPSHARE_DB_ERROR_NOT_OPEN_DB;
}
rc = sqlite3_exec(db, sql, callback, fvarg, NULL);
- slog(MISC_PRINT, SLOG_NORMAL,"[httpshare]zte_httpshare_db_exec_sql:%s rc=%d\n", sql, rc);
+ slog(MISC_PRINT, SLOG_NORMAL,"[httpshare]httpshare_db_exec_sql:%s rc=%d\n", sql, rc);
if (rc) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_db_exec_sql:can not exec sql,sqlite3_errmsg:%s.\n", sqlite3_errmsg(db));
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_db_exec_sql:can not exec sql,sqlite3_errmsg:%s.\n", sqlite3_errmsg(db));
(void)zte_httpshare_db_close(db);
return ZTE_HTTPSHARE_DB_ERROR;
}
@@ -157,14 +157,14 @@
int zte_check_download_file(char *path)//0: ²»´æÔڼǼ 1:¼Ç¼´æÔÚ
{
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_check_download_file:path->%s\n", path);
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_check_download_file:download_file->%s\n", download_file);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]check_download_file:path->%s\n", path);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]check_download_file:download_file->%s\n", download_file);
if (!strncmp(path, download_file, strlen(path))) {
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_check_download_file:find used file->%s\n", path);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]check_download_file:find used file->%s\n", path);
return 1;
} else {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_check_download_file:not find file->%s\n", path);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]check_download_file:not find file->%s\n", path);
return 0;
}
}
@@ -193,14 +193,14 @@
//char *cmd = NULL;
if (!path) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_del_file null\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]del_file null\n");
return 0;
}
/*
cmd = (char *)malloc(strlen(path) + 10);
//char cmd[4*ZTE_HTTPSHARE_FILE_NAME_MAX_LEN+1] = {0};
if (NULL == cmd) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_del_file malloc error!\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]del_file malloc error!\n");
return 0;
}
snprintf(cmd, strlen(path) + 10, "rm -rf \"%s\"", path);
@@ -349,11 +349,11 @@
sleep(2);
return 1;
}
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_mount_sd %s error!\n", sd_path);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_mount_sd %s error!\n", sd_path);
}
if (0 != zte_system(cmd1)) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_mount_sd %s error!\n", USB_DEV_SDCARD_PATH_BACK);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_mount_sd %s error!\n", USB_DEV_SDCARD_PATH_BACK);
return 0;
}
sleep(2);
@@ -367,20 +367,20 @@
int cdrom = -1;
cdrom = zte_get_cdrom();
- slog(MISC_PRINT, SLOG_ERR,"zte_mount_httpshare:cdrom=%d\n",cdrom);
+ slog(MISC_PRINT, SLOG_ERR,"mount_httpshare:cdrom=%d\n",cdrom);
if(cdrom == 0)
{
memset(cmd, 0, sizeof(cmd));
zte_httpshare_call_system_echo("/bin/echo NULL > /sys/devices/platform/zx29_hsotg.0/gadget/lun0/file");
if (-1 == access(SD_CARD_PATH, F_OK)) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_mount_httpshare mmc2 no exist!\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]mount_httpshare mmc2 no exist!\n");
if(mkdir(SD_CARD_PATH, 0777) < 0)
{
slog(MISC_PRINT, SLOG_ERR,"[httpshare]mkdir(%s) fail!\n", SD_CARD_PATH);
}
return zte_httpshare_mount_sd();
} else {
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_mount_httpshare %s exist\n", SD_CARD_PATH);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]mount_httpshare %s exist\n", SD_CARD_PATH);
return zte_httpshare_mount_sd();
}
}
@@ -389,13 +389,13 @@
memset(cmd, 0, sizeof(cmd));
zte_httpshare_call_system_echo("/bin/echo NULL > /sys/devices/platform/zx29_hsotg.0/gadget/lun1/file");
if (-1 == access(SD_CARD_PATH, F_OK)) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_mount_httpshare mmc2 no exist!\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]mount_httpshare mmc2 no exist!\n");
if(mkdir(SD_CARD_PATH, 0777) < 0){
slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]mkdir fail %s exist\n", SD_CARD_PATH);
}
return zte_httpshare_mount_sd();
} else {
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_mount_httpshare %s exist\n", SD_CARD_PATH);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]mount_httpshare %s exist\n", SD_CARD_PATH);
return zte_httpshare_mount_sd();
}
}
@@ -417,8 +417,8 @@
(void)zte_web_read(NV_HTTPSHARE_WR_AUTH, HTTP_SHARE_WR_AUTH);
(void)zte_web_read(NV_HTTPSHARE_FILE, HTTP_SHARE_FILE);
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_write_auth_to_web: value is [%s]\n", HTTP_SHARE_WR_AUTH);
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_write_auth_to_web: value is [%s]\n", HTTP_SHARE_FILE);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]write_auth_to_web: value is [%s]\n", HTTP_SHARE_WR_AUTH);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]write_auth_to_web: value is [%s]\n", HTTP_SHARE_FILE);
web_feedback_header(wp);
(void)websWrite(wp, T("{\"HTTP_SHARE_WR_AUTH\":\"%s\",\"HTTP_SHARE_FILE\":\"%s\"}"),
HTTP_SHARE_WR_AUTH, HTTP_SHARE_FILE);
@@ -503,13 +503,13 @@
zte_httpshare_return_e_type zte_httpshare_check_and_creat_dir(char *path)
{
if (!path) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_check_and_creat_dir: check dir path null.\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_check_and_creat_dir: check dir path null.\n");
return ZTE_HTTPSHARE_FAILURE;
}
if (-1 == access(path, F_OK)) {
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_httpshare_check_and_creat_dir:%s does not exist,socreate it.\n", ZTE_HTTPSHARE_DB_DIR);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]httpshare_check_and_creat_dir:%s does not exist,socreate it.\n", ZTE_HTTPSHARE_DB_DIR);
if (-1 == mkdir(path, 0777)) { /*lint !e1055*/
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_check_and_creat_dir:failed to create db dir.\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_check_and_creat_dir:failed to create db dir.\n");
return ZTE_HTTPSHARE_FAILURE;
}
}
@@ -524,7 +524,7 @@
result = zte_httpshare_db_exec_sql(ZTE_CREATE_TABLE_HTTPSHARE_SQL, NULL, NULL);
if (ZTE_HTTPSHARE_DB_OK != result) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_create_table:create httpshare table result is %d\n", result);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_create_table:create httpshare table result is %d\n", result);
return result;
}
return result;
@@ -535,16 +535,16 @@
{
if (!path) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_check_file_exist:file path null.\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]check_file_exist:file path null.\n");
return 0;
}
if (-1 == access(path, F_OK)) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_check_file_exist path=%s (file not exist)\n", path);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]check_file_exist path=%s (file not exist)\n", path);
return 0;
} else {
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_check_file_exist path=%s (file exist)\n", path);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]check_file_exist path=%s (file exist)\n", path);
return 1;
}
}
@@ -562,16 +562,16 @@
if(access("/sys/kernel/debug/mmc1/present", R_OK) != 0)
{
- slog(MISC_PRINT, SLOG_ERR, "[httpshare] zte_check_sdcard_exist file not exist!\n");
+ slog(MISC_PRINT, SLOG_ERR, "[httpshare] check_sdcard_exist file not exist!\n");
return ret;
}
//fd = popen("cat /proc/proc_sd/size","r");
fd = popen("cat /sys/kernel/debug/mmc1/present", "r");
- //printf("[httpshare]zte_check_sdcard_exist cat /sys/kernel/debug/mmc1/present\n");
+ //printf("[httpshare]check_sdcard_exist cat /sys/kernel/debug/mmc1/present\n");
if (fd == NULL) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_check_sdcard_exist popen file = NULL\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]check_sdcard_exist popen file = NULL\n");
return ret;
}
if (!feof(fd) && fgets(size_sd, sizeof(size_sd), fd) != NULL) {
@@ -580,7 +580,7 @@
pclose(fd);
- //printf("[httpshare]zte_check_sdcard_exist :get size data = %d\n",ret);
+ //printf("[httpshare]check_sdcard_exist :get size data = %d\n",ret);
return ret;
}
@@ -611,7 +611,7 @@
(void)zte_web_write(STR_SDCARD_MODE_OPT, "0");
cdrom = zte_get_cdrom();
- slog(MISC_PRINT, SLOG_ERR,"zte_mount_httpshare:cdrom=%d\n",cdrom);
+ slog(MISC_PRINT, SLOG_ERR,"mount_httpshare:cdrom=%d\n",cdrom);
if(cdrom == 0)
zte_httpshare_call_system_echo("/bin/echo dev/mmcblk0 > /sys/devices/platform/zx29_hsotg.0/gadget/lun0/file");
else if(cdrom == 1)
@@ -657,11 +657,11 @@
(void)zte_del_file(ZTE_HTTPSHARE_DB_PATH);
if (ZTE_HTTPSHARE_SUCCESS != zte_httpshare_check_and_creat_dir(ZTE_HTTPSHARE_DB_DIR)) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_init:zte_httpshare_check_and_creat_dir ZTE_HTTPSHARE_DB_DIR fail!\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_init:httpshare_check_and_creat_dir HTTPSHARE_DB_DIR fail!\n");
return;
}
if (ZTE_HTTPSHARE_DB_OK != zte_httpshare_create_table()) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_init:zte_httpshare_create_table fail!\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_init:httpshare_create_table fail!\n");
return;
}
@@ -716,7 +716,7 @@
int zte_httpshare_db_id_cb(void *fvarg, int line, char **zresult, char **lname)
{
if (1 > line) {
- printf("[httpshare]zte_httpshare_db_id_cb:record no data.\n");
+ printf("[httpshare]httpshare_db_id_cb:record no data.\n");
return -1;
}
*(int*)fvarg = atoi(zresult[0]);
@@ -727,7 +727,7 @@
int zte_httpshare_check_record(char *ip)
{
if (!ip) {
- printf("[httpshare]zte_httpshare_check_record:para null.\n");
+ printf("[httpshare]httpshare_check_record:para null.\n");
return -1;
}
@@ -741,7 +741,7 @@
result = zte_httpshare_db_exec_sql(sql, zte_httpshare_db_id_cb, &id);
(void)sleep(2);
if (ZTE_HTTPSHARE_DB_OK != result) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_check_record:result %d\n", result);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_check_record:result %d\n", result);
}
return id;
@@ -753,7 +753,7 @@
{
if ((!ip) || (!path)) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_update_record:para null.\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_update_record:para null.\n");
return ZTE_HTTPSHARE_DB_ERROR;
}
@@ -764,7 +764,7 @@
result = zte_httpshare_db_exec_sql(sql, NULL, NULL);
if (ZTE_HTTPSHARE_DB_OK != result) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_update_record:update record result %d\n", result);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_update_record:update record result %d\n", result);
return result;
}
@@ -781,7 +781,7 @@
zte_httpshare_db_result_e_type zte_httpshare_get_record(char *ip, char *path)
{
if ((!ip) || (!path)) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_get_record:para null.\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_get_record:para null.\n");
return ZTE_HTTPSHARE_DB_ERROR;
}
zte_httpshare_db_result_e_type result = ZTE_HTTPSHARE_DB_OK;
@@ -792,7 +792,7 @@
result = zte_httpshare_db_exec_sql(sql, zte_httpshare_getpath_cb, path);
(void)sleep(1);
if (ZTE_HTTPSHARE_DB_OK != result) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_get_record:update record result %d\n", result);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_get_record:update record result %d\n", result);
return result;
}
@@ -804,7 +804,7 @@
{
if ((!ip) || (!path)) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_insert_path_to_db:para null.\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_insert_path_to_db:para null.\n");
return ZTE_HTTPSHARE_DB_ERROR;
}
@@ -816,7 +816,7 @@
result = zte_httpshare_db_exec_sql(sql, NULL, NULL);
if (ZTE_HTTPSHARE_DB_OK != result) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_insert_path_to_db:result %d\n", result);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_insert_path_to_db:result %d\n", result);
return result;
}
return result;
@@ -830,13 +830,13 @@
int i = 0;
struct utimbuf times;
if ((!new_time) || (!path_source)) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_change_file_time src==NULL\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]change_file_time src==NULL\n");
return;
}
if ((!strlen(path_source)) || (!strlen(new_time))) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_change_file_time src==empty\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]change_file_time src==empty\n");
return;
}
@@ -890,7 +890,7 @@
if (n < 3) {
(void)websWrite(wp, T("],\"totalRecord\":\"%d\"}}"), file_count);
if (n <= 0) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_write_filerecord_alphasort: scandir n=%d.\n", n);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]write_filerecord_alphasort: scandir n=%d.\n", n);
free(namelist);
return 1;
}
@@ -904,7 +904,7 @@
char *file_path = NULL;
file_path = (char*)malloc(ZTE_HTTPSHARE_PATH_NAME_MAX_LEN + 1);
if (!file_path) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_write_filerecord_alphasort, malloc error!\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]write_filerecord_alphasort, malloc error!\n");
(void)websWrite(wp, T("],\"totalRecord\":\"%d\"}}"), file_count);
while (n--) {
slog(MISC_PRINT, SLOG_DEBUG,"namelist[%d]:%s\n", n, namelist[n]->d_name);
@@ -925,8 +925,8 @@
errno = 0;
if (stat(file_path, &fileinfo) < 0) {
- //printf("[httpshare]zte_write_filerecord_alphasort stat < 0\n");
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_write_filerecord_alphasort stat : %s[%s]\n", strerror(errno),file_path);
+ //printf("[httpshare]write_filerecord_alphasort stat < 0\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]write_filerecord_alphasort stat : %s[%s]\n", strerror(errno),file_path);
continue;
}
file_count++;
@@ -952,7 +952,7 @@
free(file_path);
file_path = NULL;
while (n--) {
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_write_filerecord_alphasort:namelist[%d]->%s\n", n, namelist[n]->d_name);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]write_filerecord_alphasort:namelist[%d]->%s\n", n, namelist[n]->d_name);
free(namelist[n]);
}
free(namelist);
@@ -982,7 +982,7 @@
(void)websWrite(wp, T("],\"totalRecord\":\"%d\"}}"), file_count);
if (n <= 0) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_write_filerecord_alphasort_page scandir n=%d.\n", n);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]write_filerecord_alphasort_page scandir n=%d.\n", n);
free(namelist);
return 1;
}
@@ -995,7 +995,7 @@
}
file_path = (char*)malloc(ZTE_HTTPSHARE_PATH_NAME_MAX_LEN + 1);
if (!file_path) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_write_filerecord_alphasort_page:list file memory fail!\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]write_filerecord_alphasort_page:list file memory fail!\n");
(void)websWrite(wp, T("],\"totalRecord\":\"%d\"}}"), file_count);
while (n--) free(namelist[n]);
free(namelist);
@@ -1020,7 +1020,7 @@
memset(file_path, 0, ZTE_HTTPSHARE_PATH_NAME_MAX_LEN + 1);
snprintf(file_path, ZTE_HTTPSHARE_PATH_NAME_MAX_LEN + 1, "%s/%s", path, namelist[i]->d_name);
if (stat(file_path, &fileinfo) < 0) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_write_filerecord_alphasort_page stat %s[%s]\n", strerror(errno),file_path);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]write_filerecord_alphasort_page stat %s[%s]\n", strerror(errno),file_path);
continue;
}
@@ -1046,7 +1046,7 @@
free(file_path);
file_path = NULL;
while (n--) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_write_filerecord_alphasort_page:namelist[%d]->%s\n", n, namelist[n]->d_name);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]write_filerecord_alphasort_page:namelist[%d]->%s\n", n, namelist[n]->d_name);
free(namelist[n]);
}
free(namelist);
@@ -1060,13 +1060,13 @@
int zte_create_document(char* path)
{
if (!path) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_create_document:path is null\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]create_document:path is null\n");
return 0;
}
- slog(MISC_PRINT, SLOG_NORMAL,"[httpshare]zte_create_document:create new folder->%s\n", path);
+ slog(MISC_PRINT, SLOG_NORMAL,"[httpshare]create_document:create new folder->%s\n", path);
if (-1 == mkdir(path, 0777)) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_create_documentcreate new folder->%s failed\n", path);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]create_documentcreate new folder->%s failed\n", path);
return 0;
}
@@ -1086,12 +1086,12 @@
char *name = NULL;
absolute_path = (char*)malloc(ZTE_HTTPSHARE_PATH_NAME_MAX_LEN + 1);
if (!absolute_path) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_del_multi_file_record:multi del abusolute path malloc fail.\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]del_multi_file_record:multi del abusolute path malloc fail.\n");
return 0;
}
name = (char*)malloc(strlen(path1) + 1);
if (!name) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_del_multi_file_record:multi del name malloc fail.\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]del_multi_file_record:multi del name malloc fail.\n");
free(absolute_path);
absolute_path = NULL;
return 0;
@@ -1107,7 +1107,7 @@
} else {
//·¾¶Ãû³Æ³¤¶È<4096 ; ÎļþÃû³¤¶È<255
if ((strlen(name) > 255) || ((strlen(name) + strlen(path)) > 4095)) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_del_multi_file_record:filename/path too long\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]del_multi_file_record:filename/path too long\n");
free(name);
free(absolute_path);
@@ -1119,7 +1119,7 @@
// added by fenglei for security begin 20141029
if (zte_httpshare_check_patch_inlegal(absolute_path)) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_del_multi_file_record:check del path is legal or not %s\n", absolute_path);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]del_multi_file_record:check del path is legal or not %s\n", absolute_path);
free(name);
free(absolute_path);
name = absolute_path = NULL;
@@ -1131,10 +1131,10 @@
(void)zte_del_file(absolute_path);
}
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_del_multi_file_record:check result->%d.\n", check_result);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]del_multi_file_record:check result->%d.\n", check_result);
if (access(absolute_path, F_OK) == 0) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_del_multi_file_record:del file fail.\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]del_multi_file_record:del file fail.\n");
if (0 == check_result) { //²»´æÔڼǼ£¬É¾³ýʧ°Ü£¬·µ»ØÊ§°Ü
del_res = 0;
} else {
@@ -1194,7 +1194,7 @@
void zte_httpShare_getcard_value(webs_t wp)
{
if (!sd_card_isExist()) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpShare_getcard_value no sdcard.\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpShare_getcard_value no sdcard.\n");
zte_write_result_to_web(wp, NO_SDCARD);
return;
}
@@ -1241,14 +1241,14 @@
{
char *mode = websGetVar(wp, "mode_set", T(""));
- //printf("[httpshare]zte_httpShare_modeset:set to mode->%s\n", mode);
+ //printf("[httpshare]httpShare_modeset:set to mode->%s\n", mode);
if (!sd_card_isExist()) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpShare_modeset:no sdcard.\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpShare_modeset:no sdcard.\n");
zte_write_result_to_web(wp, NO_SDCARD);
return;
}
- //printf("[httpshare]zte_httpShare_modeset:sdcard exist.\n");
+ //printf("[httpshare]httpShare_modeset:sdcard exist.\n");
if ((0 != strcmp("http_share_mode", mode)) && (0 != strcmp("usb_mode", mode))) {
zte_write_result_to_web(wp, FAILURE);
return;
@@ -1285,7 +1285,7 @@
char *path_web = neutralize(path_web_tmp);
if(path_web == NULL){
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpShare_enterFold fail %s.\n", path_web_tmp);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpShare_enterFold fail %s.\n", path_web_tmp);
zte_write_result_to_web(wp, FAILURE);
return;
}
@@ -1295,7 +1295,7 @@
path_source = (char *)malloc(path_source_len); //²âÊÔ:SD_CARD_PATH_PR=/mnt/jffs2
if (!path_source) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpShare_enterFold malloc fail\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpShare_enterFold malloc fail\n");
zte_write_result_to_web(wp, FAILURE);
return;
}
@@ -1313,7 +1313,7 @@
char * ip = websGetRequestIpaddr(wp);
memset(path_source, 0, path_source_len);
snprintf(path_source, path_source_len, "%s%s", SD_CARD_PATH_PR, path_web);
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_httpShare_enterFold: path->%s, page_index->%d, ip->%s.\n", path_source, page_index, ip);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]httpShare_enterFold: path->%s, page_index->%d, ip->%s.\n", path_source, page_index, ip);
if (!sd_card_isExist()) {
zte_write_result_to_web(wp, NO_SDCARD);
@@ -1321,14 +1321,14 @@
}
if (!zte_check_file_exist(path_source)) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpShare_enterFold path inexist\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpShare_enterFold path inexist\n");
zte_write_result_to_web(wp, FAILURE);
goto end;
//return;
}
//added by fenglei for security begin 20141029
if (zte_httpshare_check_patch_inlegal(path_source)) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpShare_enterFold path %s inlegal\n", path_source);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpShare_enterFold path %s inlegal\n", path_source);
zte_write_result_to_web(wp, FAILURE);
goto end;
}
@@ -1377,7 +1377,7 @@
char *path_source = NULL;
char *path_web = neutralize(path_web_tmp);
if(path_web == NULL){
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpShare_new fail %s.\n", path_web_tmp);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpShare_new fail %s.\n", path_web_tmp);
zte_write_result_to_web(wp, FAILURE);
return;
}
@@ -1387,7 +1387,7 @@
path_source = (char *)malloc(path_source_len);
if (!path_source) {
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_httpShare_new malloc fail\n");
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]httpShare_new malloc fail\n");
zte_write_result_to_web(wp, FAILURE);
return;
}
@@ -1448,18 +1448,18 @@
char *root_web = neutralize(root_web_tmp);
if(root_web == NULL){
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpShare_del fail %s.\n", root_web_tmp);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpShare_del fail %s.\n", root_web_tmp);
zte_write_result_to_web(wp, FAILURE);
return;
}
int root_path_len = strlen(root_web) + 30;
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_httpShare_del:dele_path->%s, name->%s.\n", root_web, del_path);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]httpShare_del:dele_path->%s, name->%s.\n", root_web, del_path);
// root_path = (char *)malloc(strlen(root_web)+5);
root_path = (char *)malloc(root_path_len);
if (!root_path) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpShare_del malloc fail.\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpShare_del malloc fail.\n");
zte_write_result_to_web(wp, FAILURE);
return;
}
@@ -1471,7 +1471,7 @@
}
//added by fenglei for security begin 20141029
if (zte_httpshare_check_patch_inlegal(del_path)) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpShare_del path is inlegal %s\n", del_path);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpShare_del path is inlegal %s\n", del_path);
zte_write_result_to_web(wp, FAILURE);
goto end;
}
@@ -1514,7 +1514,7 @@
char *rw_auth = websGetVar(wp, "HTTP_SHARE_WR_AUTH", T(""));
char *file_name = websGetVar(wp, "HTTP_SHARE_FILE", T(""));
char *httpshare_status = websGetVar(wp, NV_HTTPSHARE_STATUS, T(""));
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_httpShare_auth_set:HTTP_SHARE_STATUS->%s, HTTP_SHARE_WR_AUTH->%s, HTTP_SHARE_FILE->%s\n", httpshare_status, rw_auth, file_name);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]httpShare_auth_set:HTTP_SHARE_STATUS->%s, HTTP_SHARE_WR_AUTH->%s, HTTP_SHARE_FILE->%s\n", httpshare_status, rw_auth, file_name);
if (!strcmp(httpshare_status, "Disabled")) {
(void)zte_web_write(NV_HTTPSHARE_STATUS, httpshare_status);
@@ -1556,23 +1556,23 @@
int fd = -1;
if(old_file_web == NULL || new_file_web == NULL){
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpShare_rename fail %s %s.\n", old_file_web_tmp, new_file_web_tmp);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpShare_rename fail %s %s.\n", old_file_web_tmp, new_file_web_tmp);
zte_write_result_to_web(wp, FAILURE);
return;
}
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_httpShare_rename:old name->%s\n", old_file_web);
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_httpShare_rename:new name->%s\n", new_file_web);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]httpShare_rename:old name->%s\n", old_file_web);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]httpShare_rename:new name->%s\n", new_file_web);
// old_file_name= (char *)malloc(strlen(old_file_web)+5);
old_file_name = (char *)malloc(strlen(old_file_web) + 30);
if (!old_file_name) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpShare_rename malloc fail\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpShare_rename malloc fail\n");
zte_write_result_to_web(wp, FAILURE);
return;
}
new_file_name = (char *)malloc(strlen(new_file_web) + 30);
if (!new_file_name) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpShare_rename malloc fail\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpShare_rename malloc fail\n");
zte_write_result_to_web(wp, FAILURE);
goto end2;
}
@@ -1594,23 +1594,23 @@
if ((check_result = zte_check_download_file(old_file_name))) { //ÎÞÏÂÔØ¼Ç¼
zte_write_result_to_web(wp, PROCESSING);
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpShare_rename:path is using\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpShare_rename:path is using\n");
goto end;
}
//added by fenglei for security end 20141029
fd = rename(old_file_name, new_file_name);
if (fd < 0) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpShare_rename:rename fail fd->%d\n", fd);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpShare_rename:rename fail fd->%d\n", fd);
zte_write_result_to_web(wp, FAILURE);
} else {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpShare_rename:rename success, fd->%d\n", fd);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpShare_rename:rename success, fd->%d\n", fd);
zte_httpshare_call_system("/bin/sync"); //write new file from momeroy to sdcard on time
zte_write_result_to_web(wp, SUCCESS);
}
end:
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_httpShare_rename:end2\n");
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]httpShare_rename:end2\n");
free(new_file_name);
new_file_name = NULL;
@@ -1640,7 +1640,7 @@
char *path_source = NULL;
char *path_web = neutralize(path_web_tmp);
if(path_web == NULL){
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpShare_check_file fail %s.\n", path_web_tmp);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpShare_check_file fail %s.\n", path_web_tmp);
zte_write_result_to_web(wp, FAILURE);
return;
}
@@ -1652,7 +1652,7 @@
}
path_source = (char *)malloc(path_source_len);
if (!path_source) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpShare_check_file malloc fail\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpShare_check_file malloc fail\n");
zte_write_result_to_web(wp, FAILURE);
return;
}
@@ -1766,12 +1766,12 @@
char *ptr = NULL;
if (wp->url == NULL) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_path_check error1\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]path_check error1\n");
return 0;
}
if (strlen(wp->url) == 0) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_path_check error2\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]path_check error2\n");
return 0;
}
snprintf(path_temp, ZTE_HTTPSHARE_FILE_NAME_MAX_LEN, "%s", wp->url);
@@ -1780,10 +1780,10 @@
ptr += strlen("/cgi-bin/httpshare")+1;//ptrÖ¸ÏòÃû³ÆÊ××Öĸ
if (strstr(ptr, "/") != NULL) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_path_check error\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]path_check error\n");
return 0;
}
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_path_check upload name:%s\n", ptr);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]path_check upload name:%s\n", ptr);
return 1;
}
@@ -1820,7 +1820,7 @@
int zte_reset_cgi_state(webs_t wp)
{
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_reset_cgi_state.\n");
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]reset_cgi_state.\n");
#if 0 // kw 3
if (!zte_malloc_cgi_buff()) {
slog(MISC_PRINT, SLOG_ERR,"[httpshare]malloc failed.\n");
@@ -1983,7 +1983,7 @@
zte_del_file(name);
zte_del_file(TCARD_UPLOAD_FILE);
if ((access(name, F_OK) == 0) || (access(TCARD_UPLOAD_FILE, F_OK) == 0)) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_check_upload_file del upload file fail!\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_check_upload_file del upload file fail!\n");
}
memset(file_buf_memory, 0, FILE_BUFFER_LEN);
memset(&pp_header, 0, sizeof(USER_COMMON_INFOR));
@@ -2003,8 +2003,8 @@
//snprintf(URL,sizeof(URL),"%s",wp->url);
//printf("[iphone]zte_get_upload_filename URL:%s\n",URL);
- slog(MISC_PRINT, SLOG_DEBUG,"[iphone]zte_get_upload_filename url:%s\n", wp->url);
- slog(MISC_PRINT, SLOG_DEBUG,"[iphone]zte_get_upload_filename path:%s\n", wp->path);
+ slog(MISC_PRINT, SLOG_DEBUG,"[iphone]get_upload_filename url:%s\n", wp->url);
+ slog(MISC_PRINT, SLOG_DEBUG,"[iphone]get_upload_filename path:%s\n", wp->path);
if ((wp->path == NULL) || (wp->url == NULL)) {
return -1;
@@ -2012,7 +2012,7 @@
websDecodeUrl(URL, wp->url, gstrlen(wp->url));
- slog(MISC_PRINT, SLOG_DEBUG,"[iphone]zte_get_upload_filename URL:%s\n", URL);
+ slog(MISC_PRINT, SLOG_DEBUG,"[iphone]get_upload_filename URL:%s\n", URL);
if (strlen(URL) <= 0) {
return -1;
@@ -2021,24 +2021,24 @@
temp_name = strstr(URL, "cgi-bin/httpshare");
if (temp_name == NULL) {
- slog(MISC_PRINT, SLOG_ERR,"[iphone]zte_get_upload_filename url strstr cgi == NULL\n");
+ slog(MISC_PRINT, SLOG_ERR,"[iphone]get_upload_filename url strstr cgi == NULL\n");
return -1;
}
temp_name += strlen("cgi-bin/httpshare")+1;
- slog(MISC_PRINT, SLOG_DEBUG,"[iphone]zte_get_upload_filename temp:%s\n", temp_name);
+ slog(MISC_PRINT, SLOG_DEBUG,"[iphone]get_upload_filename temp:%s\n", temp_name);
// if (temp_name != NULL) {
if (strlen(temp_name) == 0) {
- slog(MISC_PRINT, SLOG_ERR,"[iphone]zte_get_upload_filename url name == NULL,get name from file header\n");
+ slog(MISC_PRINT, SLOG_ERR,"[iphone]get_upload_filename url name == NULL,get name from file header\n");
return 0;
}
if (strstr(temp_name, "#") != NULL) {
- slog(MISC_PRINT, SLOG_ERR,"[iphone]zte_get_upload_filename url name have #,get name from file header\n");
+ slog(MISC_PRINT, SLOG_ERR,"[iphone]get_upload_filename url name have #,get name from file header\n");
return 0;
}
// }else {
-// slog(MISC_PRINT, SLOG_ERR,"[iphone]zte_get_upload_filename temp == NULL\n");
+// slog(MISC_PRINT, SLOG_ERR,"[iphone]get_upload_filename temp == NULL\n");
// return -1;
// }
@@ -2046,7 +2046,7 @@
memset(pp_current->file_name, 0, sizeof(pp_current->file_name));
snprintf(pp_current->file_name, ZTE_HTTPSHARE_FILE_NAME_MAX_LEN, "%s", temp_name);
- slog(MISC_PRINT, SLOG_DEBUG,"[iphone]zte_get_upload_filename url:%s, temp:%s, pp_header:%s\n", URL, temp_name, pp_current->file_name);
+ slog(MISC_PRINT, SLOG_DEBUG,"[iphone]get_upload_filename url:%s, temp:%s, pp_header:%s\n", URL, temp_name, pp_current->file_name);
return 1;
}
@@ -2062,7 +2062,7 @@
int name_head ;
sp_name = "filename=";
if (NULL == text) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_get_cgi_filename text is null.\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]get_cgi_filename text is null.\n");
return NULL;
}
if (!strlen(pp_current->UnixYMDTime)) {
@@ -2075,11 +2075,11 @@
}
pp_current->UnixYMDTime[k] = '\0';
}
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_get_cgi_filename UnixYMDTime is %s.\n", pp_current->UnixYMDTime);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]get_cgi_filename UnixYMDTime is %s.\n", pp_current->UnixYMDTime);
}
name_head = zte_str_index(text, sp_name); //find 'filename='
- //printf("[httpshare]zte_get_cgi_filename head is %d.\n",name_head);
+ //printf("[httpshare]get_cgi_filename head is %d.\n",name_head);
if (name_head > 0) {
for (i = name_head; * (text + i) != '\0'; i++) { //ÕÒµ½filename="test.doc"µÄµÚÒ»¸öÒýºÅλÖÃ
if (*(text + i) == '"') {
@@ -2127,7 +2127,7 @@
{
char *fdindex = NULL;
if (!buf) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_cgi_parse_file_head file head is null\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]cgi_parse_file_head file head is null\n");
return NULL;
}
@@ -2169,7 +2169,7 @@
user->infor.file_head = ZTE_CGI_PARSE_FINDE_FILE_HEAD;
user->infor.file_head_len++;
fdindex++;
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_cgi_parse_file_head file_head_len %d.\n", user->infor.file_head_len);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]cgi_parse_file_head file_head_len %d.\n", user->infor.file_head_len);
return fdindex;//Êý¾ÝÆðʼ
} else {
user->infor.file_head = ZTE_CGI_PARSE_FILE_HEAD_BEGIN;
@@ -2186,7 +2186,7 @@
{
char *fdindex = NULL;
if (!buf) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_cgi_parse_file_tail_address file tail is null\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]cgi_parse_file_tail_address file tail is null\n");
return NULL;
}
@@ -2215,7 +2215,7 @@
if ((*fdindex) == 13) {
user->infor.file_tail_addres = ZTE_CGI_PARSE_FINDE_FILE_TAIL_ADD;
user->infor.file_tail_len++;
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_cgi_parse_file_tail_address found file tail,file_tail_len->%d.\n", user->infor.file_tail_len);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]cgi_parse_file_tail_address found file tail,file_tail_len->%d.\n", user->infor.file_tail_len);
return fdindex;//file_tail start
} else {
user->infor.file_tail_addres = ZTE_CGI_PARSE_FILE_TAIL_ADD_BEGIN;
@@ -2244,12 +2244,12 @@
slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]file info: tail len->%d.\n", pp_current->infor.file_tail_len);
if (file_tail) {
pp_current->infor.file_tail_len = strlen(file_tail);
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_cgi_parse_file_tail file tail len is %d\n", pp_current->infor.file_tail_len);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]cgi_parse_file_tail file tail len is %d\n", pp_current->infor.file_tail_len);
slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]file info: tail->%s.\n", file_tail);
pp_current->infor.file_tail = ZTE_CGI_PARSE_FINDE_TAIL_IN_FILE;
return file_tail;
} else {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_cgi_parse_file_tail file_tail not found\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]cgi_parse_file_tail file_tail not found\n");
return NULL;
}
} else {
@@ -2290,15 +2290,15 @@
boolean zte_bufer_combination(char *buf, int size)
{
if ((tcard_file_size + size) < FILE_BUFFER_LEN - WEBS_SOCKET_BUFSIZ) {
- //printf("[httpshare]zte_bufer_combination tcard_file_size->%d,size->%d.\n",tcard_file_size,size);
- //printf("[httpshare]zte_bufer_combination FILE_BUFFER_LEN->%d,WEBS_SOCKET_BUFSIZ->%d.\n",FILE_BUFFER_LEN,WEBS_SOCKET_BUFSIZ);
+ //printf("[httpshare]bufer_combination tcard_file_size->%d,size->%d.\n",tcard_file_size,size);
+ //printf("[httpshare]bufer_combination FILE_BUFFER_LEN->%d,WEBS_SOCKET_BUFSIZ->%d.\n",FILE_BUFFER_LEN,WEBS_SOCKET_BUFSIZ);
memcpy(file_buf_memory_ptr, buf, size);
file_buf_memory_ptr = file_buf_memory_ptr + size;
tcard_file_size = tcard_file_size + size;
- //printf("[httpshare]zte_bufer_combination tcard_file_size->%d,size->%d.\n",tcard_file_size,size);
+ //printf("[httpshare]bufer_combination tcard_file_size->%d,size->%d.\n",tcard_file_size,size);
return FALSE;
} else {
- //printf("[httpshare]zte_bufer_combination begin to write file \n");
+ //printf("[httpshare]bufer_combination begin to write file \n");
memcpy(file_buf_memory_ptr, buf, size);
file_buf_memory_ptr = file_buf_memory_ptr + size;
@@ -2319,17 +2319,17 @@
//}
if (NULL == pp_current) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_write:zte_get_user_position failed\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_write:get_user_position failed\n");
return -1;
}
if (1 != zte_check_sdcard_exist()) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_write:zte_get_user_position failed\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_write:get_user_position failed\n");
return -1;
}
file_handler = open(pp_current->path, O_CREAT | O_WRONLY | O_APPEND, 0666);
if (file_handler < 0) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_write zte write file open file failed\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_write write file open file failed\n");
return -1;
} else {
(void)write(file_handler, file_buf_memory, tcard_file_size);
@@ -2338,7 +2338,7 @@
tcard_file_size = 0;
file_close = close(file_handler);
if (file_close < 0) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_httpshare_write zte write file close file failed\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]httpshare_write write file close file failed\n");
return -1;
}
@@ -2376,7 +2376,7 @@
left_size = zte_clen - nbytes;
if (left_size < ZTE_PARSE_CGI_TAIL_LEN) {
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_process_cgi_write left_size->%d.nbytes->%d\n", left_size, nbytes);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]process_cgi_write left_size->%d.nbytes->%d\n", left_size, nbytes);
file_tail = zte_cgi_parse_file_tail(pp_current, left_size, text, nbytes); //ÕÒµ½tail λÖÃ
slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]file_tail->%-*.*s.\n", pp_current->infor.file_tail_len, pp_current->infor.file_tail_len, file_tail);
}
@@ -2388,19 +2388,19 @@
}
if (pp_current->infor.file_tail == ZTE_CGI_PARSE_FINDE_TAIL_IN_FILE) {
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_process_cgi_write ZTE_CGI_PARSE_FINDE_TAIL_IN_FILE.\n");
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]process_cgi_write CGI_PARSE_FINDE_TAIL_IN_FILE.\n");
if (file_tail == file_head) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_process_cgi_write it is a null file\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]process_cgi_write it is a null file\n");
file_close = close(open(pp_current->path, O_CREAT, 0666));
if (file_close < 0) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_process_cgi_write zte write file close file failed\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]process_cgi_write write file close file failed\n");
}
return -1;
}
if (file_tail - file_head < 0) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_process_cgi_write file_tail-file_head = %d < 0\n", file_tail - file_head);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]process_cgi_write file_tail-file_head = %d < 0\n", file_tail - file_head);
return -1;
}
slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]file_tail-file_head->%d.\n", file_tail - file_head);
@@ -2408,7 +2408,7 @@
} else if (pp_current->infor.file_tail == ZTE_CGI_PARSE_FINDE_TAIL_IN_POOL) {
(void)zte_write_file(wp, pp_current->infor.file_tail_pool, (file_tail - pp_current->infor.file_tail_pool));
} else {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_process_cgi_write some erro happened\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]process_cgi_write some erro happened\n");
}
} else {
@@ -2420,7 +2420,7 @@
pp_current->infor.data_no = ZTE_CGI_WRITE_THE_SEC_DATA;
- printf("[httpshare]zte_process_cgi_write file head len-> %d\n", pp_current->infor.file_head_len);
+ printf("[httpshare]process_cgi_write file head len-> %d\n", pp_current->infor.file_head_len);
} else {
(void)zte_write_file(wp, file_head, nbytes);
}
@@ -2455,20 +2455,20 @@
}
if (pp_current->infor.file_tail == ZTE_CGI_PARSE_FINDE_TAIL_IN_FILE) {
- printf("[httpshare]zte_process_cgi_write ZTE_CGI_PARSE_FINDE_TAIL_IN_FILE.\n");
+ printf("[httpshare]process_cgi_write CGI_PARSE_FINDE_TAIL_IN_FILE.\n");
//if(file_tail==file_head)
//{
- // printf("[httpshare]zte_process_cgi_write it is a null file\n");
+ // printf("[httpshare]process_cgi_write it is a null file\n");
// file_close=close(open(pp_current->path, O_CREAT,0666 ));
// if(file_close<0)
// {
- // printf("[httpshare]zte_process_cgi_write zte write file close file failed\n");
+ // printf("[httpshare]process_cgi_write write file close file failed\n");
// return -1;
// }
//}
if (file_tail - file_head < 0) {
- printf("[httpshare]zte_process_cgi_write file_tail-file_head = %d < 0\n", file_tail - file_head);
+ printf("[httpshare]process_cgi_write file_tail-file_head = %d < 0\n", file_tail - file_head);
return -1;
}
@@ -2478,7 +2478,7 @@
file_end = TRUE;
ret = zte_write_file(wp, pp_current->infor.file_tail_pool, (file_tail - pp_current->infor.file_tail_pool), pp_current);
} else {
- printf("[httpshare]zte_process_cgi_write some erro happened\n");
+ printf("[httpshare]process_cgi_write some erro happened\n");
ret = 0;
}
@@ -2495,7 +2495,7 @@
}
}
}
- //printf("[zyl]zte_process_cgi_write:ret->%d\n",ret);
+ //printf("[zyl]process_cgi_write:ret->%d\n",ret);
return ret;
}
@@ -2513,7 +2513,7 @@
//pp_current = zte_get_user_position(wp);
// if (NULL == pp_current || NULL == text) { // kw 3 pp_current point to pp_aheader's address, can not be NULL
if (NULL == text) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_process_cgi_begin recv failed.\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]process_cgi_begin recv failed.\n");
return -1;
}
if (pp_current->card_full) {
@@ -2531,10 +2531,10 @@
return 1;
}
#endif
- //printf("[httpshare]file info: zte_clen->%d.\n",zte_clen);
+ //printf("[httpshare]file info: clen->%d.\n",zte_clen);
if (pp_current->infor.file_head != ZTE_CGI_PARSE_FINDE_FILE_HEAD) {
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte upload to fild head.\n");
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]upload to fild head.\n");
file_head = zte_cgi_parse_file_head(zte_get_cgi_filename(wp, text, pp_current), pp_current);
//ÕÒµ½Êý¾ÝÆðʼλfile_head
@@ -2572,13 +2572,13 @@
struct stat statbuf;
if (!temp_file_name) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_check_file_complete:path NULL\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]check_file_complete:path NULL\n");
return 0;
}
if (!strlen(temp_file_name)) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_check_file_complete:strlen(path)==0\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]check_file_complete:strlen(path)==0\n");
return 0;
}
@@ -2592,7 +2592,7 @@
//slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]ret is %d\n", ret);
if (stat(temp_file_name, &statbuf) < 0) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_check_file_complete stat : %s[%s]\n", strerror(errno),temp_file_name);
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]check_file_complete stat : %s[%s]\n", strerror(errno),temp_file_name);
return 0;
}
file_should_size = user->infor.file_raw_size - user->infor.file_head_len - user->infor.file_tail_len;
@@ -2643,7 +2643,7 @@
{
websDone(wp, 200);
sleep(1);
- slog(MISC_PRINT, SLOG_NORMAL,"[httpshare]zte_process_cgi_end websDone\n");
+ slog(MISC_PRINT, SLOG_NORMAL,"[httpshare]process_cgi_end websDone\n");
zte_remove_user();
return 1;
}
@@ -2653,12 +2653,12 @@
USER_COMMON_INFOR *pp_current = &pp_header;
#if 0 // kw 3 pp_current points to pp_haader' address, can not be null
if (NULL == pp_current) {
- slog(MISC_PRINT, SLOG_ERR,"[httpshare]zte_process_cgi_end pp_current NULL.\n");
+ slog(MISC_PRINT, SLOG_ERR,"[httpshare]process_cgi_end pp_current NULL.\n");
zte_write_result_to_web(wp, FAILURE);
return;
}
#endif
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_process_cgi_end path =%s\n", pp_current->path);
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]process_cgi_end path =%s\n", pp_current->path);
if (pp_current->card_full) {
unlink(pp_current->path);
zte_write_httpShare_upload_result_to_web(wp, FAILURE, "space_not_enough");
@@ -2668,7 +2668,7 @@
if (!zte_check_file_complete(pp_current->path, pp_current)) {
unlink(pp_current->path);
zte_write_httpShare_upload_result_to_web(wp, FAILURE, "data_lost");
- slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]zte_process_cgi_end data_lost.\n");
+ slog(MISC_PRINT, SLOG_DEBUG,"[httpshare]process_cgi_end data_lost.\n");
return;
} else {
(void)zte_httpshare_call_system("/bin/sync"); //write new file from momeroy to sdcard on time