[1009] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next last

Re: [COLD] Re: Crashes

daemon@ATHENA.MIT.EDU (Wed Jun 5 12:59:01 1996 )

Date: Wed, 5 Jun 1996 10:29:51 -0600 (MDT)
From: Brandon Gillespie <brandon@tombstone.sunrem.com>
To: Miroslav Silovic <silovic@srce.hr>
cc: coldstuff@cold.org
In-Reply-To: <199606042337.BAA21300@regoc.srce.hr>

On Wed, 5 Jun 1996, Miroslav Silovic wrote:

> First, my telnet sends ^C in character mode instead of the line mode, so
> ^C sequence it interpreted immediately.
> 
> Secondly, connection_read got only garbage from the connection (the
> sequence it actually read was 6, 255, 254, 255, 253, 6). This could be a
> telnet bug.

Actually, I would suspect its something beyond a telnet bug, probably a 
problem on our behalf in that telnet expects us to be working as a telnet 
server, and we are not.

[hacks up a quick socket client in perl...]

Hrm, ok, the following can be used to test this, I strongly suspect 
something is happening to the connection on the outbound end, because the 
inbound end seems just fine...

#!/usr/bin/perl
## perl 5

use Socket;

$them = "ice.cold.org";
$port = 1138;

$SIG{'INT'} = 'dokill';
sub dokill { kill 9,$child if $child; }

$sockaddr = 'S n a4 x8';
chop($hostname = `hostname`);
$proto = (getprotobyname('tcp'))[2];
$port  = (getservbyname($port, 'tcp'))[2];
$thisaddr = (gethostbyname($hostname))[4];
$thataddr = (gethostbyname($them))[4];                           

$this = pack($sockaddr, AF_INET, 0, $thisaddr);
$that = pack($sockaddr, AF_INET, $port, $thataddr);

socket(S, PF_INET, SOCK_STREAM, $proto) || die "socket: $!";
bind(S, $this) || die "bind: $!";
connect(S, $that) || die "connect: $!";

select(S); $| = 1; select(stdout);

if ($child = fork) {
    while (<STDIN>) {
        print S;
    }   
    sleep 3;
    do dokill();
} else {
    while (<S>) {
        print;
    }   
}   
--------

Using this client, everything worked fine until I hit ^C.  I had hacked 
$connection.parse() to echo the buffers of all input, and it simply 
recieved `[10], except from that point on I received _no more output_.  I 
could still send input, and it was parsed just fine (@quit worked great 
:)  But I saw no output. 

> Thirdly, this is the only situation when core gets a line that is not
> terminated by CR/LF. I'm not sure this has been tested in any way.
> 
> Fourth, `[65,10,3].to_strings() => ["a",`[3]]
> (can we handle buffers in these lists? Especially if it terminates by a
> buffer?)

You _ALWAYS_ get a list of [strings, ..., buffer] from buf_to_strings(), 
our code handles it just fine.

> And lastly, when I kill my telnet, I get neatly disconnected, and my
> connection object destroyed. So I don't think that is the problem.

That is because when the server noticed your connection was dead it 
called .disconnect() on the connection object :)   Like I said, 
everything is working fine _in the db code_, I think the problem is 
somewhere in the outbound messaging of connections (getting frobbed 
somehow from the inbound stuff).

One may want to look into tell(obj, buffer) (C function), and how it 
hooks back to the connection..

-Brandon