From ecda9d906cc776dc9492693352db1a8914a5073f Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Thu, 19 May 2011 17:41:48 +0200 Subject: [PATCH] restart from working psyc codebase and look at new code later --- CHANGESTODO | 2 +- world/net/connect.c | 1 + world/net/spyc/circuit.c | 6 ++++++ world/net/spyc/common.h | 2 ++ world/net/spyc/dispatch.i | 3 +++ world/net/spyc/parse.c | 3 +++ world/net/spyc/parse.i | 3 +++ world/net/spyc/psyc.h | 12 ++++++++++-- world/net/spyc/server.c | 6 ++++++ world/net/spyc/udp.c | 6 ++++++ 10 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 world/net/spyc/common.h create mode 100644 world/net/spyc/parse.i diff --git a/CHANGESTODO b/CHANGESTODO index 32244b2..629bd2e 100644 --- a/CHANGESTODO +++ b/CHANGESTODO @@ -5,7 +5,7 @@ vim:nosmarttab:syntax=diff | - marks bugs & fixes, + marks new features, ? marks issues, * marks big stuff | | This file is mostly being used by lynX. The public bug tracker for psyced -| resides at https://projects.x-net.hu/projects/psyced/ and contains the +| resides at https://projects.tgbit.net/projects/psyced/ and contains the | same stuff in a more multiuser accessible fashion. ________________________________________________________________________ == SERIOUS!!! ========================================================== diff --git a/world/net/connect.c b/world/net/connect.c index d9ab916..d2c75ec 100644 --- a/world/net/connect.c +++ b/world/net/connect.c @@ -99,6 +99,7 @@ private connect2(ip, port, host, extra) { if (sscanf(extra, "%s:%d;%s", host, port, extra) == 3) { P3(("fallback: %s:%d, other %O\n", host, port, extra)) is_connecting = 0; + // why 10 seconds here? this can be improved call_out(#'connect, 10, host, port, 1, extra == "" ? 0 : extra); return; } diff --git a/world/net/spyc/circuit.c b/world/net/spyc/circuit.c index 712e2fa..915747d 100644 --- a/world/net/spyc/circuit.c +++ b/world/net/spyc/circuit.c @@ -2,6 +2,10 @@ // $Id: circuit.c,v 1.38 2008/10/14 19:02:29 lynx Exp $ #include "psyc.h" +#include "../psyc/circuit.c" + +#if 0 // first we get the syntax running, then we'll think of new features: + #include #include #include @@ -324,3 +328,5 @@ varargs int msg(string source, string mc, string data, #endif return emit(buf); } + +#endif // 0 diff --git a/world/net/spyc/common.h b/world/net/spyc/common.h new file mode 100644 index 0000000..5fc88a1 --- /dev/null +++ b/world/net/spyc/common.h @@ -0,0 +1,2 @@ +#include "../psyc/common.h" + diff --git a/world/net/spyc/dispatch.i b/world/net/spyc/dispatch.i index 130c8c2..7cbe6d8 100644 --- a/world/net/spyc/dispatch.i +++ b/world/net/spyc/dispatch.i @@ -1,3 +1,5 @@ +#if 0 // first we get the syntax running, then we'll think of new features: + // included by TCP circuit *and* UDP daemon // vim:syntax=lpc void dispatch(mixed header_vars, mixed varops, mixed method, mixed body) { @@ -242,3 +244,4 @@ void dispatch(mixed header_vars, mixed varops, mixed method, mixed body) { ::dispatch(header_vars, varops, method, body); } +#endif // 0 diff --git a/world/net/spyc/parse.c b/world/net/spyc/parse.c index 98e7558..41a9399 100644 --- a/world/net/spyc/parse.c +++ b/world/net/spyc/parse.c @@ -1,3 +1,5 @@ +#if 0 // first we get the syntax running, then we'll think of new features: + // vim:foldmethod=marker:syntax=lpc:noexpandtab // $Id: parse.c,v 1.30 2008/12/18 18:16:14 lynx Exp $ // @@ -449,3 +451,4 @@ void resume_parse() { state = PSYCPARSE_STATE_HEADER; } +#endif // 0 diff --git a/world/net/spyc/parse.i b/world/net/spyc/parse.i new file mode 100644 index 0000000..66c38fe --- /dev/null +++ b/world/net/spyc/parse.i @@ -0,0 +1,3 @@ +#include "psyc.h" +#include "../psyc/parse.i" + diff --git a/world/net/spyc/psyc.h b/world/net/spyc/psyc.h index 83235de..e375c41 100644 --- a/world/net/spyc/psyc.h +++ b/world/net/spyc/psyc.h @@ -23,7 +23,15 @@ * the first byte. */ -#define SPYC +#ifndef SPYC +# define SPYC + +# include +#endif + +// EOF + +#if 0 // first we get the syntax running, then we'll think of new features: #define PSYCPARSE_STATE_HEADER 0 #define PSYCPARSE_STATE_CONTENT 1 @@ -37,4 +45,4 @@ return; \ } -#include +#endif // 0 diff --git a/world/net/spyc/server.c b/world/net/spyc/server.c index 89bd439..f8a2a6a 100644 --- a/world/net/spyc/server.c +++ b/world/net/spyc/server.c @@ -4,6 +4,10 @@ // the thing that answers on port 4404 of psyced. #include "psyc.h" +#include "../psyc/server.c" + +#if 0 // first we get the syntax running, then we'll think of new features: + #include #include #define NO_INHERIT @@ -189,3 +193,5 @@ void circuit_msg(string mc, mapping vars, string data) { return ::circuit_msg(mc, vars, data); } } + +#endif // 0 diff --git a/world/net/spyc/udp.c b/world/net/spyc/udp.c index 1a86bd2..7359e29 100644 --- a/world/net/spyc/udp.c +++ b/world/net/spyc/udp.c @@ -2,6 +2,10 @@ // $Id: udp.c,v 1.7 2008/07/17 15:07:59 lynx Exp $ #include "psyc.h" +#include "../psyc/udp.c" + +#if 0 // first we get the syntax running, then we'll think of new features: + #include #include #include @@ -36,3 +40,5 @@ parseUDP(ip, port, msg) { // ignoring the routing vars.. TODO FIXME #define PSYC_UDP #include "dispatch.i" + +#endif // 0