Send correct hub counts.
authorfredrik <fredrik@959494ce-11ee-0310-bf91-de5d638817bd>
Sun, 6 Nov 2005 01:48:03 +0000 (01:48 +0000)
committerfredrik <fredrik@959494ce-11ee-0310-bf91-de5d638817bd>
Sun, 6 Nov 2005 01:48:03 +0000 (01:48 +0000)
git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@483 959494ce-11ee-0310-bf91-de5d638817bd

daemon/fnet-dc.c

index 110c1e9..d295148 100644 (file)
@@ -729,23 +729,30 @@ static void sendmyinfo(struct socket *sk, struct fnetnode *fn)
     struct dchub *hub;
     char *buf;
     struct fnetnode *cfn;
-    int numhubs;
+    int hn1, hn2, hn3;
     
     hub = fn->data;
     qstrf(sk, "$MyINFO $ALL %s ", hub->nativenick);
     buf = tr(icswcstombs(confgetstr("dc", "desc"), DCCHARSET, "Charset_conv_failure"), "$_|_");
     qstrf(sk, "%s", buf);
-    numhubs = 0;
+    hn1 = hn2 = hn3 = 0;
     for(cfn = fnetnodes; cfn != NULL; cfn = cfn->next)
     {
        if((cfn->state == FNN_EST) || (cfn->state == FNN_HS))
-           numhubs++;
+       {
+           if(cfn->regstatus == FNNS_OP)
+               hn3++;
+           else if(cfn->regstatus == FNNS_REG)
+               hn2++;
+           else
+               hn1++;
+       }
     }
-    qstrf(sk, "<%s V:%s,M:%c,H:%i/0/0,S:%i>",
+    qstrf(sk, "<%s V:%s,M:%c,H:%i/%i/%i,S:%i>",
          DCIDTAG,
          DCIDTAGV,
          (tcpsock == NULL)?'P':'A',
-         numhubs,
+         hn1, hn2, hn3,
          confgetint("transfer", "slots")
          );
     qstrf(sk, "$ $");