]> Cypherpunks repositories - gostls13.git/commitdiff
rpc: fix bug that caused private methods to attempt to be registered.
authorRob Pike <r@golang.org>
Sun, 29 Aug 2010 22:03:06 +0000 (08:03 +1000)
committerRob Pike <r@golang.org>
Sun, 29 Aug 2010 22:03:06 +0000 (08:03 +1000)
Fixes #1056.

R=golang-dev, adg1
CC=golang-dev
https://golang.org/cl/2033043

src/pkg/rpc/server.go

index d14f6ded2cfdd8f0a0cf6473f86e29e094702adf..91b88e23de8ef9fe83c52dc04cf3474ff798186d 100644 (file)
@@ -211,7 +211,7 @@ func (server *serverType) register(rcvr interface{}) os.Error {
                method := s.typ.Method(m)
                mtype := method.Type
                mname := method.Name
-               if mtype.PkgPath() != "" && !isPublic(mname) {
+               if mtype.PkgPath() != "" || !isPublic(mname) {
                        continue
                }
                // Method needs three ins: receiver, *args, *reply.