mirror of
https://github.com/ChronosX88/psyced.git
synced 2024-12-05 00:22:19 +00:00
MMP and pre-spec routing no longer needed
This commit is contained in:
parent
f76810d02e
commit
c75d508dae
@ -7,7 +7,7 @@
|
||||
// * resolve UNLs and UNRs into UNIs and back, so higher level
|
||||
// processing knows who they are dealing with, no matter which
|
||||
// agent operated on this person's behalf
|
||||
// * state: handle the inter-entity MMP state variables, packet
|
||||
// * state: handle the inter-entity routing state variables, packet
|
||||
// ids and message history
|
||||
// * trust network: figure out who we trust and who we can ask to find
|
||||
// out if someone is trustworthy etc etc
|
||||
|
@ -96,7 +96,7 @@ castmsg(source, mc, data, vars) {
|
||||
|
||||
P2(("%O castmsg(%O,%O,%O..) for %O\n", ME, source,mc,data, _routes))
|
||||
D4(P2(("%O vars = %O\n", ME, vars)))
|
||||
// _context is an MMP variable, so we use it internally with objectp
|
||||
// _context is a routing variable, so we use it internally with objectp
|
||||
vars["_context"] = ME;
|
||||
|
||||
#ifdef PERSISTENT_SLAVES
|
||||
|
@ -246,7 +246,6 @@
|
||||
// the old nick code seems to introduce the remote-part bug
|
||||
// but if we don't use it, psyced will render [_nick] wrong in many places
|
||||
# define USE_THE_NICK
|
||||
//# define PRE_SPEC // things that changed during the spec process
|
||||
//# ifndef __PIKE__
|
||||
//# define USE_LIVING
|
||||
//# endif
|
||||
|
@ -699,7 +699,7 @@ _request_iterator(source, mc, data, vars, b) {
|
||||
"[_iterator] blog entries have been requested "
|
||||
"since creation.", ([
|
||||
// i suppose this wasn't intentionally using
|
||||
// MMP _count so i rename it to _iterator
|
||||
// routing _count so i rename it to _iterator
|
||||
"_iterator" : v("iterator")
|
||||
]) );
|
||||
return 1;
|
||||
|
@ -40,13 +40,6 @@ inherit PSYC_PATH "common";
|
||||
|
||||
//volatile mapping namecache = ([]);
|
||||
|
||||
#ifdef MMP_STATE
|
||||
// first steps at making use of TCPs persistence
|
||||
volatile string lastSource;
|
||||
volatile string lastTarget;
|
||||
volatile string lastContext;
|
||||
#endif
|
||||
|
||||
int isServer() { return 0; }
|
||||
|
||||
volatile int flags = 0;
|
||||
@ -93,8 +86,8 @@ int greet() {
|
||||
# define PROTS UNDERPROTS
|
||||
#endif
|
||||
|
||||
// we only understand circuit-level (MMP) _state, the one that is so easy
|
||||
// that we can expect any TCP-MMP implementation to provide it, but PSYC
|
||||
// we only understand circuit-level routing _state, the one that is so easy
|
||||
// that we can expect any PSYC-TCP implementation to provide it, but PSYC
|
||||
// state which needs to be stored per logical source and target still needs
|
||||
// to be implemented. see also http://about.psyc.eu/State
|
||||
//#define UNDERMODS "_state;_context"
|
||||
@ -265,9 +258,6 @@ int logon(int neverfails) {
|
||||
cvars = ([]);
|
||||
pvars = ([ "_INTERNAL_origin" : ME ]);
|
||||
|
||||
#if defined(MMP_STATE)
|
||||
lastSource = lastTarget = lastContext = 0;
|
||||
#endif
|
||||
next_input_to(#'startParse);
|
||||
// even active connections want to time out to avoid lockups
|
||||
// but quit() should check if there is a queue to return! TODO
|
||||
@ -365,7 +355,6 @@ varargs int msg(string source, string mc, string data,
|
||||
# else
|
||||
context = vars["_context"];
|
||||
# endif
|
||||
# ifndef PRE_SPEC
|
||||
if (context) {
|
||||
buf+= ":_context\t"+ UNIFORM(context) +"\n";
|
||||
if (source) buf += ":_source_relay\t"+ UNIFORM(source) +"\n";
|
||||
@ -375,29 +364,6 @@ varargs int msg(string source, string mc, string data,
|
||||
if (source) buf += ":_source\t"+ UNIFORM(source) +"\n";
|
||||
if (target) buf += ":_target\t"+ target +"\n";
|
||||
}
|
||||
# else
|
||||
// is MMP_STATE a relict of pre-FORK days?
|
||||
# if defined(MMP_STATE)
|
||||
if (source != lastSource) {
|
||||
lastSource = source;
|
||||
buf += "=_source\t"+ UNIFORM(source) +"\n";
|
||||
}
|
||||
if (target != lastTarget) {
|
||||
lastTarget = target;
|
||||
buf += "=_target\t"+ (target || "") +"\n";
|
||||
}
|
||||
if (context != lastContext) {
|
||||
lastContext = context;
|
||||
buf += "=_context\t"+ UNIFORM(context) +"\n";
|
||||
}
|
||||
# else
|
||||
if (source) buf += ":_source\t"+ UNIFORM(source) +"\n";
|
||||
if (target) buf += ":_target\t"+ target +"\n";
|
||||
if (context) buf+= ":_context\t"+ UNIFORM(context) +"\n";
|
||||
if (vars["_source_relay"])
|
||||
buf += "\n:_source_relay\t"+ UNIFORM(vars["_source_relay"]);
|
||||
# endif /* MMP_STATE */
|
||||
# endif /* !PRE_SPEC */
|
||||
#endif /* !NEW_RENDER */
|
||||
rc = psyc_render(source, mc, data, vars, showingLog, target);
|
||||
unless (rc) return 0;
|
||||
|
@ -388,16 +388,11 @@ int psyc_sendmsg(mixed target, string mc, mixed data, mapping vars,
|
||||
"\n" S_GLYPH_PACKET_DELIMITER "\n");
|
||||
else data="\n" S_GLYPH_PACKET_DELIMITER "\n"; // TODO? look up textdb.
|
||||
|
||||
// look! MMP-conformant support of the _context variable!
|
||||
if (room = vars["_context"]) {
|
||||
// this may have to change into a full psyc: URL
|
||||
if (objectp(room)) room = psyc_name(room);
|
||||
buf = S_GLYPH_PACKET_DELIMITER "\n"
|
||||
# ifdef PRE_SPEC
|
||||
":_source\t"+ sname +"\n"
|
||||
# else
|
||||
":_source_relay\t"+ sname +"\n"
|
||||
# endif
|
||||
+ ":_context\t"+ room +"\n";
|
||||
} else
|
||||
buf = S_GLYPH_PACKET_DELIMITER "\n"
|
||||
|
@ -5,7 +5,7 @@
|
||||
# include <tls.h>
|
||||
#endif
|
||||
|
||||
// PSYC MESSAGE PARSER - parses both MMP and PSYC the old way
|
||||
// PSYC MESSAGE PARSER - parses PSYC the old way
|
||||
//
|
||||
// THIS IS THE ORIGINAL LYNXISH PSYC PARSER
|
||||
|
||||
|
@ -246,7 +246,6 @@ static varargs string psyc_render(mixed source, string mc, mixed data,
|
||||
# else
|
||||
context = vars["_context"];
|
||||
# endif
|
||||
# ifndef PRE_SPEC
|
||||
if (context) {
|
||||
rbuf += "\n:_context\t"+ UNIFORM(context);
|
||||
t = source || vars["_source_relay"];
|
||||
@ -264,13 +263,6 @@ static varargs string psyc_render(mixed source, string mc, mixed data,
|
||||
if (t = vars["_source_relay"])
|
||||
rbuf += "\n:_source_relay\t"+ UNIFORM(t);
|
||||
}
|
||||
# else
|
||||
if (source) rbuf += "\n:_source\t"+ UNIFORM(source);
|
||||
if (target) rbuf += "\n:_target\t"+ target;
|
||||
if (context) rbuf+= "\n:_context\t"+ UNIFORM(context);
|
||||
if (t = vars["_source_relay"])
|
||||
rbuf += "\n:_source_relay\t"+ UNIFORM(t);
|
||||
# endif /* PRE_SPEC */
|
||||
#endif /* NEW_RENDER */
|
||||
|
||||
if (mappingp(vars)) {
|
||||
|
Loading…
Reference in New Issue
Block a user