diff --git a/Makefile b/Makefile index 545bb59..6f90e66 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,14 @@ ICONS += app/icon-256.png all: icons serverside -serverside: - GOPATH=$(CURDIR) go build -v all +serverside: spongy spongy.cgi + +spongy: src/spongy/spongy.go + GOPATH=$(CURDIR) go build -v $@ + +spongy.cgi: src/spongy.cgi/spongy.cgi.go + GOPATH=$(CURDIR) go build -v $@ + chmod +s $@ icons: $(ICONS) diff --git a/src/spongy.cgi/spongy.cgi.go b/src/spongy.cgi/spongy.cgi.go index 73585d6..580a51e 100644 --- a/src/spongy.cgi/spongy.cgi.go +++ b/src/spongy.cgi/spongy.cgi.go @@ -75,7 +75,7 @@ func tail(w http.ResponseWriter, filename string, pos int64) { parts := strings.Split(t, " ") if (len(parts) >= 4) && (parts[2] == "NEXTLOG") { watcher.Remove(filepath) - filename = parts[4] + filename = parts[3] filepath = path.Join(NetworkDir, filename) f.Close() f, err = os.Open(filepath) @@ -83,6 +83,7 @@ func tail(w http.ResponseWriter, filename string, pos int64) { log.Fatal(err) } watcher.Add(filepath) + pos = 0 } fmt.Fprintf(w, "data: %s\n", t) printid = true