summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar John Kohl <jtkohl@mit.edu>1989-05-04 13:36:06 +0000
committerGravatar John Kohl <jtkohl@mit.edu>1989-05-04 13:36:06 +0000
commita07a0e92d3401005ce925552cb7cee31accf804f (patch)
tree7e59b522074a82157f5c213d557895394b44fa92
parente14e41e6e33a3c21382d79b572dd8ce985f8657a (diff)
add support for subscriptions without defaults
-rw-r--r--server/bdump.c3
-rw-r--r--server/client.c11
-rw-r--r--server/dispatch.c7
3 files changed, 14 insertions, 7 deletions
diff --git a/server/bdump.c b/server/bdump.c
index 1dee822..86533a0 100644
--- a/server/bdump.c
+++ b/server/bdump.c
@@ -840,7 +840,8 @@ ZServerDesc_t *server;
if ((retval = client_register(&notice,
&current_who,
&client,
- server)) != ZERR_NONE) {
+ server,
+ 0)) != ZERR_NONE) {
syslog(LOG_ERR,"brl register failed: %s",
error_message(retval));
return(retval);
diff --git a/server/client.c b/server/client.c
index e98985c..3409f28 100644
--- a/server/client.c
+++ b/server/client.c
@@ -22,11 +22,12 @@ static char rcsid_client_c[] = "$Header$";
/*
* External functions:
*
- * Code_t client_register(notice, who, client, server)
+ * Code_t client_register(notice, who, client, server, wantdefaults)
* ZNotice_t *notice;
* struct sockaddr_in *who;
* ZClient_t **client; (RETURN)
* ZServerDesc_t *server;
+ * int wantdefaults;
*
* Code_t client_deregister(client, host, flush)
* ZClient_t *client;
@@ -57,11 +58,12 @@ static void clt_free();
*/
Code_t
-client_register(notice, who, client, server)
+client_register(notice, who, client, server, wantdefaults)
ZNotice_t *notice;
struct sockaddr_in *who;
register ZClient_t **client; /* RETURN */
ZServerDesc_t *server;
+int wantdefaults;
{
register ZHostList_t *hlp = server->zs_hosts;
register ZHostList_t *hlp2;
@@ -113,9 +115,10 @@ ZServerDesc_t *server;
xinsque(clist, hlp2->zh_clients);
(void) sigsetmask(omask);
- if (!server->zs_dumping)
+ if (!server->zs_dumping || wantdefaults)
/* add default subscriptions only if this is not
- resulting from a brain dump */
+ resulting from a brain dump, or this request
+ wants defaults */
return(subscr_def_subs(*client));
else
return(ZERR_NONE);
diff --git a/server/dispatch.c b/server/dispatch.c
index 3216370..1e86595 100644
--- a/server/dispatch.c
+++ b/server/dispatch.c
@@ -709,6 +709,7 @@ ZServerDesc_t *server;
ZClient_t *client;
ZHostList_t *host;
Code_t retval;
+ int wantdefs;
/*
* ZEPHYR_CTL Opcodes expected are:
@@ -749,13 +750,15 @@ ZServerDesc_t *server;
if (host && host->zh_locked)
return(ZSRV_REQUEUE);
- if (!strcmp(opcode, CLIENT_SUBSCRIBE)) {
+ wantdefs = strcmp(opcode, CLIENT_SUBSCRIBE_NODEFS);
+ if (!wantdefs || !strcmp(opcode, CLIENT_SUBSCRIBE)) {
/* subscription notice */
if (!(client = client_which_client(who, notice))) {
if ((retval = client_register(notice,
who,
&client,
- server)) != ZERR_NONE)
+ server,
+ wantdefs)) != ZERR_NONE)
{
syslog(LOG_WARNING,
"subscr. register failed: %s",