Hash :
71efafdf
Author :
Thomas de Grivel
Date :
2025-05-31T00:26:20
fix buf_fd_open_w_flush
quote (server = Socket.listen("localhost", "57000")) ; void
(server = Socket.listen("localhost", "57000")) ; void
quote (client = Socket.Buf.connect("localhost", "57000")) ; void
(client = Socket.Buf.connect("localhost", "57000")) ; void
quote (server_client = Socket.Buf.accept(server)) ; void
(server_client = Socket.Buf.accept(server)) ; void
quote client_req = %HTTP.Request{method: GET,
url: "/",
protocol: "HTTP/1.1",
headers: []}
client_req = %HTTP.Request{method: GET,
url: "/",
protocol: "HTTP/1.1",
headers: []}
quote HTTP.Request.buf_write(client_req, client.buf_rw.w)
HTTP.Request.buf_write(client_req, client.buf_rw.w)
quote req = HTTP.Request.buf_parse(server_client.buf_rw.r)
req = HTTP.Request.buf_parse(server_client.buf_rw.r)
quote puts(req)
puts(req)
quote res = HTTP.Response.buf_write(%HTTP.Response{body: "Hello !"}, server_client.buf_rw.w, true)
res = HTTP.Response.buf_write(%HTTP.Response{body: "Hello !"}, server_client.buf_rw.w, true)
quote client_response = HTTP.Response.buf_parse(client.buf_rw.r, true)
client_response = HTTP.Response.buf_parse(client.buf_rw.r, true)
quote puts(client_response)
puts(client_response)
quote Socket.Buf.close(server_client)
Socket.Buf.close(server_client)
quote Socket.Buf.close(client)
Socket.Buf.close(client)
quote Socket.close(server)
Socket.close(server)