mirror of https://github.com/perkeep/perkeep.git
Rename ResponseWriter 'conn' to 'rw'
Change-Id: Id0faeac080f678794c1db1601cb9c1a9ba92e926
This commit is contained in:
parent
433a312703
commit
1046470614
|
@ -169,12 +169,12 @@ func vivify(blobReceiver blobserver.BlobReceiveConfiger, fileblob blob.SizedRef)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleMultiPartUpload(conn http.ResponseWriter, req *http.Request, blobReceiver blobserver.BlobReceiveConfiger) {
|
func handleMultiPartUpload(rw http.ResponseWriter, req *http.Request, blobReceiver blobserver.BlobReceiveConfiger) {
|
||||||
res := new(protocol.UploadResponse)
|
res := new(protocol.UploadResponse)
|
||||||
|
|
||||||
if !(req.Method == "POST" && strings.Contains(req.URL.Path, "/camli/upload")) {
|
if !(req.Method == "POST" && strings.Contains(req.URL.Path, "/camli/upload")) {
|
||||||
log.Printf("Inconfigured handler upload handler")
|
log.Printf("Inconfigured handler upload handler")
|
||||||
httputil.BadRequestError(conn, "Inconfigured handler.")
|
httputil.BadRequestError(rw, "Inconfigured handler.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ func handleMultiPartUpload(conn http.ResponseWriter, req *http.Request, blobRece
|
||||||
|
|
||||||
multipart, err := req.MultipartReader()
|
multipart, err := req.MultipartReader()
|
||||||
if multipart == nil {
|
if multipart == nil {
|
||||||
httputil.BadRequestError(conn, fmt.Sprintf(
|
httputil.BadRequestError(rw, fmt.Sprintf(
|
||||||
"Expected multipart/form-data POST request; %v", err))
|
"Expected multipart/form-data POST request; %v", err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -254,12 +254,12 @@ func handleMultiPartUpload(conn http.ResponseWriter, req *http.Request, blobRece
|
||||||
if err != nil {
|
if err != nil {
|
||||||
addError(fmt.Sprintf("Error vivifying blob %v: %v\n", got.Ref.String(), err))
|
addError(fmt.Sprintf("Error vivifying blob %v: %v\n", got.Ref.String(), err))
|
||||||
} else {
|
} else {
|
||||||
conn.Header().Add("X-Camlistore-Vivified", got.Ref.String())
|
rw.Header().Add("X-Camlistore-Vivified", got.Ref.String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
res.ErrorText = errBuf.String()
|
res.ErrorText = errBuf.String()
|
||||||
|
|
||||||
httputil.ReturnJSON(conn, res)
|
httputil.ReturnJSON(rw, res)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue