add /sets/
This commit is contained in:
parent
cd545c7c9f
commit
bd0231ea63
22
http.go
22
http.go
|
@ -88,6 +88,28 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if strings.HasPrefix(route, "/sets/") {
|
||||||
|
pb := forgepb.NewSets()
|
||||||
|
if err := pb.Unmarshal(reqPB.ClientData); err != nil {
|
||||||
|
reqPB.Logf("Patches Unmarshal() len(data)=%d err=%v", len(reqPB.ClientData), err)
|
||||||
|
logReqPB(reqPB)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
reqPB.Logf("Patches Unmarshal() len=%d", pb.Len())
|
||||||
|
switch route {
|
||||||
|
case "/sets/get":
|
||||||
|
if err := me.forge.Patchsets.SendReply(w, reqPB); err != nil {
|
||||||
|
reqPB.Logf("Oh well, Send to client failed. err=%v", err)
|
||||||
|
} else {
|
||||||
|
reqPB.Logf("SendReply() worked")
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
// todo: logReq(reqPB)
|
||||||
|
logReqPB(reqPB)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if strings.HasPrefix(route, "/patches/") {
|
if strings.HasPrefix(route, "/patches/") {
|
||||||
pb := forgepb.NewPatches()
|
pb := forgepb.NewPatches()
|
||||||
if err := pb.Unmarshal(reqPB.ClientData); err == nil {
|
if err := pb.Unmarshal(reqPB.ClientData); err == nil {
|
||||||
|
|
Loading…
Reference in New Issue