if (n == 0) { /* handle signal */
/* 0 return from bnet_recv() => network signal */
switch (bs->msglen) {
- case BNET_EOD: /* end of data */
+ case BNET_NONO: /* for compatibility */
+ case BNET_EOD: /* end of data */
return 0;
case BNET_EOD_POLL:
- bnet_fsend(bs, OK_msg); /* send response */
- return 0; /* end of data */
+ bnet_fsend(bs, OK_msg);/* send response */
+ return 0; /* end of data */
case BNET_TERMINATE:
bs->terminated = 1;
return 0;
case BNET_POLL:
- bnet_fsend(bs, OK_msg); /* send response */
+ bnet_fsend(bs, OK_msg); /* send response */
break;
case BNET_HEARTBEAT:
bnet_sig(bs, BNET_HB_RESPONSE);
{
static char buf[30];
switch (bs->msglen) {
+ case BNET_NONO: /* for compatibility */
case BNET_EOD:
- return "BNET_EOD";
+ return "BNET_EOD"; /* end of data stream */
case BNET_EOD_POLL:
return "BNET_EOD_POLL";
case BNET_STATUS:
return "BNET_STATUS";
case BNET_TERMINATE:
- return "BNET_TERMINATE";
+ return "BNET_TERMINATE"; /* terminate connection */
case BNET_POLL:
return "BNET_POLL";
case BNET_HEARTBEAT:
} BSOCK;
/* Signal definitions for use in bnet_sig() */
+#define BNET_NONO 0 /* DO NOT USE, remains for compatibility */
#define BNET_EOD -1 /* End of data stream, new data may follow */
#define BNET_EOD_POLL -2 /* End of data and poll all in one */
#define BNET_STATUS -3 /* Send full status */