mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
dns: marshal to io.writer instead of byte slice
This commit is contained in:
1 parent
a0542a028e
commit
149824cc20
5 files changed
+55
-67
No files matched your search
+6
-10
@@ -109,16 +109,12 @@ func parseRequest(r *bufio.Reader) (*request, error) {
|
||||
return req, nil
|
||||
}
|
||||
|
||||
func (r *request) Marshal() []byte {
|
||||
var buf bytes.Buffer
|
||||
writeStartLine(&buf, r.method, r.ruri, r.proto)
|
||||
writeHeaders(&buf, r.header)
|
||||
return buf.Bytes()
|
||||
func (r *request) WriteBuf(buf *bytes.Buffer) {
|
||||
writeStartLine(buf, r.method, r.ruri, r.proto)
|
||||
writeHeaders(buf, r.header)
|
||||
}
|
||||
|
||||
func (r *request) MarshalAbs() []byte {
|
||||
var buf bytes.Buffer
|
||||
writeStartLine(&buf, r.method, r.absuri, r.proto)
|
||||
writeHeaders(&buf, r.header)
|
||||
return buf.Bytes()
|
||||
func (r *request) WriteAbsBuf(buf *bytes.Buffer) {
|
||||
writeStartLine(buf, r.method, r.absuri, r.proto)
|
||||
writeHeaders(buf, r.header)
|
||||
}
|
||||
Reference in new issue
Block a user