2 /* qu2bb_send.c - manager for qu --> bb */
4 /* qu2po_send.c - manager for qu --> po */
16 extern char *supportaddr;
18 struct rp_construct rp_hend = { /* end of host list */
20 'e', 'n', 'd', ' ', 'o', 'f', ' ', 'h', 'o', 's', 't', ' ',
21 'i', 'g', 'n', 'o', 'r', 'e', 'd',
25 struct rp_construct rp_aend = { /* end of address list */
28 'b', 'b', 'o', 'a', 'r', 'd', 's', ' ', 'e', 'n', 'd', ' ',
30 'p', 'o', 'p', ' ', 'e', 'n', 'd', ' ',
32 'o', 'f', ' ', 'a', 'd', 'd', 'r', ' ', 'l', 'i', 's', 't',
36 struct rp_construct rp_badr = { /* no such bboard */
38 'u', 'n', 'k', 'n', 'o', 'w', 'n', ' ',
40 'b', 'b', 'o', 'a', 'r', 'd',
42 'p', 'o', 'p', ' ', 's', 'u', 'b', 's', 'c', 'r', 'i', 'b', 'e', 'r',
47 struct rp_construct rp_err = { /* error, retry later */
49 'u', 'n', 'k', 'n', 'o', 'w', 'n', ' ', 'e', 'r', 'r', 'o', 'r',
63 ll_log (logptr, LLOGBTR, "qu2bb_send()");
66 if (rp_isbad (result = qu_pkinit ()))
68 if (rp_isbad (result = bb_sbinit ()))
71 while (rp_gval ((result =
72 qu_rinit (info, sender, chanptr -> ch_apout))) == RP_OK) {
74 ll_log (logptr, LLOGGEN, "info=%s sender=%s", info, sender);
76 if (rp_isbad (result = bb_winit (info, sender)))
78 if (rp_isbad (result = qu2bb_each (sender)))
84 if (rp_gval (result) != RP_DONE) {
85 ll_log (logptr, LLOGTMP, "not DONE [%s]", rp_valstr (result));
106 ll_log (logptr, LLOGBTR, "qu2bb_each(sender='%s')", sender);
109 FOREVER { /* loop through the addresses */
110 if (rp_isbad (result = qu_radr (host, adr)))
113 if (rp_gval (result) == RP_HOK) {/* no-op the sub-list indication */
114 qu_wrply ((struct rp_bufstruct *) &rp_hend, rp_conlen (rp_hend));
118 if (rp_gval (result) == RP_DONE) {
119 qu_wrply ((RP_Buf *) &rp_aend, rp_conlen (rp_aend));
123 switch (replyval.rp_val = bb_wtadr (host, adr)) {
126 switch (replyval.rp_val = bb_txtcpy ()) {
128 replyval.rp_line[0] = NULL;
131 ll_log (logptr, LLOGFAT, "unknown error [%s]",
132 rp_valstr (replyval.rp_val));
133 blt (&rp_err, (char *) &replyval, sizeof rp_err);
140 ll_log (logptr, LLOGFAT, "unknown bboard '%s'", adr);
142 ll_log (logptr, LLOGFAT, "unknown pop subscriber '%s'", adr);
144 blt (&rp_badr, (char *) &replyval, sizeof rp_badr);
148 ll_log (logptr, LLOGFAT, "unknown error [%s]",
149 rp_valstr (replyval.rp_val));
150 blt (&rp_err, (char *) &replyval, sizeof rp_err);
155 (sizeof replyval.rp_val) + strlen (replyval.rp_line));