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:
parent
f76810d02e
commit
c75d508dae
8 changed files with 6 additions and 54 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue