mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
ext/ftp: Remove output field of ftpbuf_t struct
It was only used once, and removing it reduces the size of a userland FTP object by 4096 bytes
This commit is contained in:
@@ -1181,7 +1181,7 @@ bool ftp_site(ftpbuf_t *ftp, const char *cmd, const size_t cmd_len)
|
||||
static bool ftp_putcmd(ftpbuf_t *ftp, const char *cmd, const size_t cmd_len, const char *args, const size_t args_len)
|
||||
{
|
||||
int size;
|
||||
char *data;
|
||||
char data[FTP_BUFSIZE];
|
||||
|
||||
if (strpbrk(cmd, "\r\n")) {
|
||||
return false;
|
||||
@@ -1195,17 +1195,15 @@ static bool ftp_putcmd(ftpbuf_t *ftp, const char *cmd, const size_t cmd_len, con
|
||||
if (strpbrk(args, "\r\n")) {
|
||||
return 0;
|
||||
}
|
||||
size = slprintf(ftp->outbuf, sizeof(ftp->outbuf), "%s %s\r\n", cmd, args);
|
||||
size = slprintf(data, sizeof(data), "%s %s\r\n", cmd, args);
|
||||
} else {
|
||||
/* "cmd\r\n\0" */
|
||||
if (cmd_len + 3 > FTP_BUFSIZE) {
|
||||
return false;
|
||||
}
|
||||
size = slprintf(ftp->outbuf, sizeof(ftp->outbuf), "%s\r\n", cmd);
|
||||
size = slprintf(data, sizeof(data), "%s\r\n", cmd);
|
||||
}
|
||||
|
||||
data = ftp->outbuf;
|
||||
|
||||
/* Clear the inbuf and extra-lines buffer */
|
||||
ftp->inbuf[0] = '\0';
|
||||
ftp->extra = NULL;
|
||||
|
||||
@@ -60,7 +60,6 @@ typedef struct ftpbuf
|
||||
char inbuf[FTP_BUFSIZE]; /* last response text */
|
||||
char *extra; /* extra characters */
|
||||
int extralen; /* number of extra chars */
|
||||
char outbuf[FTP_BUFSIZE]; /* command output buffer */
|
||||
char *pwd; /* cached pwd */
|
||||
char *syst; /* cached system type */
|
||||
ftptype_t type; /* current transfer type */
|
||||
|
||||
Reference in New Issue
Block a user