Lines Matching refs:ftpc

139 #define FTP_CSTATE(c)   ((c)? ftp_state_names[(c)->proto.ftpc.state] : "???")
141 ftp_state_names[(d)->conn->proto.ftpc.state] : "???")
154 struct ftp_conn *ftpc = &conn->proto.ftpc; in _ftp_state() local
161 if(ftpc->state != newstate) in _ftp_state()
171 ftpc->state = newstate; in _ftp_state()
312 static void freedirs(struct ftp_conn *ftpc) in freedirs() argument
314 if(ftpc->dirs) { in freedirs()
316 for(i = 0; i < ftpc->dirdepth; i++) { in freedirs()
317 free(ftpc->dirs[i]); in freedirs()
318 ftpc->dirs[i] = NULL; in freedirs()
320 free(ftpc->dirs); in freedirs()
321 ftpc->dirs = NULL; in freedirs()
322 ftpc->dirdepth = 0; in freedirs()
324 Curl_safefree(ftpc->file); in freedirs()
327 Curl_safefree(ftpc->newhost); in freedirs()
351 data->conn->proto.ftpc.transfertype != 'A') in ftp_cw_lc_write()
429 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_check_ctrl_on_data_wait() local
430 struct pingpong *pp = &ftpc->pp; in ftp_check_ctrl_on_data_wait()
517 if(conn->proto.ftpc.state_saved == FTP_STOR) { in InitiateTransfer()
532 conn->proto.ftpc.retr_size_saved, TRUE, FALSE); in InitiateTransfer()
535 conn->proto.ftpc.pp.pending_resp = TRUE; /* expect server response */ in InitiateTransfer()
567 char * const buf = Curl_dyn_ptr(&data->conn->proto.ftpc.pp.recvbuf); in ftp_readresp()
631 struct ftp_conn *ftpc = &conn->proto.ftpc; in Curl_GetFTPResponse() local
632 struct pingpong *pp = &ftpc->pp; in Curl_GetFTPResponse()
733 &conn->proto.ftpc.pp, "USER %s", in ftp_state_user()
736 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_user() local
737 ftpc->ftp_trying_alternative = FALSE; in ftp_state_user()
746 CURLcode result = Curl_pp_sendf(data, &conn->proto.ftpc.pp, "%s", "PWD"); in ftp_state_pwd()
758 return Curl_pp_getsock(data, &conn->proto.ftpc.pp, socks); in ftp_getsock()
765 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_domore_getsock() local
774 if(FTP_STOP == ftpc->state) { in ftp_domore_getsock()
785 return Curl_pp_getsock(data, &conn->proto.ftpc.pp, socks); in ftp_domore_getsock()
798 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_cwd() local
800 if(ftpc->cwddone) in ftp_state_cwd()
806 !(ftpc->dirdepth && ftpc->dirs[0][0] == '/')); in ftp_state_cwd()
808 ftpc->count2 = 0; /* count2 counts failed CWDs */ in ftp_state_cwd()
810 if(conn->bits.reuse && ftpc->entrypath && in ftp_state_cwd()
812 !(ftpc->dirdepth && ftpc->dirs[0][0] == '/')) { in ftp_state_cwd()
816 ftpc->cwdcount = 0; /* we count this as the first path, then we add one in ftp_state_cwd()
818 result = Curl_pp_sendf(data, &ftpc->pp, "CWD %s", ftpc->entrypath); in ftp_state_cwd()
823 if(ftpc->dirdepth) { in ftp_state_cwd()
824 ftpc->cwdcount = 1; in ftp_state_cwd()
827 result = Curl_pp_sendf(data, &ftpc->pp, "CWD %s", in ftp_state_cwd()
828 ftpc->dirs[ftpc->cwdcount -1]); in ftp_state_cwd()
852 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_use_port() local
1156 result = Curl_pp_sendf(data, &ftpc->pp, "%s |%d|%s|%hu|", mode[fcmd], in ftp_state_use_port()
1184 result = Curl_pp_sendf(data, &ftpc->pp, "%s %s", mode[fcmd], target); in ftp_state_use_port()
1195 ftpc->count1 = fcmd; in ftp_state_use_port()
1230 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_use_pasv() local
1258 result = Curl_pp_sendf(data, &ftpc->pp, "%s", mode[modeoff]); in ftp_state_use_pasv()
1260 ftpc->count1 = modeoff; in ftp_state_use_pasv()
1296 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_prepare_transfer() local
1297 if(!conn->proto.ftpc.file) in ftp_state_prepare_transfer()
1298 result = Curl_pp_sendf(data, &ftpc->pp, "PRET %s", in ftp_state_prepare_transfer()
1303 result = Curl_pp_sendf(data, &ftpc->pp, "PRET STOR %s", in ftp_state_prepare_transfer()
1304 conn->proto.ftpc.file); in ftp_state_prepare_transfer()
1306 result = Curl_pp_sendf(data, &ftpc->pp, "PRET RETR %s", in ftp_state_prepare_transfer()
1307 conn->proto.ftpc.file); in ftp_state_prepare_transfer()
1322 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_rest() local
1324 if((ftp->transfer != PPTRANSFER_BODY) && ftpc->file) { in ftp_state_rest()
1329 result = Curl_pp_sendf(data, &ftpc->pp, "REST %d", 0); in ftp_state_rest()
1344 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_size() local
1346 if((ftp->transfer == PPTRANSFER_INFO) && ftpc->file) { in ftp_state_size()
1350 result = Curl_pp_sendf(data, &ftpc->pp, "SIZE %s", ftpc->file); in ftp_state_size()
1416 result = Curl_pp_sendf(data, &conn->proto.ftpc.pp, "%s", cmd); in ftp_state_list()
1442 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_type() local
1447 if(data->req.no_body && ftpc->file && in ftp_state_type()
1474 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_mdtm() local
1477 if((data->set.get_filetime || data->set.timecondition) && ftpc->file) { in ftp_state_mdtm()
1481 result = Curl_pp_sendf(data, &ftpc->pp, "MDTM %s", ftpc->file); in ftp_state_mdtm()
1500 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_ul_setup() local
1521 result = Curl_pp_sendf(data, &ftpc->pp, "SIZE %s", ftpc->file); in ftp_state_ul_setup()
1586 result = Curl_pp_sendf(data, &ftpc->pp, append ? "APPE %s" : "STOR %s", in ftp_state_ul_setup()
1587 ftpc->file); in ftp_state_ul_setup()
1601 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_quote() local
1626 ftpc->count1 = 0; in ftp_state_quote()
1628 ftpc->count1++; in ftp_state_quote()
1634 while((i < ftpc->count1) && item) { in ftp_state_quote()
1642 ftpc->count2 = 1; /* the sent command is allowed to fail */ in ftp_state_quote()
1645 ftpc->count2 = 0; /* failure means cancel operation */ in ftp_state_quote()
1647 result = Curl_pp_sendf(data, &ftpc->pp, "%s", cmd); in ftp_state_quote()
1666 if(ftpc->known_filesize != -1) { in ftp_state_quote()
1667 Curl_pgrsSetDownloadSize(data, ftpc->known_filesize); in ftp_state_quote()
1668 result = ftp_state_retr(data, ftpc->known_filesize); in ftp_state_quote()
1684 result = Curl_pp_sendf(data, &ftpc->pp, "RETR %s", ftpc->file); in ftp_state_quote()
1689 result = Curl_pp_sendf(data, &ftpc->pp, "SIZE %s", ftpc->file); in ftp_state_quote()
1731 result = Curl_pp_sendf(data, &conn->proto.ftpc.pp, "%s", "PASV"); in ftp_epsv_disable()
1733 conn->proto.ftpc.count1++; in ftp_epsv_disable()
1781 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_pasv_resp() local
1786 struct pingpong *pp = &ftpc->pp; in ftp_state_pasv_resp()
1791 Curl_safefree(ftpc->newhost); in ftp_state_pasv_resp()
1793 if((ftpc->count1 == 0) && in ftp_state_pasv_resp()
1814 ftpc->newport = (unsigned short)(num & 0xffff); in ftp_state_pasv_resp()
1815 ftpc->newhost = strdup(control_address(conn)); in ftp_state_pasv_resp()
1816 if(!ftpc->newhost) in ftp_state_pasv_resp()
1828 else if((ftpc->count1 == 1) && in ftp_state_pasv_resp()
1860 ftpc->newhost = strdup(control_address(conn)); in ftp_state_pasv_resp()
1863 ftpc->newhost = aprintf("%u.%u.%u.%u", ip[0], ip[1], ip[2], ip[3]); in ftp_state_pasv_resp()
1865 if(!ftpc->newhost) in ftp_state_pasv_resp()
1868 ftpc->newport = (unsigned short)(((ip[4] << 8) + ip[5]) & 0xffff); in ftp_state_pasv_resp()
1870 else if(ftpc->count1 == 0) { in ftp_state_pasv_resp()
1906 DEBUGASSERT(ftpc->newhost); in ftp_state_pasv_resp()
1909 if(conn->bits.tcp_fastopen && !conn->bits.reuse && !ftpc->newhost[0]) { in ftp_state_pasv_resp()
1910 Curl_safefree(ftpc->newhost); in ftp_state_pasv_resp()
1911 ftpc->newhost = strdup(control_address(conn)); in ftp_state_pasv_resp()
1912 if(!ftpc->newhost) in ftp_state_pasv_resp()
1916 rc = Curl_resolv(data, ftpc->newhost, ftpc->newport, FALSE, &addr); in ftp_state_pasv_resp()
1921 connectport = ftpc->newport; /* we connect to the remote port */ in ftp_state_pasv_resp()
1925 ftpc->newhost, connectport); in ftp_state_pasv_resp()
1936 if(ftpc->count1 == 0 && ftpcode == 229) in ftp_state_pasv_resp()
1951 ftp_pasv_verbose(data, addr->addr, ftpc->newhost, connectport); in ftp_state_pasv_resp()
1956 conn->secondary_port = ftpc->newport; in ftp_state_pasv_resp()
1957 conn->secondaryhostname = strdup(ftpc->newhost); in ftp_state_pasv_resp()
1971 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_port_resp() local
1972 ftpport fcmd = (ftpport)ftpc->count1; in ftp_state_port_resp()
2058 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_mdtm_resp() local
2066 struct pingpong *pp = &ftpc->pp; in ftp_state_mdtm_resp()
2083 ftpc->file && in ftp_state_mdtm_resp()
2196 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_retr() local
2259 result = Curl_pp_sendf(data, &ftpc->pp, "REST %" FMT_OFF_T, in ftp_state_retr()
2266 result = Curl_pp_sendf(data, &ftpc->pp, "RETR %s", ftpc->file); in ftp_state_retr()
2280 char *buf = Curl_dyn_ptr(&data->conn->proto.ftpc.pp.recvbuf); in ftp_state_size_resp()
2281 size_t len = data->conn->proto.ftpc.pp.nfinal; in ftp_state_size_resp()
2344 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_rest_resp() local
2366 result = Curl_pp_sendf(data, &ftpc->pp, "RETR %s", ftpc->file); in ftp_state_rest_resp()
2389 conn->proto.ftpc.state_saved = instate; in ftp_state_stor_resp()
2393 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_stor_resp() local
2404 ftpc->wait_data_conn = TRUE; in ftp_state_stor_resp()
2407 ftpc->wait_data_conn = FALSE; in ftp_state_stor_resp()
2464 char *buf = Curl_dyn_ptr(&conn->proto.ftpc.pp.recvbuf); in ftp_state_get_resp()
2503 conn->proto.ftpc.state_saved = instate; in ftp_state_get_resp()
2504 conn->proto.ftpc.retr_size_saved = size; in ftp_state_get_resp()
2507 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_get_resp() local
2517 ftpc->wait_data_conn = TRUE; in ftp_state_get_resp()
2520 ftpc->wait_data_conn = FALSE; in ftp_state_get_resp()
2562 result = Curl_pp_sendf(data, &conn->proto.ftpc.pp, "PBSZ %d", 0); in ftp_state_loggedin()
2578 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_state_user_resp() local
2581 if((ftpcode == 331) && (ftpc->state == FTP_USER)) { in ftp_state_user_resp()
2584 result = Curl_pp_sendf(data, &ftpc->pp, "PASS %s", in ftp_state_user_resp()
2596 result = Curl_pp_sendf(data, &ftpc->pp, "ACCT %s", in ftp_state_user_resp()
2613 !ftpc->ftp_trying_alternative) { in ftp_state_user_resp()
2616 Curl_pp_sendf(data, &ftpc->pp, "%s", in ftp_state_user_resp()
2619 ftpc->ftp_trying_alternative = TRUE; in ftp_state_user_resp()
2652 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_statemachine() local
2653 struct pingpong *pp = &ftpc->pp; in ftp_statemachine()
2666 switch(ftpc->state) { in ftp_statemachine()
2703 ftpc->count3 = 0; in ftp_statemachine()
2707 ftpc->count2 = 1; /* add one to get next */ in ftp_statemachine()
2708 ftpc->count1 = 0; in ftp_statemachine()
2711 ftpc->count2 = -1; /* subtract one to get next */ in ftp_statemachine()
2712 ftpc->count1 = 1; in ftp_statemachine()
2719 result = Curl_pp_sendf(data, &ftpc->pp, "AUTH %s", in ftp_statemachine()
2720 ftpauth[ftpc->count1]); in ftp_statemachine()
2758 else if(ftpc->count3 < 1) { in ftp_statemachine()
2759 ftpc->count3++; in ftp_statemachine()
2760 ftpc->count1 += ftpc->count2; /* get next attempt */ in ftp_statemachine()
2761 result = Curl_pp_sendf(data, &ftpc->pp, "AUTH %s", in ftp_statemachine()
2762 ftpauth[ftpc->count1]); in ftp_statemachine()
2786 Curl_pp_sendf(data, &ftpc->pp, "PROT %c", in ftp_statemachine()
2806 result = Curl_pp_sendf(data, &ftpc->pp, "%s", "CCC"); in ftp_statemachine()
2890 if(!ftpc->server_os && dir[0] != '/') { in ftp_statemachine()
2891 result = Curl_pp_sendf(data, &ftpc->pp, "%s", "SYST"); in ftp_statemachine()
2896 Curl_safefree(ftpc->entrypath); in ftp_statemachine()
2897 ftpc->entrypath = dir; /* remember this */ in ftp_statemachine()
2898 infof(data, "Entry path is '%s'", ftpc->entrypath); in ftp_statemachine()
2900 data->state.most_recent_ftp_entrypath = ftpc->entrypath; in ftp_statemachine()
2905 Curl_safefree(ftpc->entrypath); in ftp_statemachine()
2906 ftpc->entrypath = dir; /* remember this */ in ftp_statemachine()
2907 infof(data, "Entry path is '%s'", ftpc->entrypath); in ftp_statemachine()
2909 data->state.most_recent_ftp_entrypath = ftpc->entrypath; in ftp_statemachine()
2942 result = Curl_pp_sendf(data, &ftpc->pp, "%s", "SITE NAMEFMT 1"); in ftp_statemachine()
2948 Curl_safefree(ftpc->server_os); in ftp_statemachine()
2949 ftpc->server_os = os; in ftp_statemachine()
2955 Curl_safefree(ftpc->server_os); in ftp_statemachine()
2956 ftpc->server_os = os; in ftp_statemachine()
2981 if((ftpcode >= 400) && !ftpc->count2) { in ftp_statemachine()
2987 result = ftp_state_quote(data, FALSE, ftpc->state); in ftp_statemachine()
2994 ftpc->cwdcount && !ftpc->count2) { in ftp_statemachine()
2996 ftpc->count2++; /* counter to prevent CWD-MKD loops */ in ftp_statemachine()
3001 ftpc->count3 = (data->set.ftp_create_missing_dirs == 2) ? 1 : 0; in ftp_statemachine()
3003 result = Curl_pp_sendf(data, &ftpc->pp, "MKD %s", in ftp_statemachine()
3004 ftpc->dirs[ftpc->cwdcount - 1]); in ftp_statemachine()
3011 ftpc->cwdfail = TRUE; /* do not remember this path as we failed in ftp_statemachine()
3018 ftpc->count2 = 0; in ftp_statemachine()
3019 if(++ftpc->cwdcount <= ftpc->dirdepth) in ftp_statemachine()
3021 result = Curl_pp_sendf(data, &ftpc->pp, "CWD %s", in ftp_statemachine()
3022 ftpc->dirs[ftpc->cwdcount - 1]); in ftp_statemachine()
3029 if((ftpcode/100 != 2) && !ftpc->count3--) { in ftp_statemachine()
3037 result = Curl_pp_sendf(data, &ftpc->pp, "CWD %s", in ftp_statemachine()
3038 ftpc->dirs[ftpc->cwdcount - 1]); in ftp_statemachine()
3050 result = ftp_state_type_resp(data, ftpcode, ftpc->state); in ftp_statemachine()
3056 result = ftp_state_size_resp(data, ftpcode, ftpc->state); in ftp_statemachine()
3061 result = ftp_state_rest_resp(data, conn, ftpcode, ftpc->state); in ftp_statemachine()
3083 result = ftp_state_get_resp(data, ftpcode, ftpc->state); in ftp_statemachine()
3087 result = ftp_state_stor_resp(data, ftpcode, ftpc->state); in ftp_statemachine()
3107 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_multi_statemach() local
3108 CURLcode result = Curl_pp_statemach(data, &ftpc->pp, FALSE, FALSE); in ftp_multi_statemach()
3113 *done = (ftpc->state == FTP_STOP); in ftp_multi_statemach()
3121 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_block_statemach() local
3122 struct pingpong *pp = &ftpc->pp; in ftp_block_statemach()
3125 while(ftpc->state != FTP_STOP) { in ftp_block_statemach()
3147 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_connect() local
3148 struct pingpong *pp = &ftpc->pp; in ftp_connect()
3190 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_done() local
3191 struct pingpong *pp = &ftpc->pp; in ftp_done()
3225 ftpc->ctl_valid = FALSE; in ftp_done()
3226 ftpc->cwdfail = TRUE; /* set this TRUE to prevent us to remember the in ftp_done()
3234 if(data->set.chunk_end && ftpc->file) { in ftp_done()
3239 ftpc->known_filesize = -1; in ftp_done()
3249 ftpc->ctl_valid = FALSE; /* mark control connection as bad */ in ftp_done()
3251 free(ftpc->prevpath); in ftp_done()
3252 ftpc->prevpath = NULL; /* no path remembering */ in ftp_done()
3258 free(ftpc->prevpath); in ftp_done()
3260 if(!ftpc->cwdfail) { in ftp_done()
3265 pathLen -= ftpc->file ? strlen(ftpc->file) : 0; in ftp_done()
3268 ftpc->prevpath = rawPath; in ftp_done()
3272 ftpc->prevpath = NULL; /* no path */ in ftp_done()
3276 if(ftpc->prevpath) in ftp_done()
3277 infof(data, "Remembering we are in dir \"%s\"", ftpc->prevpath); in ftp_done()
3281 freedirs(ftpc); in ftp_done()
3290 if(!result && ftpc->dont_check && data->req.maxdownload > 0) { in ftp_done()
3296 ftpc->ctl_valid = FALSE; /* mark control connection as bad */ in ftp_done()
3304 if(!result && (ftp->transfer == PPTRANSFER_BODY) && ftpc->ctl_valid && in ftp_done()
3323 ftpc->ctl_valid = FALSE; /* mark control connection as bad */ in ftp_done()
3332 if(ftpc->dont_check && data->req.maxdownload > 0) { in ftp_done()
3340 if(!ftpc->dont_check) { in ftp_done()
3381 else if(!ftpc->dont_check && in ftp_done()
3391 ftpc->dont_check = FALSE; in ftp_done()
3416 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_sendquote() local
3417 struct pingpong *pp = &ftpc->pp; in ftp_sendquote()
3438 result = Curl_pp_sendf(data, &ftpc->pp, "%s", cmd); in ftp_sendquote()
3467 return conn->proto.ftpc.transfertype != (ascii_wanted ? 'A' : 'I'); in ftp_need_type()
3482 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_nb_type() local
3486 if(ftpc->transfertype == want) { in ftp_nb_type()
3491 result = Curl_pp_sendf(data, &ftpc->pp, "TYPE %c", want); in ftp_nb_type()
3496 ftpc->transfertype = want; in ftp_nb_type()
3537 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_do_more() local
3560 if(result && !is_eptr && (ftpc->count1 == 0)) { in ftp_do_more()
3573 if(ftpc->state) { in ftp_do_more()
3582 if(result || !ftpc->wait_data_conn) in ftp_do_more()
3595 if(ftpc->wait_data_conn) { in ftp_do_more()
3604 ftpc->wait_data_conn = FALSE; in ftp_do_more()
3636 ftpc->dont_check = TRUE; in ftp_do_more()
3641 else if(data->state.list_only || !ftpc->file) { in ftp_do_more()
3670 if(!ftpc->wait_data_conn) { in ftp_do_more()
3873 struct ftp_conn *ftpc = &conn->proto.ftpc; in wc_statemach() local
3911 ftpc->known_filesize = finfo->size; in wc_statemach()
3978 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_do() local
3981 ftpc->wait_data_conn = FALSE; /* default to no such wait */ in ftp_do()
4036 if(conn->proto.ftpc.ctl_valid) { in ftp_quit()
4037 result = Curl_pp_sendf(data, &conn->proto.ftpc.pp, "%s", "QUIT"); in ftp_quit()
4041 conn->proto.ftpc.ctl_valid = FALSE; /* mark control connection as bad */ in ftp_quit()
4066 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_disconnect() local
4067 struct pingpong *pp = &ftpc->pp; in ftp_disconnect()
4077 ftpc->ctl_valid = FALSE; in ftp_disconnect()
4082 if(ftpc->entrypath) { in ftp_disconnect()
4083 if(data->state.most_recent_ftp_entrypath == ftpc->entrypath) { in ftp_disconnect()
4086 Curl_safefree(ftpc->entrypath); in ftp_disconnect()
4089 freedirs(ftpc); in ftp_disconnect()
4090 Curl_safefree(ftpc->account); in ftp_disconnect()
4091 Curl_safefree(ftpc->alternative_to_user); in ftp_disconnect()
4092 Curl_safefree(ftpc->prevpath); in ftp_disconnect()
4093 Curl_safefree(ftpc->server_os); in ftp_disconnect()
4117 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_parse_url_path() local
4124 ftpc->ctl_valid = FALSE; in ftp_parse_url_path()
4125 ftpc->cwdfail = FALSE; in ftp_parse_url_path()
4155 ftpc->dirs = calloc(1, sizeof(ftpc->dirs[0])); in ftp_parse_url_path()
4156 if(!ftpc->dirs) { in ftp_parse_url_path()
4161 ftpc->dirs[0] = Curl_memdup0(rawPath, dirlen); in ftp_parse_url_path()
4162 if(!ftpc->dirs[0]) { in ftp_parse_url_path()
4167 ftpc->dirdepth = 1; /* we consider it to be a single dir */ in ftp_parse_url_path()
4187 ftpc->dirs = calloc(dirAlloc, sizeof(ftpc->dirs[0])); in ftp_parse_url_path()
4188 if(!ftpc->dirs) { in ftp_parse_url_path()
4198 if((compLen == 0) && (ftpc->dirdepth == 0)) in ftp_parse_url_path()
4210 ftpc->dirs[ftpc->dirdepth++] = comp; in ftp_parse_url_path()
4215 DEBUGASSERT((size_t)ftpc->dirdepth <= dirAlloc); in ftp_parse_url_path()
4222 ftpc->file = strdup(fileName); in ftp_parse_url_path()
4224 ftpc->file = NULL; /* instead of point to a zero byte, in ftp_parse_url_path()
4227 if(data->state.upload && !ftpc->file && (ftp->transfer == PPTRANSFER_BODY)) { in ftp_parse_url_path()
4234 ftpc->cwddone = FALSE; /* default to not done */ in ftp_parse_url_path()
4237 ftpc->cwddone = TRUE; /* skip CWD for absolute paths */ in ftp_parse_url_path()
4239 const char *oldPath = conn->bits.reuse ? ftpc->prevpath : ""; in ftp_parse_url_path()
4245 n -= ftpc->file ? strlen(ftpc->file) : 0; in ftp_parse_url_path()
4249 ftpc->cwddone = TRUE; in ftp_parse_url_path()
4263 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_dophase_done() local
4282 ftpc->ctl_valid = TRUE; /* seems good */ in ftp_dophase_done()
4322 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_regular_transfer() local
4330 ftpc->ctl_valid = TRUE; /* starts good */ in ftp_regular_transfer()
4348 freedirs(ftpc); in ftp_regular_transfer()
4359 struct ftp_conn *ftpc = &conn->proto.ftpc; in ftp_setup_connection() local
4367 ftpc->account = strdup(data->set.str[STRING_FTP_ACCOUNT]); in ftp_setup_connection()
4368 if(!ftpc->account) { in ftp_setup_connection()
4374 ftpc->alternative_to_user = in ftp_setup_connection()
4376 if(!ftpc->alternative_to_user) { in ftp_setup_connection()
4377 Curl_safefree(ftpc->account); in ftp_setup_connection()
4418 ftpc->known_filesize = -1; /* unknown size for now */ in ftp_setup_connection()
4419 ftpc->use_ssl = data->set.use_ssl; in ftp_setup_connection()
4420 ftpc->ccc = data->set.ftp_ccc; in ftp_setup_connection()