diff options
Diffstat (limited to 'src/method_null.c')
-rw-r--r-- | src/method_null.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/method_null.c b/src/method_null.c index fd41110..dea84d4 100644 --- a/src/method_null.c +++ b/src/method_null.c @@ -25,21 +25,31 @@ */ #include "fastd.h" +#include "task.h" -static void null_init(const fastd_context *ctx) { +static size_t null_max_packet_size(fastd_context *ctx) { + return fastd_max_packet_size(ctx); } -static void null_recv(const fastd_context *ctx, void *buffer, size_t len) { +static void null_init(fastd_context *ctx, const fastd_peer *peer) { + struct iovec buffer = { .iov_base = NULL, .iov_len = 0 }; + fastd_task_put_send(ctx, peer, buffer); } -static void null_send(const fastd_context *ctx, void *buffer, size_t len) { +static void null_handle_recv(fastd_context *ctx, const fastd_peer *peer, struct iovec buffer) { + fastd_task_put_handle_recv(ctx, peer, buffer); +} + +static void null_send(fastd_context *ctx, const fastd_peer *peer, struct iovec buffer) { + fastd_task_put_send(ctx, peer, buffer); } const fastd_method fastd_method_null = { .name = "null", + .method_max_packet_size = null_max_packet_size, .method_init = null_init, - .method_recv = null_recv, + .method_handle_recv = null_handle_recv, .method_send = null_send, }; |