From ad22cccc0931a7275e497e1c625fe83e79d61d4e Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 12 Jan 2007 17:16:46 +0000 Subject: [PATCH] No need to maintain a received byte count; we always fill in sequential order so we can just use buffer->fill. --- src/include/gpxe/ftp.h | 2 -- src/net/tcp/ftp.c | 6 +----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/include/gpxe/ftp.h b/src/include/gpxe/ftp.h index e296021d..2c51036a 100644 --- a/src/include/gpxe/ftp.h +++ b/src/include/gpxe/ftp.h @@ -57,8 +57,6 @@ struct ftp_request { char status_text[4]; /** Passive-mode parameters, as text */ char passive_text[24]; /* "aaa,bbb,ccc,ddd,eee,fff" */ - /** Amount of data received */ - size_t data_rcvd; /** TCP application for the control channel */ struct tcp_application tcp; diff --git a/src/net/tcp/ftp.c b/src/net/tcp/ftp.c index ef5423a9..a857f7b7 100644 --- a/src/net/tcp/ftp.c +++ b/src/net/tcp/ftp.c @@ -340,15 +340,12 @@ static void ftp_data_newdata ( struct tcp_application *app, /* Fill data buffer */ if ( ( rc = fill_buffer ( ftp->buffer, data, - ftp->data_rcvd, len ) ) != 0 ){ + ftp->buffer->fill, len ) ) != 0 ){ DBGC ( ftp, "FTP %p failed to fill data buffer: %s\n", ftp, strerror ( rc ) ); ftp_done ( ftp, rc ); return; } - - /* Update received data total */ - ftp->data_rcvd += len; } /** FTP data channel operations */ @@ -377,7 +374,6 @@ struct async_operation * ftp_get ( struct ftp_request *ftp ) { ftp->already_sent = 0; ftp->recvbuf = ftp->status_text; ftp->recvsize = sizeof ( ftp->status_text ) - 1; - ftp->data_rcvd = 0; ftp->tcp.tcp_op = &ftp_tcp_operations; ftp->tcp_data.tcp_op = &ftp_data_tcp_operations; if ( ( rc = tcp_connect ( &ftp->tcp, &ftp->server, 0 ) ) != 0 )