+sub t_send
+{
+ my $self = shift;
+ my $t = shift;
+ confess('$t is not a Thingy') unless $t->isa('Thingy');
+
+ # manufacture the protocol line if required
+ unless (exists $t->{_newprot}) {
+ my ($class) = ref $self =~ /::(\w+)$/;
+ unless (exists $t->{_rest}) {
+ $t->{_rest} = "";
+ while (my ($k,$v) = each %$t) {
+ next if $k =~ /^_/;
+ if (ref $v && @$v) {
+ my $val = "";
+ for(@$v) {
+ my $vv = $_;
+ $vv =~ s/([\%;=,\x00-\x1f\x7f-\xff])/sprintf("%%%02X", ord($1))/eg;
+ $val .= $vv . ',';
+ }
+ if (length $val) {
+ chop $val;
+ $t->{_rest} .= "$k=$val;";
+ }
+ } elsif (length $v) {
+ $v =~ s/([\%;=\x00-\x1f\x7f-\xff])/sprintf("%%%02X", ord($1))/eg;
+ $t->{_rest} .= "$k=$v;";
+ }
+ }
+ chop $t->{_rest} if length $t->{_rest};
+ }
+
+ $t->{_hoptime} ||= 1;
+ $t->{_msgid} = nextmsgid() unless $t->{_msgid};
+ $t->{_newprot} = join(';', $t->{_tonode}, $t->{_fromnode}, uc $class,
+ $t->{_msgid}, $t->{_hoptime}) . '|' . $t->{_rest};
+ }
+ $self->SUPER::send($t->{_newprot});
+}