]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[ftp] Remove redundant ftp_data_deliver() method
authorMichael Brown <mcb30@ipxe.org>
Fri, 24 Jun 2011 11:51:45 +0000 (12:51 +0100)
committerMichael Brown <mcb30@ipxe.org>
Tue, 28 Jun 2011 12:39:14 +0000 (13:39 +0100)
ftp_data_deliver() does nothing except pass through the received data
to the xfer interface, and so can be eliminated by using a
pass-through interface.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/net/tcp/ftp.c

index 957f05cc8aeab39c1f7982d8db8a2daa0cd72486..e5bc8e9f39c6f3751911dacc0c364a6552cbefeb 100644 (file)
@@ -378,37 +378,15 @@ static void ftp_data_closed ( struct ftp_request *ftp, int rc ) {
        }
 }
 
-/**
- * Handle data delivery via FTP data channel
- *
- * @v ftp              FTP request
- * @v iobuf            I/O buffer
- * @v meta             Data transfer metadata
- * @ret rc             Return status code
- */
-static int ftp_data_deliver ( struct ftp_request *ftp,
-                             struct io_buffer *iobuf,
-                             struct xfer_metadata *meta __unused ) {
-       int rc;
-
-       if ( ( rc = xfer_deliver_iob ( &ftp->xfer, iobuf ) ) != 0 ) {
-               DBGC ( ftp, "FTP %p failed to deliver data: %s\n",
-                      ftp, strerror ( rc ) );
-               return rc;
-       }
-
-       return 0;
-}
-
 /** FTP data channel interface operations */
 static struct interface_operation ftp_data_operations[] = {
-       INTF_OP ( xfer_deliver, struct ftp_request *, ftp_data_deliver ),
        INTF_OP ( intf_close, struct ftp_request *, ftp_data_closed ),
 };
 
 /** FTP data channel interface descriptor */
 static struct interface_descriptor ftp_data_desc =
-       INTF_DESC ( struct ftp_request, data, ftp_data_operations );
+       INTF_DESC_PASSTHRU ( struct ftp_request, data, ftp_data_operations,
+                            xfer );
 
 /*****************************************************************************
  *
@@ -423,7 +401,8 @@ static struct interface_operation ftp_xfer_operations[] = {
 
 /** FTP data transfer interface descriptor */
 static struct interface_descriptor ftp_xfer_desc =
-       INTF_DESC ( struct ftp_request, xfer, ftp_xfer_operations );
+       INTF_DESC_PASSTHRU ( struct ftp_request, xfer, ftp_xfer_operations,
+                            data );
 
 /*****************************************************************************
  *