Commit Graph

2279 Commits

Author SHA1 Message Date
Dirk Koopman
2afa578fe5 get 302 working in AsyncMsg, basic get/keps 2013-09-11 00:36:45 +01:00
Dirk Koopman
b099b4a232 update sh/qrz and start get/keps 2013-09-10 23:42:24 +01:00
Dirk Koopman
e941823af3 fix sh/time undefined $last[0] error 2013-09-10 19:58:18 +01:00
Dirk Koopman
8bb293d5a1 AsyncMsgise sh/db0sdx
Add POST and on_disconnect handlers in AsyncMsg.pm
2013-09-09 15:20:32 +01:00
Dirk Koopman
89eaa6762e AsyncMsgise sh/425 2013-09-08 16:17:17 +01:00
Dirk Koopman
cc83de0d57 AsyncMsgise sh/qrz
Which was quite easy compared to some...
2013-09-07 23:08:15 +01:00
Dirk Koopman
9fc2ec1708 mv HTTPMsg to AsyncMsg, add 'raw' method
Convert sh/wm7d command to AsyncMsg.
Modify all the HTTPMsg converted cmds to use AsyncMsg.

Add a 'raw' 'telnet' handler. This allows one to query things with command
prompts or stuff that isn't a HTTP server. But it ain't always easy. See the
messing around in sh/wm7d I had to do, to get something that is stable given
that the thing that I am looking doesn't have a \n at the end.

It's just a prompt.
2013-09-07 18:47:48 +01:00
Dirk Koopman
1ec21f9257 and also in sh/db0sdx.pl 2013-09-07 00:23:38 +01:00
Dirk Koopman
75c9f67f91 fix missing Net::Telnet in sh/wm7d
temporarily...
2013-09-07 00:21:31 +01:00
Dirk Koopman
fd2d8314dd Add HTTPMsg.pm an async HTTP agent
This is a start of making all the Net::Telnet things redundant.

HTTPMsg.pm is likely to be substantially modified or replaced.

W.I.P
2013-09-07 00:10:36 +01:00
Dirk Koopman
a55492232d update Changes 2013-09-06 14:26:47 +01:00
Dirk Koopman
c675748ded added support for subroutines in commands
Traditionally, a command is a piece of perl that is a simple
in line lump of code e.g (blank.pl):

		my ($self, $line) = @_;
		my $lines = 1;
		my $data = ' ';
		my @f = split /\s+/, $line;
		if (@f && $f[0] !~ /^\d+$/) {
			$data = shift @f;
			$data = $data x int(($self->width-1) / length($data));
			$data .= substr $data, 0, int(($self->width-1) % length($data))
		}
		if (@f && $f[0] =~ /^\d+$/) {
			$lines = shift @f;
			$lines = 9 if $lines > 9;
			$lines = 1 if $lines < 1;
		}
		my @out;
		push @out, $data for (1..$lines);
		return (1, @out);

It is now possible to have a 'handler' and any other code you like in
a command file, for instance (again blank.pl):

sub this {}

sub that {}

sub another {}

sub handle
{
		my ($self, $line) = @_;
		my $lines = 1;
		my $data = ' ';
		my @f = split /\s+/, $line;
		if (@f && $f[0] !~ /^\d+$/) {
			$data = shift @f;
			$data = $data x int(($self->width-1) / length($data));
			$data .= substr $data, 0, int(($self->width-1) % length($data))
		}
		if (@f && $f[0] =~ /^\d+$/) {
			$lines = shift @f;
			$lines = 9 if $lines > 9;
			$lines = 1 if $lines < 1;
		}
		my @out;
		push @out, $data for (1..$lines);
		return (1, @out);
}

The 'sub handle' being the cue that distiguishes one form from the other.

The first form has the 'sub handle { <code> }' wrapped around it so, internally
they are treated the same. Each command is placed in its own DXCommandmode sub
package with a standard set of packages "use"d in front of it.

For now (at least) any functions you declare are just that. "$self" is a DXCommandmode
not a blessed reference to this command's full package name, you cannot use things like

$self->this() or $self->that()

they must be called as local functions.

This may change in the future.

Conflicts:

	perl/DXChannel.pm
	perl/Version.pm
