aboutsummaryrefslogtreecommitdiff
path: root/request.go
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-02-28 22:20:43 -0500
committerAdnan Maolood <[email protected]>2021-02-28 22:20:59 -0500
commitf7012b38dacc29f9c6f94f9ea9274525ac81ac5d (patch)
treef181bd8c5141ebfa37c91181860802f3a185e0a2 /request.go
parentMake Request implement io.WriterTo (diff)
downloadgo-gemini-f7012b38dacc29f9c6f94f9ea9274525ac81ac5d.tar.xz
go-gemini-f7012b38dacc29f9c6f94f9ea9274525ac81ac5d.zip
Request.WriteTo: return int64
Diffstat (limited to 'request.go')
-rw-r--r--request.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/request.go b/request.go
index e539675..e87d2ca 100644
--- a/request.go
+++ b/request.go
@@ -79,20 +79,20 @@ func ReadRequest(r io.Reader) (*Request, error) {
// WriteTo writes r to w in the Gemini request format.
// This method consults the request URL only.
-func (r *Request) WriteTo(w io.Writer) (int, error) {
+func (r *Request) WriteTo(w io.Writer) (int64, error) {
bw := bufio.NewWriterSize(w, 1026)
url := r.URL.String()
if len(url) > 1024 {
return 0, ErrInvalidRequest
}
- var wrote int
+ var wrote int64
n, err := bw.WriteString(url)
- wrote += n
+ wrote += int64(n)
if err != nil {
return wrote, err
}
n, err = bw.Write(crlf)
- wrote += n
+ wrote += int64(n)
if err != nil {
return wrote, err
}