]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
Don't pass through zero-length requests
authorMichael Brown <mcb30@etherboot.org>
Thu, 1 Feb 2007 07:18:56 +0000 (07:18 +0000)
committerMichael Brown <mcb30@etherboot.org>
Thu, 1 Feb 2007 07:18:56 +0000 (07:18 +0000)
src/net/stream.c

index bf49bb9e1ea759942325f34fc8736523c2f3055e..86fb3066b0f3b92edf3b00febb6e6e9e3745c8fb 100644 (file)
@@ -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;