2013-09-06 14:22:38 +01:00
Dirk Koopman
f67292b60a fix sh/contest and add CTY2308 prefixes 2013-09-06 13:42:02 +01:00
Dirk Koopman
0417a5b163 Alter default addr in client.c to "127.0.0.1"
This now matches the default in DXVars.pm.
2013-07-24 09:11:30 +01:00
Dirk Koopman
7f7535c09c Make peerhost data more consistent 2013-07-21 23:38:24 +01:00
Dirk Koopman
503168fd0f add ip address to links command 2013-07-21 23:17:46 +01:00
Dirk Koopman
4dad3e88c8 add new prefixes from cty2307 2013-07-21 22:52:07 +01:00
Dirk Koopman
385440511e fix ipv6 crash in Msg.pm 2013-07-21 22:46:18 +01:00
Dirk Koopman
e49fbae200 updates ands for 4mm and prefix data 2013-06-06 09:19:14 +01:00
Dirk Koopman
a7b139d6ce try again with cty2210 2012-05-31 17:08:50 +01:00
Dirk Koopman
2321d9d1b5 Add CTY2210 prefix changes 2012-05-31 09:49:01 +01:00
Dirk Koopman
996671c938 add cty2209 prefix changes 2012-05-29 11:37:57 +01:00
Dirk Koopman
96c0247dec add DXSql/Pg.pm and CTY-2206 Prefix changes 2012-04-10 14:50:26 +01:00
Dirk Koopman
b2aa9a9839 add new wpxloc.raw + CTY2204 prefix changes 2012-03-13 18:31:26 +00:00
Dirk Koopman
427bd0165d alter index adding dbg statement order 2012-03-12 23:41:57 +00:00
Dirk Koopman
61885d0dba breath on database storage engines
Check that Mysql / sqlite databases work
Add ipaddr column to spot table if required
from now on add ip addresses to table if present (NULL otherwise)
2012-03-12 23:26:55 +00:00
Dirk Koopman
e1de45af27 fix (different) pc34 UNIVERSAL typo in DXProt 2012-03-09 22:51:01 +00:00
Dirk Koopman
a50f4484d8 fix DXUser UNIVERSAL::isa typo 2012-03-09 22:42:35 +00:00
Dirk Koopman
40953f6b16 add yet more changes in pc34 2012-03-09 22:15:30 +00:00
Dirk Koopman
dabf8497c5 try to fix unblessed refs in PC34s 2012-03-09 22:13:29 +00:00
Dirk Koopman
7060bb41e3 update version 2012-02-15 15:44:26 +00:00
Dirk Koopman
4cb816f890 add CTY-2202 prefix data
and also fix mysql show tables
2012-02-15 15:43:50 +00:00
Dirk Koopman
9ab4359792 er.. actually generate the CTY-2201 prefixes 2012-01-29 10:41:58 +00:00
Dirk Koopman
449de811da add CTY-2201 prefixes 2012-01-29 10:41:23 +00:00
Dirk Koopman
80ef0d854f add CTY2118 changes 2011-12-21 13:35:57 +00:00
Dirk Koopman
84fb1f6e70 fix barf on encountering an empty lockfile 2011-12-20 19:47:28 +00:00
Dirk Koopman
3c2ea668af fix shutdown() error and add CTY2117 2011-11-29 18:50:47 +00:00
Dirk Koopman
192c703baf added cty2116 changes with fixed version 2011-11-05 17:20:43 +00:00
Dirk Koopman
842017697f Merge branch 'master' of ssh://server/scm/spider
Conflicts:
	Changes
	data/cty.dat
	data/prefix_data.pl
2011-11-04 18:06:34 +00:00
Dirk Koopman
9bbfe9a2d3 add CTY2115 prefixes 2011-11-04 18:00:03 +00:00
Dirk Koopman
4ab258ae11 add CTY2113 prefixes 2011-10-25 15:23:41 +01:00
Dirk Koopman
6262a02552 change internal 40m band areas 2011-10-02 13:18:15 +01:00
Dirk Koopman
258f3e1de9 add CTY2110 changes 2011-07-25 21:14:04 +01:00
Dirk Koopman
d3309582fe add ST0 to prefixes 2011-07-23 13:20:36 +01:00
Dirk Koopman
c31121866f add CTY-2108 prefixes 2011-05-24 10:23:19 +01:00
Dirk Koopman
af317b42b0 fix IPV4 handling on non-IPV6 capable hosts 2011-04-04 22:08:02 +01:00
Dirk Koopman
a8cf5442a1 itry to fix outgoing IPV6 connects 2011-04-04 21:54:43 +01:00
Dirk Koopman
dd4a4bf174 add CTY-2106 prefixes 2011-03-29 19:51:52 +01:00
Dirk Koopman
8f652755dc add CTY-2105 prefixes 2011-03-16 10:36:52 +00:00
Dirk Koopman
3c5ad50da6 oops forgot to use gcommit... 2011-03-11 17:16:47 +00:00