summaryrefslogtreecommitdiff
path: root/net9p.c
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-09-23 12:35:42 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-09-23 12:38:38 -0600
commitfbd945a03f2d706bb4d62aab6a607c1694d6d77a (patch)
treea3ab6ae733c3dbb37156b33bdb09aaac521c6d46 /net9p.c
parentc3d212e15ce147f0b0ceaac7a50f9a44831aacb9 (diff)
wip 9p reorg
Diffstat (limited to 'net9p.c')
-rw-r--r--net9p.c44
1 files changed, 0 insertions, 44 deletions
diff --git a/net9p.c b/net9p.c
deleted file mode 100644
index f7c8195..0000000
--- a/net9p.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#include "net9p.h"
-#include "net9p_defs.h"
-#include "netio.h"
-
-#define MAX_MSG_SIZE 1024
-
-int read_msg(int conn, uint16_t *out_tag, void **out_body) {
- uint8_t buf[MAX_MSG_SIZE];
- size_t todo = 7, done = 0;
-
- while (done < todo) {
- ssize_t r = netio_read(conn, buf, 7);
- if (r < 0)
- return r;
- done += r;
- }
- todo = docode_u32le(buf);
- if (todo < 7)
- return -EINVAL;
- while (done < todo) {
- ssize_t r = netio_read(conn, buf, 7);
- if (r < 0)
- return r;
- done += r;
- }
- return v9fs_unmarshal_msg(buf, out_tag, out_body);
-}
-
-void net9p_cr(void *_arg) {
- int sock = *((int *)_arg);
- cr_begin();
-
- for (;;) {
- int conn = netio_accept(sock);
- if (conn < 0) {
- error(0, -conn, "netio_accept");
- continue;
- }
-
-
- }
-
- cr_end();
-}