This commit is contained in:
Kelvin Sherlock 2012-04-10 00:18:59 -04:00
parent d388292da6
commit 798574a8a5
2 changed files with 6 additions and 5 deletions

View File

@ -164,6 +164,7 @@ loop do
end end
client.close() client.close()
puts("connection closed")
end end
end end

View File

@ -1,6 +1,6 @@
#include "readline2.h" #include "readline2.h"
#include <tcpipx.h> #include <tcpipx.h>
#include <Memory.h>
static LongWord find_crlf(const char *cp, LongWord length) static LongWord find_crlf(const char *cp, LongWord length)
{ {
@ -87,7 +87,7 @@ Word ReadLine2(Word ipid, rlBuffer *buffer)
if (!buffer) return 0; // ? if (!buffer) return 0; // ?
buffer->bufferhandle = NULL; buffer->bufferHandle = NULL;
buffer->bufferSize = 0; buffer->bufferSize = 0;
buffer->terminator = 0; buffer->terminator = 0;
buffer->moreFlag = 0; buffer->moreFlag = 0;
@ -103,7 +103,7 @@ Word ReadLine2(Word ipid, rlBuffer *buffer)
if (state == TCPSCLOSED) return tcperrBadConnection; if (state == TCPSCLOSED) return tcperrBadConnection;
if (state < TCPSESTABLISHED) return tcperrNoResources; if (state < TCPSESTABLISHED) return tcperrNoResources;
h = (Handle *)ur->uwTCPDataIn; h = (Handle)ur->uwTCPDataIn;
// should never happen.... // should never happen....
if (!h) return tcperrNoResources; if (!h) return tcperrNoResources;
cp = *(char **)h; cp = *(char **)h;
@ -174,7 +174,7 @@ Word ReadLine2(Word ipid, rlBuffer *buffer)
buffer->bufferSize = size; buffer->bufferSize = size;
buffer->bufferHandle = h; buffer->bufferHandle = h;
buffer->term = term; buffer->terminator = term;
cp = *(char **)h; cp = *(char **)h;
@ -183,7 +183,7 @@ Word ReadLine2(Word ipid, rlBuffer *buffer)
Word rv; Word rv;
rrBuff rb; rrBuff rb;
rv = TCPIPReadTCP(ipid, 0, cp, hsize, &rb); rv = TCPIPReadTCP(ipid, 0, (Ref)cp, hsize, &rb);
// tcperrConClosing is the only possible error // tcperrConClosing is the only possible error
// (others were handled above via the state). // (others were handled above via the state).