summaryrefslogtreecommitdiff
path: root/lib9p/srv_include
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-04-15 11:29:44 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-04-15 11:34:07 -0600
commitd4e60a828eb93158f682383b8462770a08f6d2f3 (patch)
tree31d270506b7cd7cc4da655dbb98f196e9d6e4163 /lib9p/srv_include
parent802ed1e3cd0252cafd1be2aada0addf4d3f7eb2e (diff)
lib9p_srv: Expose handle_message() as lib9p_srv_worker()
Diffstat (limited to 'lib9p/srv_include')
-rw-r--r--lib9p/srv_include/lib9p/srv.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/lib9p/srv_include/lib9p/srv.h b/lib9p/srv_include/lib9p/srv.h
index db5be41..9b133e1 100644
--- a/lib9p/srv_include/lib9p/srv.h
+++ b/lib9p/srv_include/lib9p/srv.h
@@ -207,20 +207,32 @@ void lib9p_srv_accept_and_read_loop(struct lib9p_srv *srv, lo_interface net_stre
* @errno L_EDOM Tversion specified an impossibly small max_msg_size
* @errno L_EOPNOTSUPP T-message has an R-message type, or an unrecognized T-message type
* @errno L_EBADMSG T-message has wrong size[4] for its content, or has invalid UTF-8
- * @errno L_ERANGE R-message does not fit into max_msg_size
*/
void lib9p_srv_read(struct lib9p_srv *srv, lo_interface net_stream_conn conn);
-
-
/**
- * In a loop, service requests to the `struct lib9p_srv *srv` argument
- * that have been read by lib9p_srv_accept_and_read_loop() /
- * lib9p_srv_read(). A "NULL" request causes the function to return.
+ * In a loop, call lib9p_srv_worker() to service requests to the
+ * `struct lib9p_srv *srv` argument that have been read by
+ * lib9p_srv_accept_and_read_loop() / lib9p_srv_read(). A "NULL"
+ * request causes the function to return.
*
* @param srv: The server configuration and state; has an associated
* pool of lib9p_srv_accept_and_read_loop() coroutines.
*/
void lib9p_srv_worker_loop(struct lib9p_srv *srv);
+/**
+ * You should probably not call this directly; you should probably use
+ * lib9p_srv_worker_loop().
+ *
+ * Handle and send a response to a single request.
+ *
+ * @param req: The request to handle.
+ *
+ * Errors that this function itself may send to clients:
+ *
+ * @errno L_ERANGE R-message does not fit into max_msg_size
+ */
+void lib9p_srv_worker(struct lib9p_srv_ctx *req);
+
#endif /* _LIB9P_SRV_H_ */