summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2007-02-01 08:18:56 +0100
committerMichael Brown2007-02-01 08:18:56 +0100
commit2c671679299ad472d54cd33a8c16d4355ede982b (patch)
treeea50dffba7bb5e952ef1f5bff423625a82756473
parentSHA1_DIGEST_SIZE also available as a static constant (diff)
downloadipxe-2c671679299ad472d54cd33a8c16d4355ede982b.tar.gz
ipxe-2c671679299ad472d54cd33a8c16d4355ede982b.tar.xz
ipxe-2c671679299ad472d54cd33a8c16d4355ede982b.zip
Don't pass through zero-length requests
-rw-r--r--src/net/stream.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/net/stream.c b/src/net/stream.c
index bf49bb9e1..86fb3066b 100644
--- a/src/net/stream.c
+++ b/src/net/stream.c
@@ -156,6 +156,10 @@ void stream_acked ( struct stream_connection *conn, size_t len ) {
return;
}
+ /* Ignore zero-length blocks */
+ if ( len == 0 )
+ return;
+
/* Hand off to application */
if ( app->op->acked )
app->op->acked ( app, len );
@@ -181,6 +185,10 @@ void stream_newdata ( struct stream_connection *conn,
return;
}
+ /* Ignore zero-length blocks */
+ if ( len == 0 )
+ return;
+
/* Hand off to application */
if ( app->op->newdata )
app->op->newdata ( app, data, len );
@@ -297,6 +305,10 @@ int stream_send ( struct stream_application *app,
return -ENOTCONN;
}
+ /* Ignore zero-length blocks */
+ if ( len == 0 )
+ return 0;
+
/* Hand off to connection */
if ( ! conn->op->send )
return -ENOTSUP;