runtimes/google/ipc: trap all reserved names (starting with __).

The existing behaviour was to trap names that match __<prefix>
and send those to the registered dispatcher. This change traps
any name that starts with __ and hence prevents anyone from
accidentally using a name that starts with __.

Change-Id: I9e2abb6881709418e15f8129e0ab346e056c4671
diff --git a/runtimes/google/ipc/server.go b/runtimes/google/ipc/server.go
index 943a71b..ae9a0b5 100644
--- a/runtimes/google/ipc/server.go
+++ b/runtimes/google/ipc/server.go
@@ -909,17 +909,19 @@
 // with ipc.DebugKeyword, we use the internal debug dispatcher to look up the
 // invoker. Otherwise, and we use the server's dispatcher. The (stripped) name
 // and dispatch suffix are also returned.
-// TODO(cnicolaou): change this back returning in ipc.Invoker in the pt2 CL.
 func (fs *flowServer) lookup(name, method string) (ipc.Invoker, security.Authorizer, string, verror.E) {
 	name = strings.TrimLeft(name, "/")
 	if method == "Glob" && len(name) == 0 {
-		return ipc.ReflectInvoker(&globInvoker{fs.reservedOpt.Prefix, fs}), &acceptAllAuthorizer{}, name, nil
+		return ipc.ReflectInvoker(&globInvoker{naming.ReservedNamePrefix, fs}), &acceptAllAuthorizer{}, name, nil
 	}
 	disp := fs.disp
-	prefix := fs.reservedOpt.Prefix
-	if len(prefix) > 0 && (name == prefix || strings.HasPrefix(name, prefix+"/")) {
-		name = strings.TrimPrefix(name, prefix)
-		name = strings.TrimLeft(name, "/")
+	if strings.HasPrefix(name, naming.ReservedNamePrefix) {
+		parts := strings.SplitN(name, "/", 2)
+		if len(parts) > 1 {
+			name = parts[1]
+		} else {
+			name = ""
+		}
 		disp = fs.reservedOpt.Dispatcher
 	}