rtl8720dn: add examples/rtl8720dn/webserver

This commit is contained in:
sago35
2021-07-05 18:21:33 +09:00
committed by Ron Evans
parent 8a4a0ff017
commit 6a4cd9d8e7
17 changed files with 2650 additions and 171 deletions
+34
View File
@@ -0,0 +1,34 @@
package http
import (
"bufio"
"golang.org/x/net/http/httpguts"
)
// msg is *Request or *Response.
func readTransfer(msg *Request, r *bufio.Reader) (err error) {
// TODO:
return nil
}
// Determine whether to hang up after sending a request and body, or
// receiving a response and body
// 'header' is the request headers
func shouldClose(major, minor int, header Header, removeCloseHeader bool) bool {
if major < 1 {
return true
}
conv := header["Connection"]
hasClose := httpguts.HeaderValuesContainsToken(conv, "close")
if major == 1 && minor == 0 {
return hasClose || !httpguts.HeaderValuesContainsToken(conv, "keep-alive")
}
if hasClose && removeCloseHeader {
header.Del("Connection")
}
return hasClose
}