summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2010-08-18 14:23:02 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-08-18 13:00:23 -0700
commitf51252fa0d89556542fdfd190e8a94b28b013c36 (patch)
tree43ac09fe154daeefcf9de45be6e79a5d0a1e9a85 /rpc
parent03df0871493d111116f168ec5331bffe99f6470f (diff)
rpcsvc: check for listener on default port used by mgmt (6969) while registering programs.v3.1.0prealpha3
- If programs have not provided a default port, rpcsvc tries to allocate a listener bound to default port. While registering programs, if programs have not given any port information, programs will be associated with either default listener or the one provided in options provided during rpcsvc_init, with latter given more precedence. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 875 (Implement a new protocol to provide proper backward/forward compatibility) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=875
Diffstat (limited to 'rpc')
-rw-r--r--rpc/rpc-lib/src/rpcsvc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c
index e12403e20..c4c9fcaa2 100644
--- a/rpc/rpc-lib/src/rpcsvc.c
+++ b/rpc/rpc-lib/src/rpcsvc.c
@@ -1704,6 +1704,10 @@ rpcsvc_program_register (rpcsvc_t *svc, rpcsvc_program_t program)
}
listener = rpcsvc_get_listener (svc, listen_port, NULL);
+ if ((listener == NULL) && (listen_port == RPCSVC_DEFAULT_LISTEN_PORT)) {
+ listener = rpcsvc_get_listener (svc, 6969, NULL);
+ }
+
if ((listener == NULL) || (listener->trans == NULL)) {
if ((listener != NULL) && (listener->trans == NULL)) {
gf_log (GF_RPCSVC, GF_LOG_DEBUG,
@@ -1741,6 +1745,7 @@ rpcsvc_program_register (rpcsvc_t *svc, rpcsvc_program_t program)
listener = rpcsvc_create_listener (svc, program.options,
program.progname);
if (listener == NULL) {
+ ret = -1;
gf_log (GF_RPCSVC, GF_LOG_DEBUG,
"creation of listener for program (%s) failed",
program.progname);