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

january 2009

This commit is contained in:
psyc://psyced.org/~lynX 2009-01-26 21:26:52 +01:00
parent 94530cc322
commit bdfae4e350
64 changed files with 79 additions and 794 deletions

View file

@ -1,5 +1,5 @@
// vim:foldmethod=marker:syntax=lpc:noexpandtab
// $Id: server.c,v 1.18 2008/12/18 18:16:14 lynx Exp $
// $Id: server.c,v 1.19 2008/12/27 00:42:04 lynx Exp $
//
// the thing that answers on port 4404 of psyced.
@ -61,6 +61,26 @@ disconnected(remaining) {
return rc;
}
// this only gets called from net/psyc.. FIXME
void greet() {
// should be doing sTextPath(); here ?
// should be sharing code with net/psyc and do a proper greeting
// three separate packets follow (thus three emits)
//emit(S_GLYPH_PACKET_DELIMITER "\n");
emit("\
:_source\t"+ query_server_unl() +"\n\
:_target_peer\tpsyc://"+ peeraddr +"/\n\
\n\
_notice_circuit_established\n" S_GLYPH_PACKET_DELIMITER "\n");
emit("\
:_source\t"+ query_server_unl() +"\n\
\n\
_status_circuit\n" S_GLYPH_PACKET_DELIMITER "\n");
#ifdef _flag_log_sockets_SPYC
log_file("RAW_SPYC", "» %O greeted.\n", ME);
#endif
}
static void resolved(mixed host, mixed tag) {
PT(("resolved %O to %O\n", peerip, host))
string numericpeeraddr;
@ -152,33 +172,13 @@ static void resolved(mixed host, mixed tag) {
}
resume_parse();
sTextPath();
greet();
// FIXME: determine response to greeting
// instead of this dummy
msg(0, "_notice_features", 0, tag ? ([ "_tag_reply" : tag ]) : 0);
}
// this only gets called from net/psyc.. FIXME
void greet() {
// should be doing sTextPath(); here ?
// should be sharing code with net/psyc and do a proper greeting
// three separate packets follow (thus three emits)
emit(S_GLYPH_PACKET_DELIMITER "\n");
emit("\
:_source\t"+ query_server_unl() +"\n\
:_target_peer\tpsyc://"+ peeraddr +"/\n\
\n\
_notice_circuit_established\n" S_GLYPH_PACKET_DELIMITER "\n");
emit("\
:_source\t"+ query_server_unl() +"\n\
\n\
_status_circuit\n"); // S_GLYPH_PACKET_DELIMITER "\n");
// last pipe is generated by fippo's code
#ifdef _flag_log_sockets_SPYC
log_file("RAW_SPYC", "» %O greeted.\n", ME);
#endif
}
void circuit_msg(string mc, mapping vars, string data) {
switch(mc) {
case "_request_features": // only servers handle _request_features