mirror of
https://github.com/soypat/lneto.git
synced 2026-08-17 13:23:30 +00:00
massive documentation push and code reordering in files
This commit is contained in:
@@ -288,7 +288,7 @@ func handleConnNet(conn net.Conn) error {
|
||||
}
|
||||
}
|
||||
method := string(hdr.Method())
|
||||
uri := string(hdr.RequestURI())
|
||||
uri := string(hdr.RequestTarget())
|
||||
fmt.Printf("< %s %s\n", method, uri)
|
||||
|
||||
var resp httpraw.Header
|
||||
@@ -370,7 +370,7 @@ func mockClient(stack *xnet.StackAsync, port uint16, subnet netip.Prefix) {
|
||||
|
||||
var hdr httpraw.Header
|
||||
hdr.SetMethod("GET")
|
||||
hdr.SetRequestURI("/")
|
||||
hdr.SetRequestTarget("/")
|
||||
hdr.SetProtocol("HTTP/1.1")
|
||||
hdr.Set("Host", string(ipv4.AppendFormatAddr(nil, stack.Addr4())))
|
||||
hdr.Set("User-Agent", "lneto-mock")
|
||||
|
||||
@@ -97,8 +97,8 @@ func homepage(exch *httphi.Exchange) {
|
||||
n += len(strconv.AppendUint(page[n:n], visits.Add(1), 10))
|
||||
n += copy(page[n:], htmlTail)
|
||||
|
||||
exch.SetHeader("Content-Type", "text/html")
|
||||
exch.SetHeaderInt("Content-Length", int64(n), 10)
|
||||
exch.StageHeader("Content-Type", "text/html")
|
||||
exch.StageHeaderInt("Content-Length", int64(n), 10)
|
||||
exch.WriteHeader(int(httphi.StatusOK))
|
||||
exch.Write(page[:n])
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ func run() error {
|
||||
// Prepare GET request.
|
||||
var hdr httpraw.Header
|
||||
hdr.SetMethod("GET")
|
||||
hdr.SetRequestURI("/")
|
||||
hdr.SetRequestTarget("/")
|
||||
hdr.SetProtocol("HTTP/1.1")
|
||||
req, err := hdr.AppendRequest(nil)
|
||||
if err != nil {
|
||||
|
||||
@@ -282,7 +282,7 @@ func handleConnection(conn *tcp.Conn) error {
|
||||
}
|
||||
|
||||
method := string(hdr.Method())
|
||||
uri := string(hdr.RequestURI())
|
||||
uri := string(hdr.RequestTarget())
|
||||
fmt.Printf("< %s %s\n", method, uri)
|
||||
|
||||
// Build response body.
|
||||
|
||||
@@ -307,7 +307,7 @@ func run() (err error) {
|
||||
timeHTTPCreate := timer("create HTTP GET request")
|
||||
var hdr httpraw.Header
|
||||
hdr.SetMethod("GET")
|
||||
hdr.SetRequestURI("/")
|
||||
hdr.SetRequestTarget("/")
|
||||
hdr.SetProtocol("HTTP/1.1")
|
||||
hdr.Set("Host", flagHostToResolve)
|
||||
hdr.Set("User-Agent", "lneto")
|
||||
|
||||
Reference in New Issue
Block a user