httpd/conn
live-connection handle for upgrade-aware handlers.
Since: WS0 (tls slot wired in WS4; over stdlib httpd since
conn-new
(conn-new [fd : int] :)
allocate a Conn wrapping a client fd.
| fd | connected client socket. |
:Conn -- a fresh handle (free with conn-free), or 0 on allocation failure.
Since: WS0
conn-new-tls
(conn-new-tls [fd : int ^borrow tls : TlsConn] :)
allocate a Conn wrapping a worker's client fd plus its
| fd | connected client socket. | |
| tls | tls_conn_t* handle as :int (0 is equivalent to conn-new). |
:Conn -- a fresh handle (free with conn-free), or 0 on allocation failure.
Since: WS4
conn-of-httpd
(conn-of-httpd [hconn ptr<void>] :)
internal: the Conn for the stdlib conn of a request.
| hconn | the stdlib httpd conn of the current request |
:Conn -- a fresh handle, or 0 on allocation failure.
Since: tourist-on-stdlib-httpd H2
conn-fd
(conn-fd [conn : Conn] :)
the raw client socket fd behind a Conn.
| conn | Conn handle. |
:int -- the file descriptor, or -1 for a null handle.
Since: WS0
conn-tls
(conn-tls [conn : Conn] :)
the per-connection TLS state handle behind a Conn, or 0.
| conn | Conn handle. |
:int -- the tls_conn_t* handle, or 0 (plaintext / null handle).
Since: WS4
conn-mark-upgraded!
(conn-mark-upgraded! [conn : Conn] :)
hand the connection to the upgrade handler.
| conn | Conn handle. |
Since: WS0
conn-upgraded?
(conn-upgraded? [conn : Conn] :)
true once conn-mark-upgraded! has been called.
| conn | Conn handle. |
:bool
Since: WS0
conn-free
(conn-free [conn : Conn] :)
release the Conn handle.
| conn | Conn handle, or 0 (no-op). |
Since: WS0