ocsigenserver icon indicating copy to clipboard operation
ocsigenserver copied to clipboard

WIP: Transition from Lwt to Eio

Open Julow opened this issue 6 months ago • 1 comments

On top of https://github.com/ocsigen/ocsigenserver/pull/267 https://github.com/ocsigen/ocsigenserver/pull/268 https://github.com/ocsigen/ocsigenserver/pull/266

The first commit are the changes automatically made by this tool: https://github.com/Julow/lwt-to-direct-style with the following options:

lwt-to-direct-style --migrate --eio-sw-as-fiber-var=Ocsigen_lib.current_switch --eio-env-as-fiber-var=Ocsigen_lib.env

The second commit makes all the manual changes required to make the server works. It does many things and I plan to split it up into smaller commits with better messages.

The tests run but I've not tested this in a real application yet. There are no compatible Eliom version yet.

Julow avatar Jun 19 '25 17:06 Julow

Important work remain to be done:

  • [ ] TLS is not implemented by cohttp-eio. It was previously done by conduit, which doesn't have a eio version yet.

  • [ ] Eio's Switch mechanism should be used to make sure resources are scoped to a request.

  • [x] Staticmod can't access files outside of the current directory anymore. This means that it won't follow symlinks to files outside of the current directory. Whether this breaks applications should be checked.

  • [ ] The server no longer listens to IPv6 when started with ~ports:[ `All ].

  • [ ] The code for querying the environment and current switch could be improved.

Julow avatar Jun 19 '25 17:06 Julow