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

MMP and pre-spec routing no longer needed

This commit is contained in:
psyc://psyced.org/~lynX 2011-05-21 18:36:52 +02:00
parent f76810d02e
commit c75d508dae
8 changed files with 6 additions and 54 deletions

View file

@ -7,7 +7,7 @@
// * resolve UNLs and UNRs into UNIs and back, so higher level // * resolve UNLs and UNRs into UNIs and back, so higher level
// processing knows who they are dealing with, no matter which // processing knows who they are dealing with, no matter which
// agent operated on this person's behalf // 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 // ids and message history
// * trust network: figure out who we trust and who we can ask to find // * trust network: figure out who we trust and who we can ask to find
// out if someone is trustworthy etc etc // out if someone is trustworthy etc etc

View file

@ -96,7 +96,7 @@ castmsg(source, mc, data, vars) {
P2(("%O castmsg(%O,%O,%O..) for %O\n", ME, source,mc,data, _routes)) P2(("%O castmsg(%O,%O,%O..) for %O\n", ME, source,mc,data, _routes))
D4(P2(("%O vars = %O\n", ME, vars))) 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; vars["_context"] = ME;
#ifdef PERSISTENT_SLAVES #ifdef PERSISTENT_SLAVES

View file

@ -246,7 +246,6 @@
// the old nick code seems to introduce the remote-part bug // 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 // but if we don't use it, psyced will render [_nick] wrong in many places
# define USE_THE_NICK # define USE_THE_NICK
//# define PRE_SPEC // things that changed during the spec process
//# ifndef __PIKE__ //# ifndef __PIKE__
//# define USE_LIVING //# define USE_LIVING
//# endif //# endif

View file

@ -699,7 +699,7 @@ _request_iterator(source, mc, data, vars, b) {
"[_iterator] blog entries have been requested " "[_iterator] blog entries have been requested "
"since creation.", ([ "since creation.", ([
// i suppose this wasn't intentionally using // 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") "_iterator" : v("iterator")
]) ); ]) );
return 1; return 1;

View file

@ -40,13 +40,6 @@ inherit PSYC_PATH "common";
//volatile mapping namecache = ([]); //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; } int isServer() { return 0; }
volatile int flags = 0; volatile int flags = 0;
@ -93,8 +86,8 @@ int greet() {
# define PROTS UNDERPROTS # define PROTS UNDERPROTS
#endif #endif
// we only understand circuit-level (MMP) _state, the one that is so easy // we only understand circuit-level routing _state, the one that is so easy
// that we can expect any TCP-MMP implementation to provide it, but PSYC // 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 // state which needs to be stored per logical source and target still needs
// to be implemented. see also http://about.psyc.eu/State // to be implemented. see also http://about.psyc.eu/State
//#define UNDERMODS "_state;_context" //#define UNDERMODS "_state;_context"
@ -265,9 +258,6 @@ int logon(int neverfails) {
cvars = ([]); cvars = ([]);
pvars = ([ "_INTERNAL_origin" : ME ]); pvars = ([ "_INTERNAL_origin" : ME ]);
#if defined(MMP_STATE)
lastSource = lastTarget = lastContext = 0;
#endif
next_input_to(#'startParse); next_input_to(#'startParse);
// even active connections want to time out to avoid lockups // even active connections want to time out to avoid lockups
// but quit() should check if there is a queue to return! TODO // 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 # else
context = vars["_context"]; context = vars["_context"];
# endif # endif
# ifndef PRE_SPEC
if (context) { if (context) {
buf+= ":_context\t"+ UNIFORM(context) +"\n"; buf+= ":_context\t"+ UNIFORM(context) +"\n";
if (source) buf += ":_source_relay\t"+ UNIFORM(source) +"\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 (source) buf += ":_source\t"+ UNIFORM(source) +"\n";
if (target) buf += ":_target\t"+ target +"\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 */ #endif /* !NEW_RENDER */
rc = psyc_render(source, mc, data, vars, showingLog, target); rc = psyc_render(source, mc, data, vars, showingLog, target);
unless (rc) return 0; unless (rc) return 0;

View file

@ -388,16 +388,11 @@ int psyc_sendmsg(mixed target, string mc, mixed data, mapping vars,
"\n" S_GLYPH_PACKET_DELIMITER "\n"); "\n" S_GLYPH_PACKET_DELIMITER "\n");
else data="\n" S_GLYPH_PACKET_DELIMITER "\n"; // TODO? look up textdb. else data="\n" S_GLYPH_PACKET_DELIMITER "\n"; // TODO? look up textdb.
// look! MMP-conformant support of the _context variable!
if (room = vars["_context"]) { if (room = vars["_context"]) {
// this may have to change into a full psyc: URL // this may have to change into a full psyc: URL
if (objectp(room)) room = psyc_name(room); if (objectp(room)) room = psyc_name(room);
buf = S_GLYPH_PACKET_DELIMITER "\n" buf = S_GLYPH_PACKET_DELIMITER "\n"
# ifdef PRE_SPEC
":_source\t"+ sname +"\n"
# else
":_source_relay\t"+ sname +"\n" ":_source_relay\t"+ sname +"\n"
# endif
+ ":_context\t"+ room +"\n"; + ":_context\t"+ room +"\n";
} else } else
buf = S_GLYPH_PACKET_DELIMITER "\n" buf = S_GLYPH_PACKET_DELIMITER "\n"

View file

@ -5,7 +5,7 @@
# include <tls.h> # include <tls.h>
#endif #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 // THIS IS THE ORIGINAL LYNXISH PSYC PARSER

View file

@ -246,7 +246,6 @@ static varargs string psyc_render(mixed source, string mc, mixed data,
# else # else
context = vars["_context"]; context = vars["_context"];
# endif # endif
# ifndef PRE_SPEC
if (context) { if (context) {
rbuf += "\n:_context\t"+ UNIFORM(context); rbuf += "\n:_context\t"+ UNIFORM(context);
t = source || vars["_source_relay"]; 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"]) if (t = vars["_source_relay"])
rbuf += "\n:_source_relay\t"+ UNIFORM(t); 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 */ #endif /* NEW_RENDER */
if (mappingp(vars)) { if (mappingp(vars)) {