Ok, I give in... gotta do something for the WP users with

Brian Godette (bgodette@idcomm.com)
Tue, 14 Jul 1998 19:15:18 -0600


(yet another 30 minute hack from yours truely)

I wonder how much this would bother WP if I added it to ERef... it's the
bare minimum that's required for the TCP sequence in WP clients use to
communicate the conference selection box plus fix the IP address for WP
clients on multi-homed systems.

This also brings up another "bug" in the current Cornell 1.0 version... for
WP refs with no public conferences (which is what this code simulates),
Cornell 1.0 displays an empty conference selection box, WP clients simply
go on to the next state (close session).

---- snipit ----
for (x = 0; x < CONF_QUEUE; x++)
{
if (FD_ISSET(conf_stack[x].sock, &readfds))
{
if ((*msglen = recv(conf_stack[x].sock, pkt, MAXMSG, 0)) < 0)
{
if ((errno == ENOENT) || (errno == EINTR) ||
(errno == ENOTCONN) || (errno == ECONNABORTED) ||
(errno == ECONNRESET) || (errno == ENETUNREACH))
{
dolog("conf_stack %d broke connection (%s)\n",
x, my_sock_errlist(errno));
close(conf_stack[x].sock);
conf_stack[x].sock = 0;
conf_stack[x].state = 0;
continue;
}
my_perror("recvfrom error on conf_stack");
exit (1);
}
if (*msglen == 0)
{
dolog("conf_stack %d closed connection\n", x);
close(conf_stack[x].sock);
conf_stack[x].sock = 0;
conf_stack[x].state = 0;
continue;
}
memcpy(&tmp, pkt, 4);
conf_stack[x].state = ntohl(tmp);
switch(conf_stack[x].state)
{
case 2: /* hello */
memset(pkt, 0, 8);
*(pkt+3) = 4;
*(pkt+7) = 8;
send(conf_stack[x].sock, pkt, 8, 0);
break;
case 5: /* close session */
close(conf_stack[x].sock);
conf_stack[x].sock = 0;
conf_stack[x].state = 0;
break;
case 6: /* sendme conf list */
memset(pkt, 0, 8);
*(pkt+3) = 7;
*(pkt+7) = 8;
send(conf_stack[x].sock, pkt, 8, 0);
break;
default: /* everything else I don't care about */
break;
}
}
}
---- snipit ----