diff options
Diffstat (limited to '9p/srv.h')
-rw-r--r-- | 9p/srv.h | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -3,6 +3,25 @@ #include "coroutine.h" +#define 9P_DEFAULT_PORT 564 + +/** + * The default here is the same as in Plan 9 4e's lib9p. It's sized + * so that a Twrite message can return 8KiB of data; it uses the + * default (1024*8)+24 with the comment that "24" is "ample room for + * Twrite/Rread header (iounit)". In fact, the Twrite header is only + * 23 bytes ("size[4] Twrite[1] tag[2] fid[4] offset[8] count[4]") and + * the Rread header is even shorter at 11 bytes ("size[4] Rread[1] + * tag[2] count[4]"), so "24" appears to be the size of the Twrite + * header rounded up to a nice round number. + * + * In older versions of 9P ("9P1"), the max message size was defined + * as part of the protocol specification rather than negotiated. In + * Plan 9 1e it was (1024*8)+128, and was bumped to (1024*8)+160 in 2e + * and 3e. + */ +#define 9P_DEFAULT_MAX_MSG_SIZE ((1024*8)+24) + COROUTINE net9p_cr(void *); #endif /* _NET9P_H_ */ |