Lines Matching refs:ftpc

240 static void freedirs(struct ftp_conn *ftpc)  in freedirs()  argument
242 if(ftpc->dirs) { in freedirs()
244 for(i = 0; i < ftpc->dirdepth; i++) { in freedirs()
245 free(ftpc->dirs[i]); in freedirs()
246 ftpc->dirs[i] = NULL; in freedirs()
248 free(ftpc->dirs); in freedirs()
249 ftpc->dirs = NULL; in freedirs()
250 ftpc->dirdepth = 0; in freedirs()
252 Curl_safefree(ftpc->file); in freedirs()
255 Curl_safefree(ftpc->newhost); in freedirs()
382 struct ftp_conn *ftpc = &conn->proto.ftpc; in ReceivedServerConnect() local
383 struct pingpong *pp = &ftpc->pp; in ReceivedServerConnect()
462 if(conn->proto.ftpc.state_saved == FTP_STOR) { in InitiateTransfer()
475 conn->proto.ftpc.retr_size_saved, FALSE, -1); in InitiateTransfer()
478 conn->proto.ftpc.pp.pending_resp = TRUE; /* expect server response */ in InitiateTransfer()
636 struct ftp_conn *ftpc = &conn->proto.ftpc; in Curl_GetFTPResponse() local
637 struct pingpong *pp = &ftpc->pp; in Curl_GetFTPResponse()
773 struct ftp_conn *ftpc = &conn->proto.ftpc; in _state() local
780 if(ftpc->state != newstate) in _state()
782 (void *)ftpc, lineno, ftp_state_names[ftpc->state], in _state()
787 ftpc->state = newstate; in _state()
795 PPSENDF(&conn->proto.ftpc.pp, "USER %s", ftp->user?ftp->user:""); in ftp_state_user()
808 PPSENDF(&conn->proto.ftpc.pp, "%s", "PWD"); in ftp_state_pwd()
819 return Curl_pp_getsock(&conn->proto.ftpc.pp, socks, numsocks); in ftp_getsock()
826 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_domore_getsock() local
836 if(FTP_STOP == ftpc->state) { in ftp_domore_getsock()
862 return Curl_pp_getsock(&conn->proto.ftpc.pp, socks, numsocks); in ftp_domore_getsock()
874 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_cwd() local
876 if(ftpc->cwddone) in ftp_state_cwd()
880 ftpc->count2 = 0; /* count2 counts failed CWDs */ in ftp_state_cwd()
885 ftpc->count3 = (conn->data->set.ftp_create_missing_dirs == 2)?1:0; in ftp_state_cwd()
887 if((conn->data->set.ftp_filemethod == FTPFILE_NOCWD) && !ftpc->cwdcount) in ftp_state_cwd()
890 else if(conn->bits.reuse && ftpc->entrypath) { in ftp_state_cwd()
894 ftpc->cwdcount = 0; /* we count this as the first path, then we add one in ftp_state_cwd()
896 PPSENDF(&conn->proto.ftpc.pp, "CWD %s", ftpc->entrypath); in ftp_state_cwd()
900 if(ftpc->dirdepth) { in ftp_state_cwd()
901 ftpc->cwdcount = 1; in ftp_state_cwd()
904 PPSENDF(&conn->proto.ftpc.pp, "CWD %s", ftpc->dirs[ftpc->cwdcount -1]); in ftp_state_cwd()
927 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_use_port() local
1240 result = Curl_pp_sendf(&ftpc->pp, "%s |%d|%s|%hu|", mode[fcmd], in ftp_state_use_port()
1248 ftpc->count1 = PORT; in ftp_state_use_port()
1271 result = Curl_pp_sendf(&ftpc->pp, "%s %s", mode[fcmd], tmp); in ftp_state_use_port()
1285 ftpc->count1 = fcmd; in ftp_state_use_port()
1309 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_use_pasv() local
1337 PPSENDF(&ftpc->pp, "%s", mode[modeoff]); in ftp_state_use_pasv()
1339 ftpc->count1 = modeoff; in ftp_state_use_pasv()
1375 if(!conn->proto.ftpc.file) { in ftp_state_prepare_transfer()
1376 PPSENDF(&conn->proto.ftpc.pp, "PRET %s", in ftp_state_prepare_transfer()
1382 PPSENDF(&conn->proto.ftpc.pp, "PRET STOR %s", conn->proto.ftpc.file); in ftp_state_prepare_transfer()
1385 PPSENDF(&conn->proto.ftpc.pp, "PRET RETR %s", conn->proto.ftpc.file); in ftp_state_prepare_transfer()
1400 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_rest() local
1402 if((ftp->transfer != FTPTRANSFER_BODY) && ftpc->file) { in ftp_state_rest()
1407 PPSENDF(&conn->proto.ftpc.pp, "REST %d", 0); in ftp_state_rest()
1421 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_size() local
1423 if((ftp->transfer == FTPTRANSFER_INFO) && ftpc->file) { in ftp_state_size()
1427 PPSENDF(&ftpc->pp, "SIZE %s", ftpc->file); in ftp_state_size()
1488 result = Curl_pp_sendf(&conn->proto.ftpc.pp, "%s", cmd); in ftp_state_list()
1528 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_type() local
1533 if(data->set.opt_no_body && ftpc->file && in ftp_state_type()
1560 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_mdtm() local
1563 if((data->set.get_filetime || data->set.timecondition) && ftpc->file) { in ftp_state_mdtm()
1567 PPSENDF(&ftpc->pp, "MDTM %s", ftpc->file); in ftp_state_mdtm()
1585 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_ul_setup() local
1605 PPSENDF(&ftpc->pp, "SIZE %s", ftpc->file); in ftp_state_ul_setup()
1668 PPSENDF(&ftpc->pp, data->set.ftp_append?"APPE %s":"STOR %s", in ftp_state_ul_setup()
1669 ftpc->file); in ftp_state_ul_setup()
1683 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_quote() local
1708 ftpc->count1 = 0; in ftp_state_quote()
1710 ftpc->count1++; in ftp_state_quote()
1716 while((i< ftpc->count1) && item) { in ftp_state_quote()
1724 ftpc->count2 = 1; /* the sent command is allowed to fail */ in ftp_state_quote()
1727 ftpc->count2 = 0; /* failure means cancel operation */ in ftp_state_quote()
1729 PPSENDF(&ftpc->pp, "%s", cmd); in ftp_state_quote()
1746 if(ftpc->known_filesize != -1) { in ftp_state_quote()
1747 Curl_pgrsSetDownloadSize(data, ftpc->known_filesize); in ftp_state_quote()
1748 result = ftp_state_retr(conn, ftpc->known_filesize); in ftp_state_quote()
1758 PPSENDF(&ftpc->pp, "RETR %s", ftpc->file); in ftp_state_quote()
1762 PPSENDF(&ftpc->pp, "SIZE %s", ftpc->file); in ftp_state_quote()
1796 PPSENDF(&conn->proto.ftpc.pp, "%s", "PASV"); in ftp_epsv_disable()
1797 conn->proto.ftpc.count1++; in ftp_epsv_disable()
1819 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_pasv_resp() local
1828 Curl_safefree(ftpc->newhost); in ftp_state_pasv_resp()
1830 if((ftpc->count1 == 0) && in ftp_state_pasv_resp()
1860 ftpc->newport = (unsigned short)(num & 0xffff); in ftp_state_pasv_resp()
1861 ftpc->newhost = strdup(control_address(conn)); in ftp_state_pasv_resp()
1862 if(!ftpc->newhost) in ftp_state_pasv_resp()
1874 else if((ftpc->count1 == 1) && in ftp_state_pasv_resp()
1910 ftpc->newhost = strdup(control_address(conn)); in ftp_state_pasv_resp()
1913 ftpc->newhost = aprintf("%u.%u.%u.%u", ip[0], ip[1], ip[2], ip[3]); in ftp_state_pasv_resp()
1915 if(!ftpc->newhost) in ftp_state_pasv_resp()
1918 ftpc->newport = (unsigned short)(((port[0]<<8) + port[1]) & 0xffff); in ftp_state_pasv_resp()
1920 else if(ftpc->count1 == 0) { in ftp_state_pasv_resp()
1953 rc = Curl_resolv(conn, ftpc->newhost, ftpc->newport, &addr); in ftp_state_pasv_resp()
1958 connectport = ftpc->newport; /* we connect to the remote port */ in ftp_state_pasv_resp()
1961 failf(data, "Can't resolve new host %s:%hu", ftpc->newhost, connectport); in ftp_state_pasv_resp()
1971 if(ftpc->count1 == 0 && ftpcode == 229) in ftp_state_pasv_resp()
1986 ftp_pasv_verbose(conn, addr->addr, ftpc->newhost, connectport); in ftp_state_pasv_resp()
1991 conn->secondary_port = ftpc->newport; in ftp_state_pasv_resp()
1992 conn->secondaryhostname = strdup(ftpc->newhost); in ftp_state_pasv_resp()
2006 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_port_resp() local
2007 ftpport fcmd = (ftpport)ftpc->count1; in ftp_state_port_resp()
2044 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_mdtm_resp() local
2070 ftpc->file && in ftp_state_mdtm_resp()
2179 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_retr() local
2241 PPSENDF(&ftpc->pp, "REST %" CURL_FORMAT_CURL_OFF_T, in ftp_state_retr()
2248 PPSENDF(&ftpc->pp, "RETR %s", ftpc->file); in ftp_state_retr()
2300 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_rest_resp() local
2322 PPSENDF(&ftpc->pp, "RETR %s", ftpc->file); in ftp_state_rest_resp()
2344 conn->proto.ftpc.state_saved = instate; in ftp_state_stor_resp()
2357 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_stor_resp() local
2359 ftpc->wait_data_conn = TRUE; in ftp_state_stor_resp()
2458 conn->proto.ftpc.state_saved = instate; in ftp_state_get_resp()
2459 conn->proto.ftpc.retr_size_saved = size; in ftp_state_get_resp()
2469 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_get_resp() local
2472 ftpc->wait_data_conn = TRUE; in ftp_state_get_resp()
2515 PPSENDF(&conn->proto.ftpc.pp, "PBSZ %d", 0); in ftp_state_loggedin()
2532 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_user_resp() local
2536 if((ftpcode == 331) && (ftpc->state == FTP_USER)) { in ftp_state_user_resp()
2539 PPSENDF(&ftpc->pp, "PASS %s", ftp->passwd?ftp->passwd:""); in ftp_state_user_resp()
2549 PPSENDF(&ftpc->pp, "ACCT %s", data->set.str[STRING_FTP_ACCOUNT]); in ftp_state_user_resp()
2566 PPSENDF(&conn->proto.ftpc.pp, "%s", in ftp_state_user_resp()
2603 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_statemach_act() local
2604 struct pingpong *pp = &ftpc->pp; in ftp_statemach_act()
2617 switch(ftpc->state) { in ftp_statemach_act()
2621 return ftp_state_user_resp(conn, ftpcode, ftpc->state); in ftp_statemach_act()
2653 ftpc->count3 = 0; in ftp_statemach_act()
2657 ftpc->count2 = 1; /* add one to get next */ in ftp_statemach_act()
2658 ftpc->count1 = 0; in ftp_statemach_act()
2661 ftpc->count2 = -1; /* subtract one to get next */ in ftp_statemach_act()
2662 ftpc->count1 = 1; in ftp_statemach_act()
2669 PPSENDF(&ftpc->pp, "AUTH %s", ftpauth[ftpc->count1]); in ftp_statemach_act()
2698 else if(ftpc->count3 < 1) { in ftp_statemach_act()
2699 ftpc->count3++; in ftp_statemach_act()
2700 ftpc->count1 += ftpc->count2; /* get next attempt */ in ftp_statemach_act()
2701 result = Curl_pp_sendf(&ftpc->pp, "AUTH %s", ftpauth[ftpc->count1]); in ftp_statemach_act()
2719 result = ftp_state_user_resp(conn, ftpcode, ftpc->state); in ftp_statemach_act()
2727 PPSENDF(&ftpc->pp, "PROT %c", in ftp_statemach_act()
2747 PPSENDF(&ftpc->pp, "%s", "CCC"); in ftp_statemach_act()
2836 if(!ftpc->server_os && dir[0] != '/') { in ftp_statemach_act()
2838 result = Curl_pp_sendf(&ftpc->pp, "%s", "SYST"); in ftp_statemach_act()
2843 Curl_safefree(ftpc->entrypath); in ftp_statemach_act()
2844 ftpc->entrypath = dir; /* remember this */ in ftp_statemach_act()
2845 infof(data, "Entry path is '%s'\n", ftpc->entrypath); in ftp_statemach_act()
2847 data->state.most_recent_ftp_entrypath = ftpc->entrypath; in ftp_statemach_act()
2852 Curl_safefree(ftpc->entrypath); in ftp_statemach_act()
2853 ftpc->entrypath = dir; /* remember this */ in ftp_statemach_act()
2854 infof(data, "Entry path is '%s'\n", ftpc->entrypath); in ftp_statemach_act()
2856 data->state.most_recent_ftp_entrypath = ftpc->entrypath; in ftp_statemach_act()
2891 result = Curl_pp_sendf(&ftpc->pp, "%s", "SITE NAMEFMT 1"); in ftp_statemach_act()
2897 Curl_safefree(ftpc->server_os); in ftp_statemach_act()
2898 ftpc->server_os = os; in ftp_statemach_act()
2904 Curl_safefree(ftpc->server_os); in ftp_statemach_act()
2905 ftpc->server_os = os; in ftp_statemach_act()
2930 if((ftpcode >= 400) && !ftpc->count2) { in ftp_statemach_act()
2935 result = ftp_state_quote(conn, FALSE, ftpc->state); in ftp_statemach_act()
2945 ftpc->cwdcount && !ftpc->count2) { in ftp_statemach_act()
2947 ftpc->count2++; /* counter to prevent CWD-MKD loops */ in ftp_statemach_act()
2948 PPSENDF(&ftpc->pp, "MKD %s", ftpc->dirs[ftpc->cwdcount - 1]); in ftp_statemach_act()
2954 ftpc->cwdfail = TRUE; /* don't remember this path as we failed in ftp_statemach_act()
2961 ftpc->count2 = 0; in ftp_statemach_act()
2962 if(++ftpc->cwdcount <= ftpc->dirdepth) { in ftp_statemach_act()
2964 PPSENDF(&ftpc->pp, "CWD %s", ftpc->dirs[ftpc->cwdcount - 1]); in ftp_statemach_act()
2975 if((ftpcode/100 != 2) && !ftpc->count3--) { in ftp_statemach_act()
2982 PPSENDF(&ftpc->pp, "CWD %s", ftpc->dirs[ftpc->cwdcount - 1]); in ftp_statemach_act()
2993 result = ftp_state_type_resp(conn, ftpcode, ftpc->state); in ftp_statemach_act()
2999 result = ftp_state_size_resp(conn, ftpcode, ftpc->state); in ftp_statemach_act()
3004 result = ftp_state_rest_resp(conn, ftpcode, ftpc->state); in ftp_statemach_act()
3026 result = ftp_state_get_resp(conn, ftpcode, ftpc->state); in ftp_statemach_act()
3030 result = ftp_state_stor_resp(conn, ftpcode, ftpc->state); in ftp_statemach_act()
3050 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_multi_statemach() local
3051 CURLcode result = Curl_pp_statemach(&ftpc->pp, FALSE, FALSE); in ftp_multi_statemach()
3056 *done = (ftpc->state == FTP_STOP) ? TRUE : FALSE; in ftp_multi_statemach()
3063 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_block_statemach() local
3064 struct pingpong *pp = &ftpc->pp; in ftp_block_statemach()
3067 while(ftpc->state != FTP_STOP) { in ftp_block_statemach()
3088 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_connect() local
3089 struct pingpong *pp = &ftpc->pp; in ftp_connect()
3133 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_done() local
3134 struct pingpong *pp = &ftpc->pp; in ftp_done()
3168 ftpc->ctl_valid = FALSE; in ftp_done()
3169 ftpc->cwdfail = TRUE; /* set this TRUE to prevent us to remember the in ftp_done()
3177 free(ftpc->prevpath); in ftp_done()
3180 if(data->set.chunk_end && ftpc->file) { in ftp_done()
3185 ftpc->known_filesize = -1; in ftp_done()
3194 ftpc->ctl_valid = FALSE; /* mark control connection as bad */ in ftp_done()
3196 ftpc->prevpath = NULL; /* no path remembering */ in ftp_done()
3199 size_t flen = ftpc->file?strlen(ftpc->file):0; /* file is "raw" already */ in ftp_done()
3201 if(!ftpc->cwdfail) { in ftp_done()
3202 ftpc->prevmethod = data->set.ftp_filemethod; in ftp_done()
3204 ftpc->prevpath = path; in ftp_done()
3207 ftpc->prevpath[dlen] = 0; /* terminate */ in ftp_done()
3212 ftpc->prevpath = strdup(""); in ftp_done()
3213 if(!ftpc->prevpath) in ftp_done()
3216 if(ftpc->prevpath) in ftp_done()
3217 infof(data, "Remembering we are in dir \"%s\"\n", ftpc->prevpath); in ftp_done()
3220 ftpc->prevpath = NULL; /* no path */ in ftp_done()
3225 freedirs(ftpc); in ftp_done()
3234 if(!result && ftpc->dont_check && data->req.maxdownload > 0) { in ftp_done()
3240 ftpc->ctl_valid = FALSE; /* mark control connection as bad */ in ftp_done()
3256 if(!result && (ftp->transfer == FTPTRANSFER_BODY) && ftpc->ctl_valid && in ftp_done()
3275 ftpc->ctl_valid = FALSE; /* mark control connection as bad */ in ftp_done()
3282 if(ftpc->dont_check && data->req.maxdownload > 0) { in ftp_done()
3290 if(!ftpc->dont_check) { in ftp_done()
3330 else if(!ftpc->dont_check && in ftp_done()
3340 ftpc->dont_check = FALSE; in ftp_done()
3366 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_sendquote() local
3367 struct pingpong *pp = &ftpc->pp; in ftp_sendquote()
3385 PPSENDF(&conn->proto.ftpc.pp, "%s", cmd); in ftp_sendquote()
3414 return conn->proto.ftpc.transfertype != (ascii_wanted?'A':'I'); in ftp_need_type()
3428 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_nb_type() local
3432 if(ftpc->transfertype == want) { in ftp_nb_type()
3437 PPSENDF(&ftpc->pp, "TYPE %c", want); in ftp_nb_type()
3441 ftpc->transfertype = want; in ftp_nb_type()
3481 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_do_more() local
3506 if(result && (ftpc->count1 == 0)) { in ftp_do_more()
3527 if(ftpc->state) { in ftp_do_more()
3536 if(result || (ftpc->wait_data_conn != TRUE)) in ftp_do_more()
3539 if(ftpc->wait_data_conn) in ftp_do_more()
3550 if(ftpc->wait_data_conn == TRUE) { in ftp_do_more()
3560 ftpc->wait_data_conn = FALSE; in ftp_do_more()
3577 if(ftpc->wait_data_conn) in ftp_do_more()
3593 ftpc->dont_check = TRUE; in ftp_do_more()
3598 else if(data->set.ftp_list_only || !ftpc->file) { in ftp_do_more()
3628 if(!ftpc->wait_data_conn) { in ftp_do_more()
3826 struct ftp_conn *ftpc = &conn->proto.ftpc; in wc_statemach() local
3862 ftpc->known_filesize = finfo->size; in wc_statemach()
3923 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_do() local
3926 ftpc->wait_data_conn = FALSE; /* default to no such wait */ in ftp_do()
4021 if(conn->proto.ftpc.ctl_valid) { in ftp_quit()
4022 result = Curl_pp_sendf(&conn->proto.ftpc.pp, "%s", "QUIT"); in ftp_quit()
4026 conn->proto.ftpc.ctl_valid = FALSE; /* mark control connection as bad */ in ftp_quit()
4049 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_disconnect() local
4050 struct pingpong *pp = &ftpc->pp; in ftp_disconnect()
4060 ftpc->ctl_valid = FALSE; in ftp_disconnect()
4065 if(ftpc->entrypath) { in ftp_disconnect()
4067 if(data->state.most_recent_ftp_entrypath == ftpc->entrypath) { in ftp_disconnect()
4070 free(ftpc->entrypath); in ftp_disconnect()
4071 ftpc->entrypath = NULL; in ftp_disconnect()
4074 freedirs(ftpc); in ftp_disconnect()
4075 free(ftpc->prevpath); in ftp_disconnect()
4076 ftpc->prevpath = NULL; in ftp_disconnect()
4077 free(ftpc->server_os); in ftp_disconnect()
4078 ftpc->server_os = NULL; in ftp_disconnect()
4102 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_parse_url_path() local
4111 ftpc->ctl_valid = FALSE; in ftp_parse_url_path()
4112 ftpc->cwdfail = FALSE; in ftp_parse_url_path()
4142 ftpc->dirdepth = 0; in ftp_parse_url_path()
4150 ftpc->dirs = calloc(1, sizeof(ftpc->dirs[0])); in ftp_parse_url_path()
4151 if(!ftpc->dirs) in ftp_parse_url_path()
4159 &ftpc->dirs[0], NULL, in ftp_parse_url_path()
4162 freedirs(ftpc); in ftp_parse_url_path()
4165 ftpc->dirdepth = 1; /* we consider it to be a single dir */ in ftp_parse_url_path()
4174 ftpc->dirdepth = 0; in ftp_parse_url_path()
4175 ftpc->diralloc = 5; /* default dir depth to allocate */ in ftp_parse_url_path()
4176 ftpc->dirs = calloc(ftpc->diralloc, sizeof(ftpc->dirs[0])); in ftp_parse_url_path()
4177 if(!ftpc->dirs) in ftp_parse_url_path()
4183 ftpc->dirs[0] = strdup("/"); in ftp_parse_url_path()
4184 ftpc->dirdepth++; in ftp_parse_url_path()
4191 (ftpc->dirdepth == 0))?1:0; in ftp_parse_url_path()
4201 &ftpc->dirs[ftpc->dirdepth], NULL, in ftp_parse_url_path()
4204 freedirs(ftpc); in ftp_parse_url_path()
4210 if(!ftpc->dirdepth) { in ftp_parse_url_path()
4212 ftpc->dirs[ftpc->dirdepth] = strdup("/"); in ftp_parse_url_path()
4213 if(!ftpc->dirs[ftpc->dirdepth++]) { /* run out of memory ... */ in ftp_parse_url_path()
4215 freedirs(ftpc); in ftp_parse_url_path()
4223 if(++ftpc->dirdepth >= ftpc->diralloc) { in ftp_parse_url_path()
4226 ftpc->diralloc *= 2; /* double the size each time */ in ftp_parse_url_path()
4227 bigger = realloc(ftpc->dirs, ftpc->diralloc * sizeof(ftpc->dirs[0])); in ftp_parse_url_path()
4229 freedirs(ftpc); in ftp_parse_url_path()
4232 ftpc->dirs = bigger; in ftp_parse_url_path()
4242 Curl_urldecode(conn->data, filename, 0, &ftpc->file, NULL, TRUE); in ftp_parse_url_path()
4245 freedirs(ftpc); in ftp_parse_url_path()
4250 ftpc->file = NULL; /* instead of point to a zero byte, we make it a NULL in ftp_parse_url_path()
4253 if(data->set.upload && !ftpc->file && (ftp->transfer == FTPTRANSFER_BODY)) { in ftp_parse_url_path()
4259 ftpc->cwddone = FALSE; /* default to not done */ in ftp_parse_url_path()
4261 if(ftpc->prevpath) { in ftp_parse_url_path()
4269 freedirs(ftpc); in ftp_parse_url_path()
4273 dlen -= ftpc->file?strlen(ftpc->file):0; in ftp_parse_url_path()
4274 if((dlen == strlen(ftpc->prevpath)) && in ftp_parse_url_path()
4275 !strncmp(path, ftpc->prevpath, dlen) && in ftp_parse_url_path()
4276 (ftpc->prevmethod == data->set.ftp_filemethod)) { in ftp_parse_url_path()
4278 ftpc->cwddone = TRUE; in ftp_parse_url_path()
4291 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_dophase_done() local
4310 ftpc->ctl_valid = TRUE; /* seems good */ in ftp_dophase_done()
4350 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_regular_transfer() local
4358 ftpc->ctl_valid = TRUE; /* starts good */ in ftp_regular_transfer()
4376 freedirs(ftpc); in ftp_regular_transfer()
4438 conn->proto.ftpc.known_filesize = -1; /* unknown size for now */ in ftp_setup_connection()