zoo daemon sends package list over wire
man. long live google protobuf. It's amazing. This thing just sent all 3k of the package info over http in raw wire format. I'm sure this isn't neat to anyone young but to old hacks like me, it's fucking magic how wonderfully advanced the language and codebase is. It just reminds you how there are actually beautiful things in the world.
This commit is contained in:
parent
9d265e0445
commit
141d3024fd
11
http.go
11
http.go
|
@ -6,6 +6,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"go.wit.com/lib/protobuf/zoopb"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -37,7 +38,15 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
log.Info("hostname was blank")
|
log.Info("hostname was blank")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Info("Got URL msg length:", len(msg))
|
var packs *zoopb.Packages
|
||||||
|
packs = new(zoopb.Packages)
|
||||||
|
if err := packs.Unmarshal(msg); err != nil {
|
||||||
|
log.Info("proto.Unmarshal() failed on wire message len", len(msg), "from", hostname)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Info("Unmarshal worked with msg len", len(msg), "from", hostname)
|
||||||
|
log.Info(hostname, "has", packs.Len(), "packages installed")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue