Commit b4ea8f84 authored by Marin Jankovski's avatar Marin Jankovski

Fix leftovers after middleware concept merge.

parent 43b75c8c
...@@ -16,7 +16,7 @@ import ( ...@@ -16,7 +16,7 @@ import (
"time" "time"
) )
func handleGetArchive(w http.ResponseWriter, r *gitRequest, format string) (callback *gitRequest) { func handleGetArchive(w http.ResponseWriter, r *gitRequest, format string) {
archiveFilename := path.Base(r.ArchivePath) archiveFilename := path.Base(r.ArchivePath)
if cachedArchive, err := os.Open(r.ArchivePath); err == nil { if cachedArchive, err := os.Open(r.ArchivePath); err == nil {
......
...@@ -12,7 +12,7 @@ import ( ...@@ -12,7 +12,7 @@ import (
"strings" "strings"
) )
func handleGetInfoRefs(w http.ResponseWriter, r *gitRequest, _ string) (callback *gitRequest) { func handleGetInfoRefs(w http.ResponseWriter, r *gitRequest, _ string) {
rpc := r.URL.Query().Get("service") rpc := r.URL.Query().Get("service")
if !(rpc == "git-upload-pack" || rpc == "git-receive-pack") { if !(rpc == "git-upload-pack" || rpc == "git-receive-pack") {
// The 'dumb' Git HTTP protocol is not supported // The 'dumb' Git HTTP protocol is not supported
...@@ -58,7 +58,7 @@ func handleGetInfoRefs(w http.ResponseWriter, r *gitRequest, _ string) (callback ...@@ -58,7 +58,7 @@ func handleGetInfoRefs(w http.ResponseWriter, r *gitRequest, _ string) (callback
return return
} }
func handlePostRPC(w http.ResponseWriter, r *gitRequest, rpc string) (callback *gitRequest) { func handlePostRPC(w http.ResponseWriter, r *gitRequest, rpc string) {
var body io.ReadCloser var body io.ReadCloser
var err error var err error
......
...@@ -23,7 +23,7 @@ var ( ...@@ -23,7 +23,7 @@ var (
errSizeMismatch = errors.New("Content size does not match") errSizeMismatch = errors.New("Content size does not match")
) )
func handleStoreLfsObject(w http.ResponseWriter, r *gitRequest, rpc string) (callback *gitRequest) { func handleStoreLfsObject(w http.ResponseWriter, r *gitRequest, rpc string) {
var body io.ReadCloser var body io.ReadCloser
urlPath := r.URL.Path urlPath := r.URL.Path
...@@ -42,9 +42,9 @@ func handleStoreLfsObject(w http.ResponseWriter, r *gitRequest, rpc string) (cal ...@@ -42,9 +42,9 @@ func handleStoreLfsObject(w http.ResponseWriter, r *gitRequest, rpc string) (cal
storePath := filepath.Join(r.StoreLFSPath, transformKey(oid)) storePath := filepath.Join(r.StoreLFSPath, transformKey(oid))
if _, err := os.Stat(storePath); os.IsNotExist(err) { if _, err := os.Stat(storePath); os.IsNotExist(err) {
var err error
tmpPath := filepath.Join(r.StoreLFSPath, "tmp", oid) tmpPath := filepath.Join(r.StoreLFSPath, "tmp", oid)
if _, err := os.Stat(tmpPath); os.IsNotExist(err) {
// TODO try removing gzip, possibly not needed // TODO try removing gzip, possibly not needed
// The client request body may have been gzipped. // The client request body may have been gzipped.
if r.Header.Get("Content-Encoding") == "gzip" { if r.Header.Get("Content-Encoding") == "gzip" {
...@@ -101,6 +101,7 @@ func handleStoreLfsObject(w http.ResponseWriter, r *gitRequest, rpc string) (cal ...@@ -101,6 +101,7 @@ func handleStoreLfsObject(w http.ResponseWriter, r *gitRequest, rpc string) (cal
return return
} }
} }
}
// if err := os.Rename(tmpPath, path); err != nil { // if err := os.Rename(tmpPath, path); err != nil {
// fail500(w, "Failed to rename temporary LFS object.", err) // fail500(w, "Failed to rename temporary LFS object.", err)
// return // return
...@@ -108,11 +109,11 @@ func handleStoreLfsObject(w http.ResponseWriter, r *gitRequest, rpc string) (cal ...@@ -108,11 +109,11 @@ func handleStoreLfsObject(w http.ResponseWriter, r *gitRequest, rpc string) (cal
log.Printf("Received the LFS object from client, oid: %s", oid) log.Printf("Received the LFS object from client, oid: %s", oid)
return r return
} }
func handleRetreiveLfsObject(w http.ResponseWriter, r *gitRequest, rpc string) (callback *gitRequest) { func handleRetreiveLfsObject(w http.ResponseWriter, r *gitRequest, rpc string) {
log.Printf("I should download %s", r) log.Printf("I should download %s", r)
urlPath := r.URL.Path urlPath := r.URL.Path
......
...@@ -179,4 +179,3 @@ func looksLikeRepo(p string) bool { ...@@ -179,4 +179,3 @@ func looksLikeRepo(p string) bool {
} }
return true return true
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment