mirror of
https://github.com/curl/curl.git
synced 2026-08-25 12:53:33 +03:00
ftp: store dir components as start+len instead of memdup'ing
- Avoids allocating every path segment separately - Improved directory handling in connection reuse Closes #18312
This commit is contained in:
parent
79eb66f2a6
commit
b9e3ea4edb
6 changed files with 99 additions and 80 deletions
|
|
@ -120,6 +120,11 @@ struct FTP {
|
|||
curl_off_t downloadsize;
|
||||
};
|
||||
|
||||
/* one struct entry for each path component (of 'rawpath') */
|
||||
struct pathcomp {
|
||||
int start; /* start column */
|
||||
int len; /* length in bytes */
|
||||
};
|
||||
|
||||
/* ftp_conn is used for struct connection-oriented data in the connectdata
|
||||
struct */
|
||||
|
|
@ -128,9 +133,9 @@ struct ftp_conn {
|
|||
char *account;
|
||||
char *alternative_to_user;
|
||||
char *entrypath; /* the PWD reply when we logged on */
|
||||
char *file; /* url-decoded filename (or path) */
|
||||
const char *file; /* url-decoded filename (or path), points into rawpath */
|
||||
char *rawpath; /* URL decoded, allocated, version of the path */
|
||||
char **dirs; /* realloc()ed array for path components */
|
||||
struct pathcomp *dirs; /* allocated array for path components */
|
||||
char *newhost; /* the (allocated) IP addr or hostname to connect the data
|
||||
connection to */
|
||||
char *prevpath; /* url-decoded conn->path from the previous transfer */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue