Explorar el Código

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 hace 18 años
padre
commit
ad22cccc09
Se han modificado 2 ficheros con 1 adiciones y 7 borrados
  1. 0
    2
      src/include/gpxe/ftp.h
  2. 1
    5
      src/net/tcp/ftp.c

+ 0
- 2
src/include/gpxe/ftp.h Ver fichero

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

+ 1
- 5
src/net/tcp/ftp.c Ver fichero

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

Loading…
Cancelar
Guardar