diff options
-rw-r--r-- | lib/security.c | 14 | ||||
-rw-r--r-- | lib/security.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/lib/security.c b/lib/security.c index 81ce35ed8..793169f00 100644 --- a/lib/security.c +++ b/lib/security.c @@ -273,6 +273,20 @@ sec_fflush(struct connectdata *conn, FILE *F) } int +sec_fflush_fd(struct connectdata *conn, int fd) +{ + if(conn->data_prot != prot_clear) { + if(conn->out_buffer.index > 0){ + sec_write(conn, fd, + conn->out_buffer.data, conn->out_buffer.index); + conn->out_buffer.index = 0; + } + sec_send(conn, fd, NULL, 0); + } + return 0; +} + +int sec_write(struct connectdata *conn, int fd, char *buffer, int length) { int len = conn->buffer_size; diff --git a/lib/security.h b/lib/security.h index b496fad71..4a30560cb 100644 --- a/lib/security.h +++ b/lib/security.h @@ -94,6 +94,7 @@ void delete_ftp_command(void); int sec_fflush (struct connectdata *conn, FILE *); +int sec_fflush_fd(struct connectdata *conn, int fd); int sec_fprintf (struct connectdata *, FILE *, const char *, ...); int sec_getc (struct connectdata *conn, FILE *); int sec_putc (struct connectdata *conn, int, FILE *); |