• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt/router/ftpclient/

Lines Matching refs:index

31 char *to_utf8(char *buf,int index)
35 if(ftp_config.multrule[index]->encoding == 0)
40 else if(ftp_config.multrule[index]->encoding == 1)
54 else if(ftp_config.multrule[index]->encoding == 2)
70 char *utf8_to(char *buf,int index)
74 if(ftp_config.multrule[index]->encoding == 0)
79 else if(ftp_config.multrule[index]->encoding == 1)
93 else if(ftp_config.multrule[index]->encoding == 2)
109 int download_(char *serverpath,int index)
112 char *temp = serverpath_to_localpath(serverpath,index);
117 char *chr_coding = utf8_to(serverpath,index);
119 char *where_it_from = (char*)malloc(sizeof(char)*(ftp_config.multrule[index]->server_ip_len + strlen(url_coding) + 2));
120 memset(where_it_from,'\0',sizeof(char)*(ftp_config.multrule[index]->server_ip_len + strlen(url_coding) + 2));
121 sprintf(where_it_from,"%s/%s",ftp_config.multrule[index]->server_ip,url_coding);
126 write_log(S_DOWNLOAD,"",serverpath,index);
153 SERVER_FILE.index = index;
164 if(strlen(ftp_config.multrule[index]->user_pwd) != 1)
165 curl_easy_setopt(curl, CURLOPT_USERPWD, ftp_config.multrule[index]->user_pwd);
180 write_log(S_ERROR,"Download failed","",index);
182 if(del_acount == index)
209 int upload(char *localpath1,int index)
219 write_log(S_UPLOAD,"",localpath1,index);
221 char *serverpath = localpath_to_serverpath(localpath1,index);
222 char *chr_coding = utf8_to(serverpath,index);
226 char *fullserverpath = (char*)malloc(sizeof(char)*(ftp_config.multrule[index]->server_ip_len + strlen(url_coding) + 2));
227 memset(fullserverpath,'\0',sizeof(char)*(ftp_config.multrule[index]->server_ip_len + strlen(url_coding) + 2));
228 sprintf(fullserverpath,"%s/%s",ftp_config.multrule[index]->server_ip,url_coding);
250 LOCAL_FILE.index = index;
263 if(strlen(ftp_config.multrule[index]->user_pwd) != 1)
264 curl_easy_setopt(curl, CURLOPT_USERPWD, ftp_config.multrule[index]->user_pwd);
289 FILE *f_stream = fopen(g_pSyncList[index]->up_item_file, "w");
292 DEBUG("open %s error\n", g_pSyncList[index]->up_item_file);
308 Delete(localpath1,index);
310 item = get_action_item("upload",localpath1,g_pSyncList[index]->unfinished_list,index);
313 add_action_item("upload",localpath1,g_pSyncList[index]->unfinished_list);
315 write_log(S_ERROR,"failed sending network data","",index);
320 Delete(localpath1,index);
322 item = get_action_item("upload",localpath1,g_pSyncList[index]->unfinished_list,index);
325 add_action_item("upload",localpath1,g_pSyncList[index]->unfinished_list);
327 write_log(S_ERROR,"the timeout time was reached","",index);
339 write_log(S_ERROR,"Permission Denied!","",index);
350 del_action_item("upload",localpath1,g_pSyncList[index]->unfinished_list);
365 int my_delete_DELE(char *localpath,int index)
369 status = is_server_exist(tmp,localpath,index);
373 char *serverpath = localpath_to_serverpath(localpath,index);
378 char *temp = utf8_to(command,index);
386 curl_easy_setopt(curl, CURLOPT_URL, ftp_config.multrule[index]->server_ip);
387 if(strlen(ftp_config.multrule[index]->user_pwd) != 1)
388 curl_easy_setopt(curl, CURLOPT_USERPWD, ftp_config.multrule[index]->user_pwd);
440 int my_delete_RMD(char *localpath,int index)
444 status = is_server_exist(tmp,localpath,index);
448 char *serverpath = localpath_to_serverpath(localpath,index);
453 char *temp = utf8_to(command,index);
461 curl_easy_setopt(curl, CURLOPT_URL, ftp_config.multrule[index]->server_ip);
462 if(strlen(ftp_config.multrule[index]->user_pwd) != 1)
463 curl_easy_setopt(curl, CURLOPT_USERPWD, ftp_config.multrule[index]->user_pwd);
486 write_log(S_ERROR,"Permission denied","",index);
523 void SearchServerTree_(Server_TreeNode* treeRoot,int index)
532 SearchServerTree_(treeRoot->Child,index);
535 SearchServerTree_(treeRoot->NextBrother,index);
545 char *temp = serverpath_to_localpath(de_foldercurrent->href,index);
546 my_delete_RMD(temp,index);
553 char *temp = serverpath_to_localpath(de_filecurrent->href,index);
554 my_delete_DELE(temp,index);
560 int Delete(char *localpath,int index)
562 int flag = my_delete_DELE(localpath,index);
565 char *serverpath = localpath_to_serverpath(localpath,index);
567 browse_to_tree(serverpath,ServerNode_del,index);
569 SearchServerTree_(ServerNode_del,index);
571 flag = my_delete_RMD(localpath,index);
573 //my_delete_RMD(localpath,index);
577 int my_rename_(char *localpath,char *newername,int index)
581 char *cd_path = localpath_to_serverpath(prepath,index);
591 char *A = utf8_to(str1,index);
592 char *B = utf8_to(str2,index);
593 char *C = utf8_to(str3,index);
607 curl_easy_setopt(curl, CURLOPT_URL, ftp_config.multrule[index]->server_ip);
608 if(strlen(ftp_config.multrule[index]->user_pwd) != 1)
609 curl_easy_setopt(curl, CURLOPT_USERPWD, ftp_config.multrule[index]->user_pwd);
627 status = upload(temp,index);
632 status = moveFolder(localpath,temp,index);
668 int my_mkdir_(char *localpath,int index)
677 // if(strcmp(localpath,ftp_config.multrule[index]->base_path) == 0)
679 // write_log(S_ERROR,"Server Del Sync Folder!","",index);
683 char *serverpath = localpath_to_serverpath(localpath,index);
688 char *temp = utf8_to(command,index);
696 curl_easy_setopt(curl, CURLOPT_URL, ftp_config.multrule[index]->server_ip);
697 if(strlen(ftp_config.multrule[index]->user_pwd) != 1)
698 curl_easy_setopt(curl, CURLOPT_USERPWD, ftp_config.multrule[index]->user_pwd);
722 write_log(S_ERROR,"Permission denied","",index);
738 write_log(S_ERROR,"Make Dir failed.","",index);
759 int moveFolder(char *old_dir,char *new_dir,int index)
761 //my_delete(old_dir,index);
762 Delete(old_dir,index);
771 status = my_mkdir_(new_dir,index);
790 if(socket_check(new_dir,ent->d_name,index) == 1)
794 status = moveFolder(old_fullname,new_fullname,index);
806 status = upload(new_fullname,index);
817 char *serverpath = localpath_to_serverpath(new_fullname,index);
818 mod_time *onefiletime = Getmodtime(serverpath,index);
820 if(ChangeFile_modtime(new_fullname,onefiletime->modtime,index))
840 int socket_check(char *dir,char *name,int index)
861 Node *pTemp = g_pSyncList[index]->SocketActionList->next;