1
0
Fork 0
mirror of git://git.psyced.org/git/psyced synced 2024-08-15 03:25:10 +00:00

thx tg.. is_localhost() was being used very inconsistently

This commit is contained in:
psyc://psyced.org/~lynX 2010-02-26 21:56:20 +01:00
parent 446a3006a8
commit dcbee7a64e
8 changed files with 10 additions and 9 deletions

View file

@ -426,7 +426,7 @@ msg(source, mc, data, vars) {
// and have it replaced by object.. but that's not the case
// we _could_ however do that by using _uniform_trustee
// and doing is_localhost on all _uniform's at parsing time
if (is_localhost(u[UHost])) trustee_nick = u[UNick];
if (is_localhost(lower_case(u[UHost]))) trustee_nick = u[UNick];
}
if (get_trust(trustee_nick, 0) < MINIMUM_TRUST) return 1;
// entweder trustee ist ein local nick, dann kriegen wir den

View file

@ -658,7 +658,7 @@ int xmpp_sendmsg(mixed target, string mc, mixed data, mapping vars,
if (o = targets[tmp]) {
P2(("%O to be delivered on %O\n",
otarget, o ))
} else if (is_localhost(u[UHost])) {
} else if (is_localhost(lower_case(u[UHost]))) {
unless (u[UUser]) {
P0(("Intercepted %O to %O from %O\n", mc, target, source))
// 0 makes sendmsg try to relay via xmpp.scheme.psyced.org

View file

@ -2525,7 +2525,7 @@ logon(host) {
&& mode[PPL_NOTIFY] >= PPL_NOTIFY_FRIEND) continue;
if (u = parse_uniform(ni)) {
// <lynX> first we change the ppl, then we need this code
// if (is_localhost(u[UHost])) {
// if (is_localhost(lower_case(u[UHost]))) {
// o = summon_person(u[UNick]);
// insert_member(o);
// } else {

View file

@ -411,6 +411,7 @@ int psyc_sendmsg(mixed target, string mc, mixed data, mapping vars,
unless (buf) return 0;
#endif /* NEW_RENDER */
// host seems to already be in lower_case
if (is_localhost(host)) return send_udp(host, port, buf);
PT(("dns_resolve + send_udp %O:%O packet:\n%s", host,port,buf))
dns_resolve(host, (: if (stringp($1))

View file

@ -983,8 +983,8 @@ protected int deliver(mixed ip, string host, string mc, string buffer, mapping c
cvars["_INTERNAL_nick_target"] = u[UNick];
#endif
P3(("DEBUG: is_localhost is %O for %O of %O\n",
is_localhost(u[UHost]), u[UHost], u))
unless (is_localhost(u[UHost])) {
is_localhost(lower_case(u[UHost])), u[UHost], u))
unless (is_localhost(lower_case(u[UHost]))) {
if (trustworthy > 7) {
P1(("RELAYING permitted for %O to %O (%O)\n",
source, t, ME))

View file

@ -107,7 +107,7 @@ parseUDP(ip, port, msg) {
send_udp(ip, port, reply);
return;
}
islocaltarget = is_localhost(tu[UHost]);
islocaltarget = is_localhost(lower_case(tu[UHost]));
// TODO this may be either local or remote users
if (islocaltarget && tu[UUser]) target = find_person(tu[UUser]);
// TODO works only for online users
@ -156,7 +156,7 @@ parseUDP(ip, port, msg) {
su = parse_uniform(source);
source = 0;
#if 0
if (is_localhost(su[UHost])) {
if (is_localhost(lower_case(su[UHost]))) {
object o;
o = find_person(su[UUser]);
// TODO: check that source is coming from

View file

@ -235,7 +235,7 @@ void circuit_msg(string mc, mapping vars, string data) {
if (tls_query_connection_state(ME) == 0) {
array(string) targethosts = ({ });
foreach(string ho : vars["_list_targets_hosts"]) {
if (is_localhost(ho)) {
if (is_localhost(lower_case(ho))) {
targethosts += ({ ho });
}
}

View file

@ -49,7 +49,7 @@ void dispatch(mixed header_vars, mixed varops, mixed method, mixed body) {
DISPATCHERROR("target is not an uniform\n")
}
// FIXME relaying support here?
if (!is_localhost(u[UHost])) {
if (!is_localhost(local_host(u[UHost]))) {
DISPATCHERROR("target is not configured on this server\n")
}
}