| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Perl on_handshake(): @me |
Hey Paul, if your editor supports comment linking, here's the start of an interesting exchange of messages regarding Perl hooks.
If it does not, you have the date and time, it started, below. Maybe that can help you find the chain, 140 messages ago.
Oli -> All wrote 2021-09-08 12:37:
O> HELP! ;)
O> I'm trying to use the @me array in on_handshake(), but no matter what I
O> do I always get the error:
O> "Perl on_handshake(): @me contains no valid addresses"
O> even with this simple sub:
O> sub on_handshake
O> {
O> @me;
O> }
O> + 08 Sep 09:45:26 [51014] incoming session with unknown
O> - 08 Sep 09:45:27 [51014] VER binkd/1.1a-112/Linux binkp/1.1
O> + 08 Sep 09:45:27 [51014] addr: 4000:1/1@testnet
O> + 08 Sep 09:45:27 [51014] Perl on_handshake(): @me contains no valid
O> addresses
O> - 08 Sep 09:45:27 [51014] hiding aka 2000:1/2@fakenet
O> Is this a bug or how do I use @me? The perlhooks documentation says
O> 5) on_handshake()
O> - for server called after receiving remote addresses (before addr is sent)
O> - best for hide_aka and present_aka logic :-)
O> - return non-empty string to abort session with that reason
O> otherwise, if @me is defined present @me as our akas
O> The error message is from perlhooks.c
O> if ((me = perl_get_av("me", FALSE)) != NULL) {
O> FTN_ADDR addr;
O> int n = 0, N = av_len(me) + 1;
O> if (N > 0) state->pAddr = xalloc(N*sizeof(FTN_ADDR));
O> for (i = 0; i < N; i++) {
O> svp = av_fetch(me, i, FALSE);
O> if (svp == NULL) continue;
O> if (!parse_ftnaddress(SvPV(*svp, len), &addr, cfg->pDomains.first))
O> continue;
O> exp_ftnaddress(&addr, cfg->pAddr, cfg->nAddr, cfg->pDomains.first);
state->> pAddr[n++] = addr;
O> }
state->> nAddr = n;
O> if (n == 0) Log(LL_WARN, "Perl on_handshake(): @me contains no valid
O> addresses");
O> }
O> ---
--
..
--- Mozilla/5.0 (Windows; U; Windows NT 5.1; sv-SE; rv:1.9.1.16) Gecko/20101125
O> * Origin: 1995| Invention of the Cookie. The End. (2:280/464.47)* Origin: news://eljaco.se (2:203/2) |
|
| SOURCE: echomail via QWK@pharcyde.org | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.