mirror of
https://github.com/tlsnotary/server.git
synced 2026-01-09 11:57:54 -05:00
fix leak
This commit is contained in:
@@ -120,6 +120,12 @@ func setBlob(w http.ResponseWriter, req *http.Request) {
|
|||||||
writeResponse(out, w)
|
writeResponse(out, w)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ping is sent to check if notary is available
|
||||||
|
func ping(w http.ResponseWriter, req *http.Request) {
|
||||||
|
log.Println("in ping", req.RemoteAddr)
|
||||||
|
writeResponse(nil, w)
|
||||||
|
}
|
||||||
|
|
||||||
// when notary starts we expect the admin to upload a URLFetcher document
|
// when notary starts we expect the admin to upload a URLFetcher document
|
||||||
// it can be uploaded e.g. with:
|
// it can be uploaded e.g. with:
|
||||||
// curl --data-binary '@URLFetcherDoc' 127.0.0.1:10012/setURLFetcherDoc
|
// curl --data-binary '@URLFetcherDoc' 127.0.0.1:10012/setURLFetcherDoc
|
||||||
@@ -200,6 +206,7 @@ func main() {
|
|||||||
|
|
||||||
http.HandleFunc("/getBlob", getBlob)
|
http.HandleFunc("/getBlob", getBlob)
|
||||||
http.HandleFunc("/setBlob", setBlob)
|
http.HandleFunc("/setBlob", setBlob)
|
||||||
|
http.HandleFunc("/ping", ping)
|
||||||
|
|
||||||
// all the other request will end up in the httpHandler
|
// all the other request will end up in the httpHandler
|
||||||
http.HandleFunc("/", httpHandler)
|
http.HandleFunc("/", httpHandler)
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ func (sm *SessionManager) removeSession(key string) {
|
|||||||
s, ok := sm.sessions[key]
|
s, ok := sm.sessions[key]
|
||||||
if !ok {
|
if !ok {
|
||||||
log.Println("Cannot remove: session does not exist ", key)
|
log.Println("Cannot remove: session does not exist ", key)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
err := os.RemoveAll(s.session.StorageDir)
|
err := os.RemoveAll(s.session.StorageDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user