()
| 55 | } |
| 56 | |
| 57 | func (rs *RsyncServer) ExecutableFileHash() string { |
| 58 | if len(rs.fileHashes) == 0 { |
| 59 | return "" |
| 60 | } |
| 61 | hash := rs.fileHashes[0].Hash |
| 62 | src := make([]byte, 4) |
| 63 | dest := make([]byte, 8) |
| 64 | util.Uint32toBytes(src, hash) |
| 65 | hex.Encode(dest, src) |
| 66 | return string(dest) |
| 67 | } |
| 68 | |
| 69 | func (rs *RsyncServer) listHandler(w http.ResponseWriter, r *http.Request) { |
| 70 | util.Json(w, r, http.StatusAccepted, ListFileResult{rs.fileHashes}) |