tobogganSe connecter

louise

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

M8 (part 2): std/net, std/http and std/dict — a native HTTP server

- tilrt/net.rs:
  - non-blocking TCP sockets as resources on a mio reactor owned by the
    scheduler;
  - an operation that would block parks the actor on the socket;
  - the scheduler polls between slices and, when idle, waits until the
    next timer (the clock follows real time while sockets are pending);
  - HTTP request heads are parsed with httparse (picohttpparser's design).
- std/net: listen, port, accept, connect, read, write, close.
- std/http: Request/Response, html/text responses, and serve/serve_some
  with one actor per connection. Requests split across reads and
  Content-Length bodies are handled.
- std/dict: persistent AVL maps.
- std/string: split, trim, to_lower, to_int, byte_length.
- Tests: a dict run test and a strings run test (both backends), and an
  end-to-end HTTP test with an SSR page, a 404, a POST body and a split
  request. Also checked by hand with curl.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

olivier · il y a 1 mois · 9744f0d8d30c689fbbc2f420f611a962711f1ee5

Parents 424c4ce

20 fichiers modifiés, 1272 ajouts, 41 suppressions

Acrates/tilc/tests/fixtures/http/server.til+38−0
Mcrates/tilc_codegen_c/src/emit.rs+20−1