[1578] in Moira
client fix
daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Thu Jun 8 21:03:58 2000
Message-Id: <200006090103.VAA22107@sweet-transvestite.mit.edu>
To: moiradev@MIT.EDU
Date: Thu, 08 Jun 2000 21:03:53 -0400
From: Garry Zacheiss <zacheiss@MIT.EDU>
The curses client has code in it to reconnect you if you've been
idle for too long and moirad punts your connection. Unfortunately, it
doesn't do an mr_version(), so you get version 2 of all the queries and
lose horribly. This fixes it so we use mrcl_connect to connect to the
db, and moves the version number of the queries we're asking for into
defs.h so it will always be consistant between the two mrcl_connect
calls.
Garry
Index: defs.h
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/moira/defs.h,v
retrieving revision 1.16
diff -c -r1.16 defs.h
*** defs.h 1998/03/10 21:09:34 1.16
--- defs.h 2000/06/09 01:01:20
***************
*** 48,53 ****
--- 48,57 ----
#define WILDCARD ('*')
+ /* What version of the queries are we asking for? */
+
+ #define QUERY_VERSION 3
+
/* This is unimplemented in the menu stuff, but would be nice. */
#define FORMFEED Put_message(" ")
Index: main.c
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/moira/main.c,v
retrieving revision 1.39
diff -c -r1.39 main.c
*** main.c 2000/04/19 23:15:35 1.39
--- main.c 2000/06/09 01:01:56
***************
*** 106,112 ****
}
}
! if (mrcl_connect(moira_server, program_name, 3, 0) != MRCL_SUCCESS)
exit(1);
if ((status = mr_auth(program_name)))
--- 106,113 ----
}
}
! if (mrcl_connect(moira_server, program_name, QUERY_VERSION, 0)
! != MRCL_SUCCESS)
exit(1);
if ((status = mr_auth(program_name)))
Index: utils.c
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/moira/utils.c,v
retrieving revision 1.48
diff -c -r1.48 utils.c
*** utils.c 2000/04/12 06:02:29 1.48
--- utils.c 2000/06/09 01:01:39
***************
*** 14,19 ****
--- 14,20 ----
#include <mit-copyright.h>
#include <moira.h>
+ #include <mrclient.h>
#include <moira_site.h>
#include "defs.h"
#include "f_defs.h"
***************
*** 882,889 ****
status = mr_query(name, argc, argv, proc, hint);
if (status != MR_ABORTED && status != MR_NOT_CONNECTED)
return status;
! status = mr_connect(moira_server);
! if (status)
{
com_err(whoami, status, " while re-connecting to server %s",
moira_server);
--- 883,890 ----
status = mr_query(name, argc, argv, proc, hint);
if (status != MR_ABORTED && status != MR_NOT_CONNECTED)
return status;
! status = mrcl_connect(moira_server, whoami, QUERY_VERSION, 0);
! if (status != MRCL_SUCCESS)
{
com_err(whoami, status, " while re-connecting to server %s",
moira_server);