death the query_server_unl()

This commit is contained in:
psyc://psyced.org/~lynX 2009-01-29 17:31:32 +01:00
parent 14c65f90a8
commit 821fb55b20
23 changed files with 54 additions and 62 deletions

View File

@ -145,7 +145,7 @@ void pushback(string failmc) {
"_nick": vars["_nick_target"],
"_source": t[4],
"_host": host,
"_source_origin": query_server_unl(),
"_source_origin": SERVER_UNIFORM,
"_INTERNAL_origin" : ME,
// so that tag-operated queues can be rolled back
"_tag_reply" : t[3]["_tag"],

View File

@ -16,10 +16,6 @@ Find more information at " URL_DOC
virtual inherit NET_PATH "output";
#ifndef SERVER_UNL
# define SERVER_UNL query_server_unl()
#endif
volatile object psycer;
volatile string joe, joe_nick;
volatile mixed joe_unl;
@ -81,7 +77,7 @@ static help() {
#endif
#ifdef WEBMASTER_EMAIL
reply("This gateway is operated by " WEBMASTER_EMAIL);
// " on "+ SERVER_UNL);
// " on "+ SERVER_UNIFORM);
#endif
reply("My PSYC Identification is "+ psyc_name(ME));
// reply("Can you imagine this is the new version of the first ever IRC bot written in LPC?");
@ -103,7 +99,7 @@ static tell(a) {
} else {
reply("Usage: T(ELL) or MSG <psycer> <textmessage>");
reply("Usage: T(ALK) or QUERY <psycer>");
reply("<psycer> may either be a nickname on "+ SERVER_UNL +
reply("<psycer> may either be a nickname on "+ SERVER_UNIFORM +
" or a uniform network identification anywhere"
" in PSYCspace.");
}
@ -111,7 +107,7 @@ static tell(a) {
}
unless (is_formal(p = whom)) {
p = summon_person(whom);
if (!p) return reply(whom+" ain't here on "+ SERVER_UNL);
if (!p) return reply(whom+" ain't here on "+ SERVER_UNIFORM);
}
if (text) {
reply("You tell "+ UNIFORM(p) +": "+text);
@ -140,7 +136,7 @@ static who() {
mixed idle;
string desc;
reply("--- /who of local users of "+ SERVER_UNL);
reply("--- /who of local users of "+ SERVER_UNIFORM);
u = objects_people();
all = sizeof(u) < 23;
// same code in usercmd.i

View File

@ -119,7 +119,7 @@ htget(prot, query, headers, qs) {
// note: the immediateness is not really used these days
write("<div class='each'><a href='");
unless(is_formal(key)) {
write(query_server_unl() + "@" + key);
write(SERVER_UNIFORM + "@" + key);
} else {
write(key);
}

View File

@ -130,7 +130,7 @@
#ifdef _uniform_node
# define SERVER_UNIFORM _uniform_node
#else
# define SERVER_UNIFORM query_server_unl()
# define SERVER_UNIFORM query_server_uniform()
#endif
#ifdef MUD

View File

@ -29,7 +29,7 @@
#ifdef ALIASES
# define DEALIAS(to, from) { string t;\
to = raliases[t = lower_case(from)]\
|| (aliases[t] ? query_server_unl() +"~"+ from : from);\
|| (aliases[t] ? SERVER_UNIFORM +"~"+ from : from);\
}
#endif

View File

@ -30,7 +30,7 @@ string make_json(mixed d);
void monitor_report(string mc, string text);
array(object) objects_people();
varargs string psyc_name(mixed source, vastring localpart);
string query_server_unl();
string query_server_uniform();
varargs mixed sendmsg(mixed target, string mc, mixed data, mapping vars,
mixed source, int showingLog, closure callback, varargs array(mixed) extra);
varargs void shout(mixed who, string what, string text, mapping vars);
@ -55,7 +55,7 @@ string _psyc_make_json(mixed d);
void _psyc_monitor_report(string mc, string text);
object* _psyc_objects_people();
varargs string _psyc_psyc_name(mixed source, vastring localpart);
string _psyc_query_server_unl();
string _psyc_query_server_uniform();
varargs mixed _psyc_sendmsg(mixed target, string mc, mixed data, mapping vars,
mixed source, int showingLog, closure callback, varargs array(mixed) extra);
varargs void _psyc_shout(mixed who, string what, string text, mapping vars);

View File

@ -47,7 +47,7 @@ version(text, target, req, srcnick, source) {
"[_nick] requests your version.",
([ "_nick" : srcnick ]), source );
#ifndef _flag_disable_request_version_IRC
} else if (target == query_server_unl()) {
} else if (target == SERVER_UNIFORM) {
if (text) vSet("agent", text);
#endif
} else {

View File

@ -48,12 +48,8 @@ inherit IRC_PATH "decode";
// message queueing and automatic reconnect mgmt
inherit NET_PATH "circuit";
#ifndef _uniform_node
# define _uniform_node query_server_unl()
#endif
#ifdef RELAY
# define IRCER_UNIFORM(NICK) (_uniform_node +"~"+ NICK)
# define IRCER_UNIFORM(NICK) (SERVER_UNIFORM +"~"+ NICK)
#else
// will upgrade to irc: syntax..
# define IRCER_UNIFORM(NICK) (MYLOWERNICK +":"+ NICK)

View File

@ -360,7 +360,7 @@ w(string mc, string data, mapping vars, mixed source) {
// give away your own nickname. i think that is unnecessary geek pride.
// so be it!
vars["_nick_me"] = aliases[MYLOWERNICK]
? query_server_unl() +"~"+ MYNICK
? SERVER_UNIFORM +"~"+ MYNICK
: MYNICK;
#else
vars["_nick_me"] = MYNICK;
@ -379,7 +379,7 @@ w(string mc, string data, mapping vars, mixed source) {
// source == 0 msgs.
// those might be simple w()s... hm.
#ifndef UNSAFE_LASTLOG
|| abbrev(query_server_unl() +"~", source)
|| abbrev(SERVER_UNIFORM +"~", source)
#endif
) {
#ifdef GHOST //{{{
@ -665,10 +665,10 @@ w(string mc, string data, mapping vars, mixed source) {
// psyctext ist an dieser stelle in der tat ohne vorteil
// aber auch kein performancefaktor.. also egal
emit(":"+ vars["_alias"] +" NICK "+
query_server_unl() +"~"+ vars["_alias"] + "\n");
SERVER_UNIFORM +"~"+ vars["_alias"] + "\n");
emit(psyctext(":[_nick_old] NICK [_nick_new]",
([ "_nick_old" : aliases[lower_case(vars["_address"])]
? query_server_unl() +"~"+
? SERVER_UNIFORM +"~"+
vars["_address"]
: uniform2irc(vars["_address"]),
"_nick_new" : vars["_alias"] ])) + "\n");
@ -677,11 +677,11 @@ w(string mc, string data, mapping vars, mixed source) {
emit(psyctext(":[_nick_old] NICK [_nick_new]",
([ "_nick_old" : vars["_alias"],
"_nick_new" : aliases[lower_case(vars["_address"])]
? query_server_unl() +"~"+ vars["_address"]
? SERVER_UNIFORM +"~"+ vars["_address"]
: uniform2irc(vars["_address"])
])) + "\n");
emit(psyctext(":[_nick_old] NICK [_nick_new]",
([ "_nick_old" : query_server_unl() +"~"+ vars["_alias"],
([ "_nick_old" : SERVER_UNIFORM +"~"+ vars["_alias"],
"_nick_new" : vars["_alias"] ])) + "\n");
break;
#endif
@ -890,7 +890,7 @@ logon() {
// version strings, only IRC makes it terribly complicated and
// even political. oh of course, that's because on irc the server
// admin isn't necessarily a person of your trusting.
w("_request_version", 0, 0, query_server_unl());
w("_request_version", 0, 0, SERVER_UNIFORM);
# endif
#endif
return rc;

View File

@ -332,7 +332,7 @@ int msg(string source, string mc, string data,
// and adjust rendered[i] accordingly
if (rendered[i] == clashnick) {
// this only happens with local users
rendered[i] = query_server_unl() +"~"+ clashnick;
rendered[i] = SERVER_UNIFORM +"~"+ clashnick;
}
render("_status_place_members_each", "", ([
"_INTERNAL_target_jabber": vars["_INTERNAL_target_jabber"],
@ -452,7 +452,7 @@ int msg(string source, string mc, string data,
// and adjust rendered[i] accordingly
if (rendered[i] == vars["_nick"]) {
// this only happens with local users
rendered[i] = query_server_unl() +"~"+ rendered[i];
rendered[i] = SERVER_UNIFORM +"~"+ rendered[i];
}
render("_notice_place_enter", "",
([ "_INTERNAL_target_jabber": vars["_INTERNAL_target_jabber"],

View File

@ -99,7 +99,7 @@ msg(source, mc, data, mapping vars, showingLog) {
#if 0
if (rendered[i] == vars["_nick"]) {
// this only happens with local users
rendered[i] = query_server_unl() +"~"+ rendered[i];
rendered[i] = SERVER_UNIFORM +"~"+ rendered[i];
}
#endif
packet += psyctext(template, ([

View File

@ -55,7 +55,7 @@ varargs int register_target(string uniform, vaobject handler, vaint shy) {
raise_error("register_target without uniform\n");
#endif
#if 0
if (query_server_unl() == uniform)
if (SERVER_UNIFORM == uniform)
raise_error("register_target for root!?\n");
#endif
if (targets[uniform]) {
@ -84,8 +84,8 @@ object find_target_handler(string target) { return targets[target]; }
// LOCALHOST STUFF
string query_server_unl() { return myUNL; } // proto.h!
string query_server_unl_ip() { return myUNLIP; }
string query_server_uniform() { return myUNL; } // proto.h!
string query_server_uniform_ip() { return myUNLIP; }
string my_lower_case_host() { return myLowerCaseHost; }
static varargs void ready_freddie(vamixed ip) {
@ -273,7 +273,7 @@ static void create() {
// //call_out(#'psyc_sendmsg, 1, PSYC_SYNCHRONIZE, "_request_synchronize",
// call_out(#'sendmsg, 1, PSYC_SYNCHRONIZE, "_request_synchronize",
// "I'm up and ready for some hot sync action!", ([ ]),
// query_server_unl()); //, parse_uniform(PSYC_SYNCHRONIZE));
// SERVER_UNIFORM); //, parse_uniform(PSYC_SYNCHRONIZE));
//# echo PSYC_SYNCHRONIZE activated.
//#endif
}

View File

@ -14,7 +14,7 @@ void monitor_report(string mc, string text) {
log_file("MONITOR", mc +"\t"+ text +"\n");
#ifndef __PIKE__ // TPD
unless (monitor) monitor = load_object(PLACE_PATH "monitor");
if (monitor) monitor->msg(previous_object() || query_server_unl(),
if (monitor) monitor->msg(previous_object() || SERVER_UNIFORM,
mc, text, ([]));
#endif
}

View File

@ -136,7 +136,7 @@ int greet() {
#ifdef FORK // {{{
emit(S_GLYPH_PACKET_DELIMITER "\n");
emit("\
=_source "+ query_server_unl() +"\n\
=_source "+ SERVER_UNIFORM +"\n\
=_target_peer psyc://"+ peeraddr +"/\n\
=_available_characters UTF-8\n\
=_available_protocols " PROTS "\n\
@ -157,7 +157,7 @@ Available protocols: [_available_protocols].\n" S_GLYPH_PACKET_DELIMITER "\n");
// other side tells us her name
emit(S_GLYPH_PACKET_DELIMITER "\n");
emit("\
:_source "+ query_server_unl() +"\n\
:_source "+ SERVER_UNIFORM +"\n\
:_target_peer psyc://"+ peeraddr +"/\n"
"\n\
:_implementation "+ SERVER_VERSION +" "+ DRIVER_VERSION +" "+ OSTYPE +" "+ MACHTYPE +"\n\
@ -167,7 +167,7 @@ Hello [_target_peer].\n\
Circuit to [_source] running [_implementation] established.\n" S_GLYPH_PACKET_DELIMITER "\n");
// ;ISO-8859-1;ISO-8859-15\n
emit("\
:_source "+ query_server_unl() +"\n\
:_source "+ SERVER_UNIFORM +"\n\
\n\
:_available_hashes "
#if __EFUN_DEFINED__(sha1)
@ -314,12 +314,12 @@ int logon(int neverfails) {
#ifdef FORK // {{{
// init the out-state. these will be sent by greet()
_o = ([
"_source" : query_server_unl(),
"_source" : SERVER_UNIFORM,
"_target" : "psyc:"+ peeraddr +"/",
]);
memory = copy(_o);
#if 0
memory = ([ "_source" : query_server_unl(); 4,
memory = ([ "_source" : SERVER_UNIFORM; 4,
"_target" : "psyc:" + peeraddr +"/"; 4,
]);
#endif

View File

@ -80,7 +80,7 @@ varargs int rootMsg(mixed source, string mc, string data,
croak("_request_compression",
"Requesting compression using [_method]",
([ "_method" : "zlib" ]),
query_server_unl());
SERVER_UNIFORM);
return;
}
#endif
@ -89,14 +89,14 @@ varargs int rootMsg(mixed source, string mc, string data,
if (module == "_encrypt") {
croak("_request_circuit_encrypt",
"Requesting transport layer security",
([ ]), query_server_unl());
([ ]), SERVER_UNIFORM);
return;
}
#endif
}
}
#endif
if (source == query_server_unl()) {
if (source == SERVER_UNIFORM) {
#ifndef __PIKE__ // TPD
if (function_exists("connect_failure"))
connect_failure("_self",
@ -152,7 +152,7 @@ varargs int rootMsg(mixed source, string mc, string data,
croak("_notice_circuit_compress",
"Will restart with compression using [_method]",
([ "_method" : vars["_method"] || "zlib" ]),
query_server_unl());
SERVER_UNIFORM);
enable_telnet(0);
start_mccp_compress(TELOPT_COMPRESS2);
// greet(); // TODO: calling it directly kills pypsyc
@ -166,7 +166,7 @@ varargs int rootMsg(mixed source, string mc, string data,
#else
croak("_error_unavailable_circuit_compress",
"Did I really flaunt compression to you?",
([ ]), query_server_unl());
([ ]), SERVER_UNIFORM);
#endif
break;
case "_request_circuit_encryption":
@ -179,14 +179,14 @@ varargs int rootMsg(mixed source, string mc, string data,
if (t = tls_query_connection_state(ME) == 0) {
croak("_notice_circuit_encrypt",
"Enabling TLS encryption.", ([ ]),
query_server_unl());
SERVER_UNIFORM);
tls_init_connection(ME);
// here we could actually need lars style
// to call greet when ready()
} else if (t > 0) {
/* sendmsg(source, "_error_tls_active",
"TLS is already active",
([ ]), query_server_unl()); */
([ ]), SERVER_UNIFORM); */
P0(("received %O for %O who already has TLS\n", mc, ME))
} else {
// negative numbers (current behaviour of ldmud)
@ -197,7 +197,7 @@ varargs int rootMsg(mixed source, string mc, string data,
// we can not be advertising it
croak("_error_unavailable_circuit_encrypt",
"Can not remember telling you I had TLS.",
([ ]), query_server_unl());
([ ]), SERVER_UNIFORM);
#endif
break;
case "_notice_circuit_encrypt":

View File

@ -173,7 +173,7 @@ object find_psyc_object(array(mixed) u) {
}
}
else unless (user) {
//return 0; // return SERVER_UNI !?
//return 0; // return SERVER_UNIFORM !?
return find_target_handler("/");
}
if (!objectp(o) && user) {

View File

@ -996,7 +996,7 @@ protected int deliver(mixed ip, string host, string mc, string buffer, mapping c
source, t, ME))
unless (cvars["_source_relay"])
cvars["_source_relay"] = source;
source = cvars["_source"] || query_server_unl();
source = cvars["_source"] || SERVER_UNIFORM;
// relay the message!
// this is used by procmail for example, whenever
// it needs to send to an xmpp: recipient.
@ -1101,7 +1101,7 @@ protected int deliver(mixed ip, string host, string mc, string buffer, mapping c
return restart();
}
// else if (t) return _error_rejected_relay_outgoing TODO
t2 = query_server_unl();
t2 = SERVER_UNIFORM;
// this part is new and maybe can be optimized.. TODO
// the main optimization would be to check for is_localhost
// with host part of target

View File

@ -13,7 +13,7 @@
//inherit NET_PATH "entity"
msg(source, mc, data, vars, showingLog, target) {
mapping rv = ([ "_nick" : query_server_unl() ]);
mapping rv = ([ "_nick" : SERVER_UNIFORM ]);
mixed t;
string family;
int glyph;

View File

@ -357,7 +357,7 @@ parseUDP(ip, port, msg) {
//v["to"] += ";tag=1234567890abcde"; // ??? TODO
/* need authorization
*/
v["www-authenticate"] = "Digest realm=\"" + query_server_unl() + "\", nonce=\"" + time() + "\"";
v["www-authenticate"] = "Digest realm=\"" + SERVER_UNIFORM + "\", nonce=\"" + time() + "\"";
reply = makeResponse(prot, 401, v, "");
// TODO: nonce generation has to be secure
send_udp(ip, port, reply);

View File

@ -68,12 +68,12 @@ void greet() {
// three separate packets follow (thus three emits)
//emit(S_GLYPH_PACKET_DELIMITER "\n");
emit("\
:_source\t"+ query_server_unl() +"\n\
:_source\t"+ SERVER_UNIFORM +"\n\
:_target_peer\tpsyc://"+ peeraddr +"/\n\
\n\
_notice_circuit_established\n" S_GLYPH_PACKET_DELIMITER "\n");
emit("\
:_source\t"+ query_server_unl() +"\n\
:_source\t"+ SERVER_UNIFORM +"\n\
\n\
_status_circuit\n" S_GLYPH_PACKET_DELIMITER "\n");
#ifdef _flag_log_sockets_SPYC

View File

@ -327,7 +327,7 @@ lookup(string mc, mixed fmt, object ghost, object curse) {
in = before + _host_XMPP + after;
break;
case "VAR_server_uniform":
in = before + query_server_unl() + after;
in = before + SERVER_UNIFORM + after;
break;
case "VAR_method":
PT(("using %O for %O\n", mc, code))

View File

@ -366,7 +366,7 @@ msg(source, mc, data, mapping vars, showingLog) {
// evil scary rewrite to support changed lastlog behaviour ,)
// TODO:: watch for _source_relay||(source resp. t)
&&! (stringp(source)
&& abbrev(query_server_unl() +"~", source))
&& abbrev(SERVER_UNIFORM +"~", source))
#endif
) {
if (data && index(data, '\n') != -1)
@ -1279,7 +1279,7 @@ w(string mc, string data, mapping vars, mixed source, int showingLog) {
// the context was an object, but got lost
// during ldmud's lastlog persistence. let's
// reconstruct it!
vars["_INTERNAL_context"] = query_server_unl();
vars["_INTERNAL_context"] = SERVER_UNIFORM;
// the place nick shouldn't be missing, but
// sometimes it does. let's figure out why
if (stringp(vars["_nick_place"]))
@ -1838,7 +1838,7 @@ listDescription(vars, eachout, nicklink) {
if (nicklink) {
int i;
string n, u;
string s = query_server_unl();
string s = SERVER_UNIFORM;
va = copy(va);
for (i=sizeof(va)-1; i>=0; --i) {
@ -1863,7 +1863,7 @@ listDescription(vars, eachout, nicklink) {
if (nicklink) {
int i;
string n, u;
string s = query_server_unl();
string s = SERVER_UNIFORM;
va = copy(va);
for (i=sizeof(va)-1; i>=0; --i) {

View File

@ -200,7 +200,7 @@ cmd(a, args, dest, command) {
# ifdef WEBMASTER_EMAIL
w("_info_administration_gateway",
"This gateway is operated by " WEBMASTER_EMAIL);
// " on "+ SERVER_UNL);
// " on "+ SERVER_UNIFORM);
# endif
// ARGH MULTILINE!!
w("_info_commands_gateway",
@ -981,7 +981,7 @@ cmd(a, args, dest, command) {
(vr = lower_case(vr)) != lower_case(vq))) {
#ifdef ALIASES
talk(raliases[vr] || (aliases[vr]
? query_server_unl()
? SERVER_UNIFORM
+"~"+ v("reply")
: v("reply")) );
// let /r have its toggle-behaviour again, almost