Lines Matching refs:ftpc

281 static void freedirs(struct ftp_conn *ftpc)  in freedirs()  argument
284 if(ftpc->dirs) { in freedirs()
285 for(i=0; i < ftpc->dirdepth; i++) { in freedirs()
286 free(ftpc->dirs[i]); in freedirs()
287 ftpc->dirs[i]=NULL; in freedirs()
289 free(ftpc->dirs); in freedirs()
290 ftpc->dirs = NULL; in freedirs()
291 ftpc->dirdepth = 0; in freedirs()
293 Curl_safefree(ftpc->file); in freedirs()
296 Curl_safefree(ftpc->newhost); in freedirs()
419 struct ftp_conn *ftpc = &conn->proto.ftpc; in ReceivedServerConnect() local
420 struct pingpong *pp = &ftpc->pp; in ReceivedServerConnect()
500 if(conn->proto.ftpc.state_saved == FTP_STOR) { in InitiateTransfer()
517 conn->proto.ftpc.retr_size_saved, FALSE, in InitiateTransfer()
521 conn->proto.ftpc.pp.pending_resp = TRUE; /* expect server response */ in InitiateTransfer()
683 struct ftp_conn *ftpc = &conn->proto.ftpc; in Curl_GetFTPResponse() local
684 struct pingpong *pp = &ftpc->pp; in Curl_GetFTPResponse()
819 struct ftp_conn *ftpc = &conn->proto.ftpc; in _state() local
826 if(ftpc->state != newstate) in _state()
828 (void *)ftpc, lineno, ftp_state_names[ftpc->state], in _state()
833 ftpc->state = newstate; in _state()
841 PPSENDF(&conn->proto.ftpc.pp, "USER %s", ftp->user?ftp->user:""); in ftp_state_user()
854 PPSENDF(&conn->proto.ftpc.pp, "%s", "PWD"); in ftp_state_pwd()
865 return Curl_pp_getsock(&conn->proto.ftpc.pp, socks, numsocks); in ftp_getsock()
872 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_domore_getsock() local
882 if(FTP_STOP == ftpc->state) { in ftp_domore_getsock()
909 return Curl_pp_getsock(&conn->proto.ftpc.pp, socks, numsocks); in ftp_domore_getsock()
921 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_cwd() local
923 if(ftpc->cwddone) in ftp_state_cwd()
927 ftpc->count2 = 0; /* count2 counts failed CWDs */ in ftp_state_cwd()
932 ftpc->count3 = (conn->data->set.ftp_create_missing_dirs==2)?1:0; in ftp_state_cwd()
934 if(conn->bits.reuse && ftpc->entrypath) { in ftp_state_cwd()
938 ftpc->count1 = 0; /* we count this as the first path, then we add one in ftp_state_cwd()
940 PPSENDF(&conn->proto.ftpc.pp, "CWD %s", ftpc->entrypath); in ftp_state_cwd()
944 if(ftpc->dirdepth) { in ftp_state_cwd()
945 ftpc->count1 = 1; in ftp_state_cwd()
948 PPSENDF(&conn->proto.ftpc.pp, "CWD %s", ftpc->dirs[ftpc->count1 -1]); in ftp_state_cwd()
971 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_use_port() local
1278 result = Curl_pp_sendf(&ftpc->pp, "%s |%d|%s|%hu|", mode[fcmd], in ftp_state_use_port()
1286 ftpc->count1 = PORT; in ftp_state_use_port()
1309 result = Curl_pp_sendf(&ftpc->pp, "%s %s", mode[fcmd], tmp); in ftp_state_use_port()
1323 ftpc->count1 = fcmd; in ftp_state_use_port()
1347 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_use_pasv() local
1375 PPSENDF(&ftpc->pp, "%s", mode[modeoff]); in ftp_state_use_pasv()
1377 ftpc->count1 = modeoff; in ftp_state_use_pasv()
1413 if(!conn->proto.ftpc.file) { in ftp_state_prepare_transfer()
1414 PPSENDF(&conn->proto.ftpc.pp, "PRET %s", in ftp_state_prepare_transfer()
1420 PPSENDF(&conn->proto.ftpc.pp, "PRET STOR %s", conn->proto.ftpc.file); in ftp_state_prepare_transfer()
1423 PPSENDF(&conn->proto.ftpc.pp, "PRET RETR %s", conn->proto.ftpc.file); in ftp_state_prepare_transfer()
1438 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_rest() local
1440 if((ftp->transfer != FTPTRANSFER_BODY) && ftpc->file) { in ftp_state_rest()
1445 PPSENDF(&conn->proto.ftpc.pp, "REST %d", 0); in ftp_state_rest()
1459 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_size() local
1461 if((ftp->transfer == FTPTRANSFER_INFO) && ftpc->file) { in ftp_state_size()
1465 PPSENDF(&ftpc->pp, "SIZE %s", ftpc->file); in ftp_state_size()
1528 result = Curl_pp_sendf(&conn->proto.ftpc.pp, "%s", cmd); in ftp_state_list()
1568 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_type() local
1573 if(data->set.opt_no_body && ftpc->file && in ftp_state_type()
1600 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_mdtm() local
1603 if((data->set.get_filetime || data->set.timecondition) && ftpc->file) { in ftp_state_mdtm()
1607 PPSENDF(&ftpc->pp, "MDTM %s", ftpc->file); in ftp_state_mdtm()
1625 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_ul_setup() local
1645 PPSENDF(&ftpc->pp, "SIZE %s", ftpc->file); in ftp_state_ul_setup()
1707 PPSENDF(&ftpc->pp, data->set.ftp_append?"APPE %s":"STOR %s", in ftp_state_ul_setup()
1708 ftpc->file); in ftp_state_ul_setup()
1722 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_quote() local
1747 ftpc->count1 = 0; in ftp_state_quote()
1749 ftpc->count1++; in ftp_state_quote()
1755 while((i< ftpc->count1) && item) { in ftp_state_quote()
1763 ftpc->count2 = 1; /* the sent command is allowed to fail */ in ftp_state_quote()
1766 ftpc->count2 = 0; /* failure means cancel operation */ in ftp_state_quote()
1768 PPSENDF(&ftpc->pp, "%s", cmd); in ftp_state_quote()
1785 if(ftpc->known_filesize != -1) { in ftp_state_quote()
1786 Curl_pgrsSetDownloadSize(data, ftpc->known_filesize); in ftp_state_quote()
1787 result = ftp_state_retr(conn, ftpc->known_filesize); in ftp_state_quote()
1790 PPSENDF(&ftpc->pp, "SIZE %s", ftpc->file); in ftp_state_quote()
1823 PPSENDF(&conn->proto.ftpc.pp, "%s", "PASV"); in ftp_epsv_disable()
1824 conn->proto.ftpc.count1++; in ftp_epsv_disable()
1928 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_pasv_resp() local
1937 Curl_safefree(ftpc->newhost); in ftp_state_pasv_resp()
1939 if((ftpc->count1 == 0) && in ftp_state_pasv_resp()
1969 ftpc->newport = (unsigned short)(num & 0xffff); in ftp_state_pasv_resp()
1970 ftpc->newhost = strdup(control_address(conn)); in ftp_state_pasv_resp()
1971 if(!ftpc->newhost) in ftp_state_pasv_resp()
1983 else if((ftpc->count1 == 1) && in ftp_state_pasv_resp()
2018 ftpc->newhost = strdup(control_address(conn)); in ftp_state_pasv_resp()
2021 ftpc->newhost = aprintf("%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); in ftp_state_pasv_resp()
2023 if(!ftpc->newhost) in ftp_state_pasv_resp()
2026 ftpc->newport = (unsigned short)(((port[0]<<8) + port[1]) & 0xffff); in ftp_state_pasv_resp()
2028 else if(ftpc->count1 == 0) { in ftp_state_pasv_resp()
2060 rc = Curl_resolv(conn, ftpc->newhost, ftpc->newport, &addr); in ftp_state_pasv_resp()
2065 connectport = ftpc->newport; /* we connect to the remote port */ in ftp_state_pasv_resp()
2068 failf(data, "Can't resolve new host %s:%hu", ftpc->newhost, connectport); in ftp_state_pasv_resp()
2078 if(ftpc->count1 == 0 && ftpcode == 229) in ftp_state_pasv_resp()
2093 ftp_pasv_verbose(conn, addr->addr, ftpc->newhost, connectport); in ftp_state_pasv_resp()
2106 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_port_resp() local
2107 ftpport fcmd = (ftpport)ftpc->count1; in ftp_state_port_resp()
2144 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_mdtm_resp() local
2170 ftpc->file && in ftp_state_mdtm_resp()
2278 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_retr() local
2340 PPSENDF(&ftpc->pp, "REST %" CURL_FORMAT_CURL_OFF_T, in ftp_state_retr()
2347 PPSENDF(&ftpc->pp, "RETR %s", ftpc->file); in ftp_state_retr()
2396 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_rest_resp() local
2418 PPSENDF(&ftpc->pp, "RETR %s", ftpc->file); in ftp_state_rest_resp()
2440 conn->proto.ftpc.state_saved = instate; in ftp_state_stor_resp()
2453 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_stor_resp() local
2455 ftpc->wait_data_conn = TRUE; in ftp_state_stor_resp()
2555 conn->proto.ftpc.state_saved = instate; in ftp_state_get_resp()
2556 conn->proto.ftpc.retr_size_saved = size; in ftp_state_get_resp()
2566 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_get_resp() local
2569 ftpc->wait_data_conn = TRUE; in ftp_state_get_resp()
2612 PPSENDF(&conn->proto.ftpc.pp, "PBSZ %d", 0); in ftp_state_loggedin()
2629 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_user_resp() local
2633 if((ftpcode == 331) && (ftpc->state == FTP_USER)) { in ftp_state_user_resp()
2636 PPSENDF(&ftpc->pp, "PASS %s", ftp->passwd?ftp->passwd:""); in ftp_state_user_resp()
2646 PPSENDF(&ftpc->pp, "ACCT %s", data->set.str[STRING_FTP_ACCOUNT]); in ftp_state_user_resp()
2663 PPSENDF(&conn->proto.ftpc.pp, "%s", in ftp_state_user_resp()
2700 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_statemach_act() local
2701 struct pingpong *pp = &ftpc->pp; in ftp_statemach_act()
2714 switch(ftpc->state) { in ftp_statemach_act()
2718 return ftp_state_user_resp(conn, ftpcode, ftpc->state); in ftp_statemach_act()
2747 ftpc->count3=0; in ftp_statemach_act()
2751 ftpc->count2 = 1; /* add one to get next */ in ftp_statemach_act()
2752 ftpc->count1 = 0; in ftp_statemach_act()
2755 ftpc->count2 = -1; /* subtract one to get next */ in ftp_statemach_act()
2756 ftpc->count1 = 1; in ftp_statemach_act()
2763 PPSENDF(&ftpc->pp, "AUTH %s", ftpauth[ftpc->count1]); in ftp_statemach_act()
2792 else if(ftpc->count3 < 1) { in ftp_statemach_act()
2793 ftpc->count3++; in ftp_statemach_act()
2794 ftpc->count1 += ftpc->count2; /* get next attempt */ in ftp_statemach_act()
2795 result = Curl_pp_sendf(&ftpc->pp, "AUTH %s", ftpauth[ftpc->count1]); in ftp_statemach_act()
2813 result = ftp_state_user_resp(conn, ftpcode, ftpc->state); in ftp_statemach_act()
2821 PPSENDF(&ftpc->pp, "PROT %c", in ftp_statemach_act()
2841 PPSENDF(&ftpc->pp, "%s", "CCC"); in ftp_statemach_act()
2926 if(!ftpc->server_os && dir[0] != '/') { in ftp_statemach_act()
2928 result = Curl_pp_sendf(&ftpc->pp, "%s", "SYST"); in ftp_statemach_act()
2933 Curl_safefree(ftpc->entrypath); in ftp_statemach_act()
2934 ftpc->entrypath = dir; /* remember this */ in ftp_statemach_act()
2935 infof(data, "Entry path is '%s'\n", ftpc->entrypath); in ftp_statemach_act()
2937 data->state.most_recent_ftp_entrypath = ftpc->entrypath; in ftp_statemach_act()
2942 Curl_safefree(ftpc->entrypath); in ftp_statemach_act()
2943 ftpc->entrypath = dir; /* remember this */ in ftp_statemach_act()
2944 infof(data, "Entry path is '%s'\n", ftpc->entrypath); in ftp_statemach_act()
2946 data->state.most_recent_ftp_entrypath = ftpc->entrypath; in ftp_statemach_act()
2981 result = Curl_pp_sendf(&ftpc->pp, "%s", "SITE NAMEFMT 1"); in ftp_statemach_act()
2987 Curl_safefree(ftpc->server_os); in ftp_statemach_act()
2988 ftpc->server_os = os; in ftp_statemach_act()
2995 Curl_safefree(ftpc->server_os); in ftp_statemach_act()
2996 ftpc->server_os = os; in ftp_statemach_act()
3022 if((ftpcode >= 400) && !ftpc->count2) { in ftp_statemach_act()
3027 result = ftp_state_quote(conn, FALSE, ftpc->state); in ftp_statemach_act()
3037 ftpc->count1 && !ftpc->count2) { in ftp_statemach_act()
3039 ftpc->count2++; /* counter to prevent CWD-MKD loops */ in ftp_statemach_act()
3040 PPSENDF(&ftpc->pp, "MKD %s", ftpc->dirs[ftpc->count1 - 1]); in ftp_statemach_act()
3046 ftpc->cwdfail = TRUE; /* don't remember this path as we failed in ftp_statemach_act()
3053 ftpc->count2=0; in ftp_statemach_act()
3054 if(++ftpc->count1 <= ftpc->dirdepth) { in ftp_statemach_act()
3056 PPSENDF(&ftpc->pp, "CWD %s", ftpc->dirs[ftpc->count1 - 1]); in ftp_statemach_act()
3067 if((ftpcode/100 != 2) && !ftpc->count3--) { in ftp_statemach_act()
3074 PPSENDF(&ftpc->pp, "CWD %s", ftpc->dirs[ftpc->count1 - 1]); in ftp_statemach_act()
3085 result = ftp_state_type_resp(conn, ftpcode, ftpc->state); in ftp_statemach_act()
3091 result = ftp_state_size_resp(conn, ftpcode, ftpc->state); in ftp_statemach_act()
3096 result = ftp_state_rest_resp(conn, ftpcode, ftpc->state); in ftp_statemach_act()
3118 result = ftp_state_get_resp(conn, ftpcode, ftpc->state); in ftp_statemach_act()
3122 result = ftp_state_stor_resp(conn, ftpcode, ftpc->state); in ftp_statemach_act()
3142 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_multi_statemach() local
3143 CURLcode result = Curl_pp_statemach(&ftpc->pp, FALSE); in ftp_multi_statemach()
3148 *done = (ftpc->state == FTP_STOP) ? TRUE : FALSE; in ftp_multi_statemach()
3155 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_block_statemach() local
3156 struct pingpong *pp = &ftpc->pp; in ftp_block_statemach()
3159 while(ftpc->state != FTP_STOP) { in ftp_block_statemach()
3180 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_connect() local
3181 struct pingpong *pp = &ftpc->pp; in ftp_connect()
3225 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_done() local
3226 struct pingpong *pp = &ftpc->pp; in ftp_done()
3230 bool was_ctl_valid = ftpc->ctl_valid; in ftp_done()
3260 ftpc->ctl_valid = was_ctl_valid; in ftp_done()
3267 ftpc->ctl_valid = FALSE; in ftp_done()
3268 ftpc->cwdfail = TRUE; /* set this TRUE to prevent us to remember the in ftp_done()
3276 free(ftpc->prevpath); in ftp_done()
3279 if(data->set.chunk_end && ftpc->file) { in ftp_done()
3282 ftpc->known_filesize = -1; in ftp_done()
3292 ftpc->ctl_valid = FALSE; /* mark control connection as bad */ in ftp_done()
3294 ftpc->prevpath = NULL; /* no path remembering */ in ftp_done()
3297 size_t flen = ftpc->file?strlen(ftpc->file):0; /* file is "raw" already */ in ftp_done()
3299 if(!ftpc->cwdfail) { in ftp_done()
3301 ftpc->prevpath = path; in ftp_done()
3304 ftpc->prevpath[dlen]=0; /* terminate */ in ftp_done()
3308 ftpc->prevpath=strdup(""); in ftp_done()
3311 if(ftpc->prevpath) in ftp_done()
3312 infof(data, "Remembering we are in dir \"%s\"\n", ftpc->prevpath); in ftp_done()
3315 ftpc->prevpath = NULL; /* no path */ in ftp_done()
3320 freedirs(ftpc); in ftp_done()
3329 if(!result && ftpc->dont_check && data->req.maxdownload > 0) { in ftp_done()
3335 ftpc->ctl_valid = FALSE; /* mark control connection as bad */ in ftp_done()
3355 if(!result && (ftp->transfer == FTPTRANSFER_BODY) && ftpc->ctl_valid && in ftp_done()
3374 ftpc->ctl_valid = FALSE; /* mark control connection as bad */ in ftp_done()
3381 if(ftpc->dont_check && data->req.maxdownload > 0) { in ftp_done()
3389 if(!ftpc->dont_check) { in ftp_done()
3429 else if(!ftpc->dont_check && in ftp_done()
3439 ftpc->dont_check = FALSE; in ftp_done()
3465 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_sendquote() local
3466 struct pingpong *pp = &ftpc->pp; in ftp_sendquote()
3484 PPSENDF(&conn->proto.ftpc.pp, "%s", cmd); in ftp_sendquote()
3513 return conn->proto.ftpc.transfertype != (ascii_wanted?'A':'I'); in ftp_need_type()
3527 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_nb_type() local
3531 if(ftpc->transfertype == want) { in ftp_nb_type()
3536 PPSENDF(&ftpc->pp, "TYPE %c", want); in ftp_nb_type()
3540 ftpc->transfertype = want; in ftp_nb_type()
3577 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_range() local
3613 ftpc->dont_check = TRUE; /* dont check for successful transfer */ in ftp_range()
3635 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_do_more() local
3660 result = proxy_magic(conn, ftpc->newhost, ftpc->newport, &connected); in ftp_do_more()
3664 if(result && (ftpc->count1 == 0)) { in ftp_do_more()
3673 if(ftpc->state) { in ftp_do_more()
3682 if(result || (ftpc->wait_data_conn != TRUE)) in ftp_do_more()
3685 if(ftpc->wait_data_conn) in ftp_do_more()
3696 if(ftpc->wait_data_conn == TRUE) { in ftp_do_more()
3706 ftpc->wait_data_conn = FALSE; in ftp_do_more()
3732 else if(data->set.ftp_list_only || !ftpc->file) { in ftp_do_more()
3762 if(!ftpc->wait_data_conn) { in ftp_do_more()
3960 struct ftp_conn *ftpc = &conn->proto.ftpc; in wc_statemach() local
3994 ftpc->known_filesize = finfo->size; in wc_statemach()
4049 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_do() local
4052 ftpc->wait_data_conn = FALSE; /* default to no such wait */ in ftp_do()
4147 if(conn->proto.ftpc.ctl_valid) { in ftp_quit()
4148 result = Curl_pp_sendf(&conn->proto.ftpc.pp, "%s", "QUIT"); in ftp_quit()
4152 conn->proto.ftpc.ctl_valid = FALSE; /* mark control connection as bad */ in ftp_quit()
4175 struct ftp_conn *ftpc= &conn->proto.ftpc; in ftp_disconnect() local
4176 struct pingpong *pp = &ftpc->pp; in ftp_disconnect()
4186 ftpc->ctl_valid = FALSE; in ftp_disconnect()
4191 if(ftpc->entrypath) { in ftp_disconnect()
4193 if(data->state.most_recent_ftp_entrypath == ftpc->entrypath) { in ftp_disconnect()
4196 free(ftpc->entrypath); in ftp_disconnect()
4197 ftpc->entrypath = NULL; in ftp_disconnect()
4200 freedirs(ftpc); in ftp_disconnect()
4201 free(ftpc->prevpath); in ftp_disconnect()
4202 ftpc->prevpath = NULL; in ftp_disconnect()
4203 free(ftpc->server_os); in ftp_disconnect()
4204 ftpc->server_os = NULL; in ftp_disconnect()
4228 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_parse_url_path() local
4237 ftpc->ctl_valid = FALSE; in ftp_parse_url_path()
4238 ftpc->cwdfail = FALSE; in ftp_parse_url_path()
4267 ftpc->dirdepth = 0; in ftp_parse_url_path()
4274 ftpc->dirs = calloc(1, sizeof(ftpc->dirs[0])); in ftp_parse_url_path()
4275 if(!ftpc->dirs) in ftp_parse_url_path()
4281 ftpc->dirs[0] = curl_easy_unescape(conn->data, slash_pos ? cur_pos : "/", in ftp_parse_url_path()
4284 if(!ftpc->dirs[0]) { in ftp_parse_url_path()
4285 freedirs(ftpc); in ftp_parse_url_path()
4288 ftpc->dirdepth = 1; /* we consider it to be a single dir */ in ftp_parse_url_path()
4297 ftpc->dirdepth = 0; in ftp_parse_url_path()
4298 ftpc->diralloc = 5; /* default dir depth to allocate */ in ftp_parse_url_path()
4299 ftpc->dirs = calloc(ftpc->diralloc, sizeof(ftpc->dirs[0])); in ftp_parse_url_path()
4300 if(!ftpc->dirs) in ftp_parse_url_path()
4306 ftpc->dirs[0] = strdup("/"); in ftp_parse_url_path()
4307 ftpc->dirdepth++; in ftp_parse_url_path()
4314 (ftpc->dirdepth == 0))?1:0; in ftp_parse_url_path()
4322 ftpc->dirs[ftpc->dirdepth] = in ftp_parse_url_path()
4324 if(!ftpc->dirs[ftpc->dirdepth]) { /* run out of memory ... */ in ftp_parse_url_path()
4326 freedirs(ftpc); in ftp_parse_url_path()
4329 if(isBadFtpString(ftpc->dirs[ftpc->dirdepth])) { in ftp_parse_url_path()
4330 free(ftpc->dirs[ftpc->dirdepth]); in ftp_parse_url_path()
4331 freedirs(ftpc); in ftp_parse_url_path()
4337 if(!ftpc->dirdepth) { in ftp_parse_url_path()
4339 ftpc->dirs[ftpc->dirdepth] = strdup("/"); in ftp_parse_url_path()
4340 if(!ftpc->dirs[ftpc->dirdepth++]) { /* run out of memory ... */ in ftp_parse_url_path()
4342 freedirs(ftpc); in ftp_parse_url_path()
4350 if(++ftpc->dirdepth >= ftpc->diralloc) { in ftp_parse_url_path()
4353 ftpc->diralloc *= 2; /* double the size each time */ in ftp_parse_url_path()
4354 bigger = realloc(ftpc->dirs, ftpc->diralloc * sizeof(ftpc->dirs[0])); in ftp_parse_url_path()
4356 freedirs(ftpc); in ftp_parse_url_path()
4359 ftpc->dirs = bigger; in ftp_parse_url_path()
4368 ftpc->file = curl_easy_unescape(conn->data, filename, 0, NULL); in ftp_parse_url_path()
4369 if(NULL == ftpc->file) { in ftp_parse_url_path()
4370 freedirs(ftpc); in ftp_parse_url_path()
4374 if(isBadFtpString(ftpc->file)) { in ftp_parse_url_path()
4375 freedirs(ftpc); in ftp_parse_url_path()
4380 ftpc->file=NULL; /* instead of point to a zero byte, we make it a NULL in ftp_parse_url_path()
4383 if(data->set.upload && !ftpc->file && (ftp->transfer == FTPTRANSFER_BODY)) { in ftp_parse_url_path()
4389 ftpc->cwddone = FALSE; /* default to not done */ in ftp_parse_url_path()
4391 if(ftpc->prevpath) { in ftp_parse_url_path()
4397 freedirs(ftpc); in ftp_parse_url_path()
4401 dlen -= ftpc->file?curlx_uztosi(strlen(ftpc->file)):0; in ftp_parse_url_path()
4402 if((dlen == curlx_uztosi(strlen(ftpc->prevpath))) && in ftp_parse_url_path()
4403 strnequal(path, ftpc->prevpath, dlen)) { in ftp_parse_url_path()
4405 ftpc->cwddone = TRUE; in ftp_parse_url_path()
4418 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_dophase_done() local
4441 ftpc->ctl_valid = TRUE; /* seems good */ in ftp_dophase_done()
4481 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_regular_transfer() local
4489 ftpc->ctl_valid = TRUE; /* starts good */ in ftp_regular_transfer()
4507 freedirs(ftpc); in ftp_regular_transfer()
4593 conn->proto.ftpc.known_filesize = -1; /* unknown size for now */ in ftp_setup_connection()