mirror of
git://git.psyced.org/git/psyced
synced 2024-08-15 03:25:10 +00:00
Merge branch 'master' of git://git.psyced.org/git/psyced
This commit is contained in:
commit
9ded39dbdb
10 changed files with 33 additions and 29 deletions
|
@ -55,6 +55,7 @@ volatile mapping _routes, _u;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONTEXT_STATE // {{{
|
#ifdef CONTEXT_STATE // {{{
|
||||||
|
// why volatile.. that breaks the whole meaning of state
|
||||||
volatile mapping _costate, _cmemory;
|
volatile mapping _costate, _cmemory;
|
||||||
volatile mapping ctemp, cunused;
|
volatile mapping ctemp, cunused;
|
||||||
#endif // }}}
|
#endif // }}}
|
||||||
|
|
|
@ -29,11 +29,16 @@ private int _revision = -1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONTEXT_STATE
|
#ifdef CONTEXT_STATE
|
||||||
|
// cslaves should store their copy of state, so it shouldn't be volatile here
|
||||||
private volatile mapping cast_state;
|
private volatile mapping cast_state;
|
||||||
private volatile mapping temp_state;
|
private volatile mapping temp_state;
|
||||||
inherit NET_PATH "state";
|
inherit NET_PATH "state";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_SPYC
|
||||||
|
mapping _state; // should probably merge with ifdef CONTEXT_STATE..
|
||||||
|
#endif
|
||||||
|
|
||||||
private volatile mapping _members;
|
private volatile mapping _members;
|
||||||
|
|
||||||
void create() {
|
void create() {
|
||||||
|
@ -42,6 +47,9 @@ void create() {
|
||||||
unless(mappingp(cast_state)) cast_state = ([ ]);
|
unless(mappingp(cast_state)) cast_state = ([ ]);
|
||||||
unless(mappingp(temp_state)) temp_state = ([ ]);
|
unless(mappingp(temp_state)) temp_state = ([ ]);
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef USE_SPYC
|
||||||
|
unless(mappingp(_state)) _state = ([ ]);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PERSISTENT_SLAVES
|
#ifdef PERSISTENT_SLAVES
|
||||||
|
@ -264,3 +272,16 @@ void Diminish(mixed source, string key, mixed value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // }}}
|
#endif // }}}
|
||||||
|
|
||||||
|
#ifdef USE_SPYC
|
||||||
|
get_state() {
|
||||||
|
PT(("cstate for %O picked up by %O: %O\n", ME,
|
||||||
|
previous_object(), _state))
|
||||||
|
return _state;
|
||||||
|
}
|
||||||
|
commit_state() {
|
||||||
|
PT(("cstate for %O committed by %O: %O\n", ME,
|
||||||
|
previous_object(), _state))
|
||||||
|
_state = ([ ]);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -1113,13 +1113,18 @@ protected int deliver(mixed ip, string host, string mc, string buffer, mapping c
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void peek(string data) {
|
// temporary new "lfun" called from driver's comm.c to peek into new connection
|
||||||
|
void connection_peek(string data) {
|
||||||
P4((">> peek: %O\n", data));
|
P4((">> peek: %O\n", data));
|
||||||
#ifdef USE_SPYC
|
#ifdef USE_SPYC
|
||||||
|
# if !__EFUN_DEFINED__(psyc_parse)
|
||||||
|
# echo New PSYC syntax will not work: Driver compiled without libpsyc!
|
||||||
|
# endif
|
||||||
if (data[0] == C_GLYPH_NEW_PACKET_DELIMITER) {
|
if (data[0] == C_GLYPH_NEW_PACKET_DELIMITER) {
|
||||||
# if __EFUN_DEFINED__(enable_binary)
|
# if __EFUN_DEFINED__(enable_binary)
|
||||||
enable_binary(ME);
|
enable_binary(ME);
|
||||||
# else
|
# else
|
||||||
|
# echo New PSYC syntax will not work: Driver compiled without enable_binary!
|
||||||
raise_error("Driver compiled without enable_binary()");
|
raise_error("Driver compiled without enable_binary()");
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -274,6 +274,7 @@ static varargs string render_psyc(mixed source, string mc, mixed data,
|
||||||
|
|
||||||
if (mappingp(vars))
|
if (mappingp(vars))
|
||||||
mapeach (key, val, vars) {
|
mapeach (key, val, vars) {
|
||||||
|
// psyc_isRoutingVar() would be faster here I presume
|
||||||
routeMe = isRouting[key];
|
routeMe = isRouting[key];
|
||||||
if ((routeMe &&! (routeMe & PSYC_ROUTING_RENDER))
|
if ((routeMe &&! (routeMe & PSYC_ROUTING_RENDER))
|
||||||
|| abbrev("_INTERNAL", key))
|
|| abbrev("_INTERNAL", key))
|
||||||
|
@ -286,8 +287,7 @@ static varargs string render_psyc(mixed source, string mc, mixed data,
|
||||||
}
|
}
|
||||||
|
|
||||||
return psyc_render(({ rvars, evars, mc, data }));
|
return psyc_render(({ rvars, evars, mc, data }));
|
||||||
#endif
|
#else
|
||||||
|
|
||||||
if (mappingp(vars))
|
if (mappingp(vars))
|
||||||
vars = vars + rvars;
|
vars = vars + rvars;
|
||||||
else
|
else
|
||||||
|
@ -323,6 +323,7 @@ static varargs string render_psyc(mixed source, string mc, mixed data,
|
||||||
if (strlen(rbuf)) return rbuf[1 ..] +"\n"+
|
if (strlen(rbuf)) return rbuf[1 ..] +"\n"+
|
||||||
ebuf +"\n" S_GLYPH_PACKET_DELIMITER "\n";
|
ebuf +"\n" S_GLYPH_PACKET_DELIMITER "\n";
|
||||||
return ebuf +"\n" S_GLYPH_PACKET_DELIMITER "\n";
|
return ebuf +"\n" S_GLYPH_PACKET_DELIMITER "\n";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// notice for completeness: the PSYC renderer does not convert_charset
|
// notice for completeness: the PSYC renderer does not convert_charset
|
||||||
|
|
|
@ -3,10 +3,6 @@
|
||||||
|
|
||||||
#include "psyc.h"
|
#include "psyc.h"
|
||||||
|
|
||||||
#ifdef USE_PSYC
|
|
||||||
# include "../psyc/circuit.c"
|
|
||||||
#else
|
|
||||||
|
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#include <uniform.h>
|
#include <uniform.h>
|
||||||
#include <tls.h>
|
#include <tls.h>
|
||||||
|
@ -302,4 +298,3 @@ varargs int msg(string source, string mc, string data,
|
||||||
return emit(buf);
|
return emit(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // USE_PSYC
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
#ifdef USE_PSYC
|
|
||||||
# include "../psyc/common.h"
|
|
||||||
#endif
|
|
|
@ -1,8 +1,6 @@
|
||||||
// vim:foldmethod=marker:syntax=lpc:noexpandtab
|
// vim:foldmethod=marker:syntax=lpc:noexpandtab
|
||||||
// $Id: parse.c,v 1.30 2008/12/18 18:16:14 lynx Exp $
|
// $Id: parse.c,v 1.30 2008/12/18 18:16:14 lynx Exp $
|
||||||
|
|
||||||
#ifndef USE_PSYC
|
|
||||||
|
|
||||||
#include "psyc.h"
|
#include "psyc.h"
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#include <input_to.h>
|
#include <input_to.h>
|
||||||
|
@ -468,5 +466,3 @@ void interrupt_parse() {
|
||||||
void resume_parse() {
|
void resume_parse() {
|
||||||
state = PSYCPARSE_STATE_HEADER;
|
state = PSYCPARSE_STATE_HEADER;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // USE_PSYC
|
|
||||||
|
|
|
@ -23,12 +23,11 @@
|
||||||
* the first byte.
|
* the first byte.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef SPYC
|
||||||
#define SPYC
|
#define SPYC
|
||||||
|
|
||||||
#include <psyc.h>
|
#include <psyc.h>
|
||||||
|
|
||||||
#ifndef USE_PSYC
|
|
||||||
|
|
||||||
#if __EFUN_DEFINED__(psyc_parse)
|
#if __EFUN_DEFINED__(psyc_parse)
|
||||||
# define LIBPSYC
|
# define LIBPSYC
|
||||||
# include <sys/libpsyc.h>
|
# include <sys/libpsyc.h>
|
||||||
|
@ -46,4 +45,4 @@
|
||||||
return; \
|
return; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // USE_PSYC
|
#endif // SPYC
|
||||||
|
|
|
@ -5,10 +5,6 @@
|
||||||
|
|
||||||
#include "psyc.h"
|
#include "psyc.h"
|
||||||
|
|
||||||
#ifdef USE_PSYC
|
|
||||||
# include "../psyc/server.c"
|
|
||||||
#else
|
|
||||||
|
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#include <services.h>
|
#include <services.h>
|
||||||
#define NO_INHERIT
|
#define NO_INHERIT
|
||||||
|
@ -195,4 +191,3 @@ void circuit_msg(string mc, mapping vars, string data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // USE_PSYC
|
|
||||||
|
|
|
@ -3,10 +3,6 @@
|
||||||
|
|
||||||
#include "psyc.h"
|
#include "psyc.h"
|
||||||
|
|
||||||
#ifdef USE_PSYC
|
|
||||||
# include "../psyc/udp.c"
|
|
||||||
#else
|
|
||||||
|
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#include <uniform.h>
|
#include <uniform.h>
|
||||||
#include <text.h>
|
#include <text.h>
|
||||||
|
@ -42,5 +38,3 @@ parseUDP(ip, port, msg) {
|
||||||
// ignoring the routing vars.. TODO FIXME
|
// ignoring the routing vars.. TODO FIXME
|
||||||
#define PSYC_UDP
|
#define PSYC_UDP
|
||||||
#include "dispatch.i"
|
#include "dispatch.i"
|
||||||
|
|
||||||
#endif // USE_PSYC
|
|
||||||
|
|
Loading…
Reference in a new issue