summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar John Kohl <jtkohl@mit.edu>1987-07-14 14:16:26 +0000
committerGravatar John Kohl <jtkohl@mit.edu>1987-07-14 14:16:26 +0000
commit5a1f311773c758de2391f9f69b342e7690e9574d (patch)
treeef7f1ffe82f3bc3f70e50539578f6022feafbc23
parent4074e819bcbce539cedb56bfc33b1da822b1eb19 (diff)
lint cleanup
-rw-r--r--server/hostm.c4
-rw-r--r--server/server.c32
-rw-r--r--server/subscr.c17
3 files changed, 26 insertions, 27 deletions
diff --git a/server/hostm.c b/server/hostm.c
index c01bc14..1a44d1f 100644
--- a/server/hostm.c
+++ b/server/hostm.c
@@ -107,7 +107,6 @@ struct sockaddr_in *who;
ZServerDesc_t *server;
{
ZServerDesc_t *owner;
- ZHostList_t *host;
char *opcode = notice->z_opcode;
Code_t retval;
@@ -486,9 +485,8 @@ ZServerDesc_t *server;
{
/* undo what we did in host_attach */
register ZHostList_t *hlist;
- register ZServerDesc_t *serv;
- if ((serv = hostm_find_server(addr)) != server) {
+ if (hostm_find_server(addr) != server) {
syslog(LOG_WARNING, "host_detach: wrong server");
return;
}
diff --git a/server/server.c b/server/server.c
index da25d0f..0dcfc27 100644
--- a/server/server.c
+++ b/server/server.c
@@ -28,7 +28,6 @@ static char rcsid_server_s_c[] = "$Header$";
*
* void server_init()
*
- *
* void server_shutdown()
*
* void server_timo(which)
@@ -83,7 +82,7 @@ int timo_up = TIMO_UP;
int timo_tardy = TIMO_TARDY;
int timo_dead = TIMO_DEAD;
-int srv_rexmit_secs = REXMIT_SECS;
+long srv_rexmit_secs = REXMIT_SECS;
/*
* Initialize the array of servers. The `limbo' server goes in the first
@@ -251,7 +250,7 @@ struct sockaddr_in *who;
if (notice->z_kind == SERVACK) {
srv_nack_cancel(notice, who);
- srv_responded(notice, who);
+ srv_responded(who);
return;
}
/* XXX set up a who for the real origin */
@@ -390,7 +389,7 @@ server_hello(which, auth)
ZServerDesc_t *which;
int auth;
{
- send_msg(&which->zs_addr, ADMIN_HELLO, 0);
+ send_msg(&which->zs_addr, ADMIN_HELLO, auth);
(which->zs_numsent)++;
return;
}
@@ -413,9 +412,9 @@ ZServerDesc_t *server;
zdbug((LOG_DEBUG, "ADMIN received"));
if (!strcmp(opcode, ADMIN_HELLO)) {
- hello_respond(who, ADJUST);
+ hello_respond(who, ADJUST, auth);
} else if (!strcmp(opcode, ADMIN_IMHERE)) {
- srv_responded(notice, who);
+ srv_responded(who);
} else if (!strcmp(opcode, ADMIN_SHUTDOWN)) {
zdbug((LOG_DEBUG, "server shutdown"));
/* we need to transfer all of its hosts to limbo */
@@ -449,6 +448,7 @@ ZServerDesc_t *server;
* previously unknown server
*/
+/*ARGSUSED*/
void
server_adispatch(notice, auth, who, server)
ZNotice_t *notice;
@@ -466,7 +466,7 @@ ZServerDesc_t *server;
syslog(LOG_INFO, "new server %s, %d",
inet_ntoa(who->sin_addr),
ntohs(who->sin_port));
- hello_respond(who, DONT_ADJUST);
+ hello_respond(who, DONT_ADJUST, auth);
}
return;
}
@@ -550,13 +550,14 @@ struct in_addr *addr;
*/
static void
-hello_respond(who, adj)
+hello_respond(who, adj, auth)
struct sockaddr_in *who;
int adj;
+int auth;
{
register ZServerDesc_t *which;
- send_msg(who, ADMIN_IMHERE, 0);
+ send_msg(who, ADMIN_IMHERE, auth);
if (adj != ADJUST)
return;
@@ -609,12 +610,10 @@ struct sockaddr_in *who;
* appropriately.
*/
static void
-srv_responded(notice, who)
-ZNotice_t *notice;
+srv_responded(who)
struct sockaddr_in *who;
{
register ZServerDesc_t *which = server_which_server(who);
- int retval;
if (!which) {
syslog(LOG_ERR, "hello input from non-server?!");
@@ -661,7 +660,7 @@ server_shutdown()
/* don't tell limbo to go away, start at 1*/
for (i = 1; i < nservers; i++) {
- send_msg(&otherservers[i].zs_addr, ADMIN_SHUTDOWN, 0);
+ send_msg(&otherservers[i].zs_addr, ADMIN_SHUTDOWN, 1);
}
return;
}
@@ -698,6 +697,9 @@ int auth;
packlen = sizeof(pack);
+ /* XXX for now, we don't do authentication */
+ auth = 0;
+
if ((retval = ZFormatNotice(pnotice, pack, packlen, &packlen, auth ? ZAUTH : ZNOAUTH)) != ZERR_NONE) {
syslog(LOG_WARNING, "snd_msg format: %s", error_message(retval));
return;
@@ -717,6 +719,7 @@ int auth;
/*
* Forward the notice to the other servers
*/
+/*ARGSUSED*/
void
server_forward(notice, auth, who)
ZNotice_t *notice;
@@ -809,8 +812,7 @@ struct sockaddr_in *who;
nacked != srv_nacklist;
nacked = nacked->q_forw)
if (&otherservers[nacked->na_srv_idx] == which)
- if (ZCompareUID((caddr_t) &nacked->na_uid,
- (caddr_t) &notice->z_uid)) {
+ if (ZCompareUID(&nacked->na_uid, &notice->z_uid)) {
timer_reset(nacked->na_timer);
xfree(nacked->na_packet);
xremque(nacked);
diff --git a/server/subscr.c b/server/subscr.c
index 0489343..4385a0e 100644
--- a/server/subscr.c
+++ b/server/subscr.c
@@ -49,6 +49,8 @@ static char rcsid_subscr_s_c[] = "$Header$";
* ZNotice_t *notice;
* struct sockaddr_in *who;
*
+ * void subscr_send_subs(client)
+ * ZClient_t *client;
*/
#include "zserver.h"
@@ -103,7 +105,7 @@ ZNotice_t *notice;
subs2 != who->zct_subs;
subs2 = subs2->q_forw) {
/* for each existing subscription */
- if (subscr_equiv(subs, subs2, notice)) /* duplicate? */
+ if (subscr_equiv(subs, subs2)) /* duplicate? */
goto duplicate;
}
@@ -168,7 +170,7 @@ ZNotice_t *notice;
subs2 != who->zct_subs;)
/* for each existing subscription */
/* is this what we are canceling? */
- if (subscr_equiv(subs4, subs2, notice)) {
+ if (subscr_equiv(subs4, subs2)) {
/* go back, since remque will change things */
subs3 = subs2->q_back;
xremque(subs2);
@@ -468,16 +470,15 @@ ZClient_t *client;
register int i = 0;
register ZSubscr_t *sub;
char buf[512], buf2[512], *lyst[7 * NUM_FIELDS];
- int retval;
int num = 1;
zdbug((LOG_DEBUG, "send_subs"));
- sprintf(buf2, "%d",ntohs(client->zct_sin.sin_port));
+ (void) sprintf(buf2, "%d",ntohs(client->zct_sin.sin_port));
lyst[0] = buf2;
- if ((retval = ZMakeAscii(buf, sizeof(buf), client->zct_cblock,
- sizeof(C_Block))) != ZERR_NONE)
+ if (ZMakeAscii(buf, sizeof(buf), client->zct_cblock,
+ sizeof(C_Block)) != ZERR_NONE)
lyst[++num] = buf;
bdump_send_list_tcp(SERVACK, bdump_sin.sin_port, ZEPHYR_ADMIN_CLASS,
@@ -543,7 +544,6 @@ register ZClient_t *client;
ZAcl_t *acl;
{
register ZSubscr_t *subs;
- char *reresult;
if (client->zct_subs == NULLZST) {
syslog(LOG_WARNING, "cl_match w/ no subs");
@@ -616,9 +616,8 @@ register ZSubscr_t *subs;
*/
static int
-subscr_equiv(s1, s2, notice)
+subscr_equiv(s1, s2)
register ZSubscr_t *s1, *s2;
-register ZNotice_t *notice;
{
if (strcmp(s1->zst_class,s2->zst_class))
return(0);