Permalink
Browse files

update to latest protobuf

  • Loading branch information...
1 parent cd7b918 commit bb4b11f6e00afd69e1a998af2d5c33dd92b47b8f @mreiferson mreiferson committed Mar 1, 2013
Showing with 232 additions and 48 deletions.
  1. +8 −8 consensus/m.go
  2. +59 −8 consensus/m.pb.go
  3. +1 −1 consensus/manager_test.go
  4. +1 −1 server/Makefile
  5. +161 −28 server/msg.pb.go
  6. +2 −2 server/txn.go
View
@@ -1,14 +1,14 @@
package consensus
var (
- nop = newMsg_Cmd(msg_NOP)
- invite = newMsg_Cmd(msg_INVITE)
- rsvp = newMsg_Cmd(msg_RSVP)
- nominate = newMsg_Cmd(msg_NOMINATE)
- vote = newMsg_Cmd(msg_VOTE)
- tick = newMsg_Cmd(msg_TICK)
- propose = newMsg_Cmd(msg_PROPOSE)
- learn = newMsg_Cmd(msg_LEARN)
+ nop = msg_NOP.Enum()
+ invite = msg_INVITE.Enum()
+ rsvp = msg_RSVP.Enum()
+ nominate = msg_NOMINATE.Enum()
+ vote = msg_VOTE.Enum()
+ tick = msg_TICK.Enum()
+ propose = msg_PROPOSE.Enum()
+ learn = msg_LEARN.Enum()
)
const nmsg = 8
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -17,7 +17,7 @@ import (
// http://code.google.com/apis/protocolbuffers/docs/encoding.html#varints.
var invalidProtobuf = []byte{0x80}
-func mustMarshal(p interface{}) []byte {
+func mustMarshal(p proto.Message) []byte {
buf, err := proto.Marshal(p)
if err != nil {
panic(err)
View
@@ -6,5 +6,5 @@ msg.pb.go: msg.proto
|sed s/Response/response/g\
|sed s/Newrequest/newRequest/g\
|sed s/Newresponse/newResponse/g\
- |gofmt >$@
+ >$@
rm -rf _pb
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -38,7 +38,7 @@ const (
)
func (t *txn) run() {
- verb := proto.GetInt32((*int32)(t.req.Verb))
+ verb := int32(t.req.GetVerb())
if f, ok := ops[verb]; ok {
f(t)
} else {
@@ -167,7 +167,7 @@ func (t *txn) stat() {
return
}
- len, rev := g.Stat(proto.GetString(t.req.Path))
+ len, rev := g.Stat(t.req.GetPath())
t.resp.Len = &len
t.resp.Rev = &rev
t.respond()

0 comments on commit bb4b11f

Please sign in to comment.