1
0
Fork 0
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:
Gabor Adam Toth 2011-05-23 13:17:17 +02:00
commit 9ded39dbdb
10 changed files with 33 additions and 29 deletions

View file

@ -55,6 +55,7 @@ volatile mapping _routes, _u;
#endif
#ifdef CONTEXT_STATE // {{{
// why volatile.. that breaks the whole meaning of state
volatile mapping _costate, _cmemory;
volatile mapping ctemp, cunused;
#endif // }}}

View file

@ -29,11 +29,16 @@ private int _revision = -1;
#endif
#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 temp_state;
inherit NET_PATH "state";
#endif
#ifdef USE_SPYC
mapping _state; // should probably merge with ifdef CONTEXT_STATE..
#endif
private volatile mapping _members;
void create() {
@ -42,6 +47,9 @@ void create() {
unless(mappingp(cast_state)) cast_state = ([ ]);
unless(mappingp(temp_state)) temp_state = ([ ]);
#endif
#ifdef USE_SPYC
unless(mappingp(_state)) _state = ([ ]);
#endif
}
#ifdef PERSISTENT_SLAVES
@ -264,3 +272,16 @@ void Diminish(mixed source, string key, mixed value) {
}
#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

View file

@ -1113,13 +1113,18 @@ protected int deliver(mixed ip, string host, string mc, string buffer, mapping c
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));
#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 __EFUN_DEFINED__(enable_binary)
enable_binary(ME);
# else
# echo New PSYC syntax will not work: Driver compiled without enable_binary!
raise_error("Driver compiled without enable_binary()");
# endif
}

View file

@ -274,6 +274,7 @@ static varargs string render_psyc(mixed source, string mc, mixed data,
if (mappingp(vars))
mapeach (key, val, vars) {
// psyc_isRoutingVar() would be faster here I presume
routeMe = isRouting[key];
if ((routeMe &&! (routeMe & PSYC_ROUTING_RENDER))
|| 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 }));
#endif
#else
if (mappingp(vars))
vars = vars + rvars;
else
@ -323,6 +323,7 @@ static varargs string render_psyc(mixed source, string mc, mixed data,
if (strlen(rbuf)) return rbuf[1 ..] +"\n"+
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

View file

@ -3,10 +3,6 @@
#include "psyc.h"
#ifdef USE_PSYC
# include "../psyc/circuit.c"
#else
#include <net.h>
#include <uniform.h>
#include <tls.h>
@ -302,4 +298,3 @@ varargs int msg(string source, string mc, string data,
return emit(buf);
}
#endif // USE_PSYC

View file

@ -1,3 +0,0 @@
#ifdef USE_PSYC
# include "../psyc/common.h"
#endif

View file

@ -1,8 +1,6 @@
// vim:foldmethod=marker:syntax=lpc:noexpandtab
// $Id: parse.c,v 1.30 2008/12/18 18:16:14 lynx Exp $
#ifndef USE_PSYC
#include "psyc.h"
#include <net.h>
#include <input_to.h>
@ -468,5 +466,3 @@ void interrupt_parse() {
void resume_parse() {
state = PSYCPARSE_STATE_HEADER;
}
#endif // USE_PSYC

View file

@ -23,12 +23,11 @@
* the first byte.
*/
#ifndef SPYC
#define SPYC
#include <psyc.h>
#ifndef USE_PSYC
#if __EFUN_DEFINED__(psyc_parse)
# define LIBPSYC
# include <sys/libpsyc.h>
@ -46,4 +45,4 @@
return; \
}
#endif // USE_PSYC
#endif // SPYC

View file

@ -5,10 +5,6 @@
#include "psyc.h"
#ifdef USE_PSYC
# include "../psyc/server.c"
#else
#include <net.h>
#include <services.h>
#define NO_INHERIT
@ -195,4 +191,3 @@ void circuit_msg(string mc, mapping vars, string data) {
}
}
#endif // USE_PSYC

View file

@ -3,10 +3,6 @@
#include "psyc.h"
#ifdef USE_PSYC
# include "../psyc/udp.c"
#else
#include <net.h>
#include <uniform.h>
#include <text.h>
@ -42,5 +38,3 @@ parseUDP(ip, port, msg) {
// ignoring the routing vars.. TODO FIXME
#define PSYC_UDP
#include "dispatch.i"
#endif // USE_PSYC