summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2007-01-12 18:16:46 +0100
committerMichael Brown2007-01-12 18:16:46 +0100
commitad22cccc0931a7275e497e1c625fe83e79d61d4e (patch)
treeee84020ec6adfd2f493aee73f69686f6db69b901
parentAdded generic line-buffering code (a la stdio) (diff)
downloadipxe-ad22cccc0931a7275e497e1c625fe83e79d61d4e.tar.gz
ipxe-ad22cccc0931a7275e497e1c625fe83e79d61d4e.tar.xz
ipxe-ad22cccc0931a7275e497e1c625fe83e79d61d4e.zip
No need to maintain a received byte count; we always fill in sequential
order so we can just use buffer->fill.
-rw-r--r--src/include/gpxe/ftp.h2
-rw-r--r--src/net/tcp/ftp.c6
2 files changed, 1 insertions, 7 deletions
diff --git a/src/include/gpxe/ftp.h b/src/include/gpxe/ftp.h
index e296021dd..2c51036ae 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 ef5423a9c..a857f7b7b 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 )