Browse Source

No need to maintain a received byte count; we always fill in sequential

order so we can just use buffer->fill.
tags/v0.9.3
Michael Brown 18 years ago
parent
commit
ad22cccc09
2 changed files with 1 additions and 7 deletions
  1. 0
    2
      src/include/gpxe/ftp.h
  2. 1
    5
      src/net/tcp/ftp.c

+ 0
- 2
src/include/gpxe/ftp.h View File

57
 	char status_text[4];
57
 	char status_text[4];
58
 	/** Passive-mode parameters, as text */
58
 	/** Passive-mode parameters, as text */
59
 	char passive_text[24]; /* "aaa,bbb,ccc,ddd,eee,fff" */
59
 	char passive_text[24]; /* "aaa,bbb,ccc,ddd,eee,fff" */
60
-	/** Amount of data received */
61
-	size_t data_rcvd;
62
 
60
 
63
 	/** TCP application for the control channel */
61
 	/** TCP application for the control channel */
64
 	struct tcp_application tcp;
62
 	struct tcp_application tcp;

+ 1
- 5
src/net/tcp/ftp.c View File

340
 
340
 
341
 	/* Fill data buffer */
341
 	/* Fill data buffer */
342
 	if ( ( rc = fill_buffer ( ftp->buffer, data,
342
 	if ( ( rc = fill_buffer ( ftp->buffer, data,
343
-				  ftp->data_rcvd, len ) ) != 0 ){
343
+				  ftp->buffer->fill, len ) ) != 0 ){
344
 		DBGC ( ftp, "FTP %p failed to fill data buffer: %s\n",
344
 		DBGC ( ftp, "FTP %p failed to fill data buffer: %s\n",
345
 		       ftp, strerror ( rc ) );
345
 		       ftp, strerror ( rc ) );
346
 		ftp_done ( ftp, rc );
346
 		ftp_done ( ftp, rc );
347
 		return;
347
 		return;
348
 	}
348
 	}
349
-
350
-	/* Update received data total */
351
-	ftp->data_rcvd += len;
352
 }
349
 }
353
 
350
 
354
 /** FTP data channel operations */
351
 /** FTP data channel operations */
377
 	ftp->already_sent = 0;
374
 	ftp->already_sent = 0;
378
 	ftp->recvbuf = ftp->status_text;
375
 	ftp->recvbuf = ftp->status_text;
379
 	ftp->recvsize = sizeof ( ftp->status_text ) - 1;
376
 	ftp->recvsize = sizeof ( ftp->status_text ) - 1;
380
-	ftp->data_rcvd = 0;
381
 	ftp->tcp.tcp_op = &ftp_tcp_operations;
377
 	ftp->tcp.tcp_op = &ftp_tcp_operations;
382
 	ftp->tcp_data.tcp_op = &ftp_data_tcp_operations;
378
 	ftp->tcp_data.tcp_op = &ftp_data_tcp_operations;
383
 	if ( ( rc = tcp_connect ( &ftp->tcp, &ftp->server, 0 ) ) != 0 )
379
 	if ( ( rc = tcp_connect ( &ftp->tcp, &ftp->server, 0 ) ) != 0 )

Loading…
Cancel
Save