File sync
This commit is contained in:
parent
b76502c034
commit
47c4c99b66
7 changed files with 174 additions and 19 deletions
9
main.go
9
main.go
|
|
@ -27,7 +27,7 @@ import (
|
|||
|
||||
const VERSION = "v30"
|
||||
const CONTEXT_USER = 1
|
||||
const SYNC_PAGINATION = 200
|
||||
const SYNC_PAGINATION = 1
|
||||
|
||||
var (
|
||||
FlagGenerate bool
|
||||
|
|
@ -287,6 +287,9 @@ func pageSync(w http.ResponseWriter, r *http.Request) { // {{{
|
|||
} // }}}
|
||||
|
||||
func actionSyncFromServer(w http.ResponseWriter, r *http.Request) { // {{{
|
||||
// XXX - DELETE ME!
|
||||
time.Sleep(time.Millisecond * 200)
|
||||
|
||||
// The purpose of the Client UUID is to avoid
|
||||
// sending nodes back once again to a client that
|
||||
// just created or modified it.
|
||||
|
|
@ -551,6 +554,10 @@ func actionFile(w http.ResponseWriter, r *http.Request) { // {{{
|
|||
return
|
||||
}
|
||||
|
||||
w.Header().Add("X-File-Name", md.Name)
|
||||
w.Header().Add("X-File-Modified", fmt.Sprintf("%d", md.Modified.UnixMilli()))
|
||||
w.Header().Add("Content-Type", md.Type)
|
||||
|
||||
http.ServeContent(w, r, md.Name, md.Modified, f)
|
||||
} // }}}
|
||||
func actionFileMetadata(w http.ResponseWriter, r *http.Request) { // {{{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue