bug fixes for 2.6.5

+ Added potential fixes for #34 and #39
+ Added better error handling for #43
This commit is contained in:
Toby Chui
2023-08-17 14:08:48 +08:00
parent d42ac8a146
commit 70adadf129
7 changed files with 78 additions and 41 deletions

View File

@@ -156,11 +156,19 @@ func HandleUptimeMonitorListing(w http.ResponseWriter, r *http.Request) {
// Handle listing current registered mdns nodes
func HandleMdnsListing(w http.ResponseWriter, r *http.Request) {
if mdnsScanner == nil {
utils.SendErrorResponse(w, "mDNS scanner is disabled on this host")
return
}
js, _ := json.Marshal(previousmdnsScanResults)
utils.SendJSONResponse(w, string(js))
}
func HandleMdnsScanning(w http.ResponseWriter, r *http.Request) {
if mdnsScanner == nil {
utils.SendErrorResponse(w, "mDNS scanner is disabled on this host")
return
}
domain, err := utils.PostPara(r, "domain")
var hosts []*mdns.NetworkHost
if err != nil {