From 8ae1cac0502c2a4d946f7bafa15a944bb1ef48a2 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sun, 15 Feb 2009 08:41:46 +0000 Subject: [xfer] Make consistent assumptions that xfer metadata can never be NULL The documentation in xfer.h and xfer.c does not say that the metadata parameter is optional in calls such as xfer_deliver_iob_meta() and the deliver_iob() method. However, some code in net/ is prepared to accept a NULL pointer, and xfer_deliver_as_iob() passes a NULL pointer directly to the deliver_iob() method. Fix this mess of conflicting assumptions by making everything assume that the metadata parameter is mandatory, and fixing xfer_deliver_as_iob() to pass in a dummy metadata structure (as is already done in xfer_deliver_iob()). --- src/net/tcp/ftp.c | 2 +- src/net/tcp/http.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/net/tcp') diff --git a/src/net/tcp/ftp.c b/src/net/tcp/ftp.c index 82dc19caf..445e32bb4 100644 --- a/src/net/tcp/ftp.c +++ b/src/net/tcp/ftp.c @@ -380,7 +380,7 @@ static void ftp_data_closed ( struct xfer_interface *data, int rc ) { * * @v xfer FTP data channel interface * @v iobuf I/O buffer - * @v meta Data transfer metadata, or NULL + * @v meta Data transfer metadata * @ret rc Return status code */ static int ftp_data_deliver_iob ( struct xfer_interface *data, diff --git a/src/net/tcp/http.c b/src/net/tcp/http.c index 57487308f..0191750b6 100644 --- a/src/net/tcp/http.c +++ b/src/net/tcp/http.c @@ -321,7 +321,7 @@ static int http_rx_data ( struct http_request *http, * * @v socket Transport layer interface * @v iobuf I/O buffer - * @v meta Data transfer metadata, or NULL + * @v meta Data transfer metadata * @ret rc Return status code */ static int http_socket_deliver_iob ( struct xfer_interface *socket, -- cgit v1.2.3-55-g7522