Project

General

Profile

« Previous | Next » 

Revision 201f6e65

Added by Hamish Coleman over 16 years ago

  • ID 201f6e65764f1009573ad8b83bbe8f2eaa11ee5c

Uncook CRLF sequences into plan CR in net_to_com
My testing had been done with the linux telnet client and it sent CR NUL
as the end-of-line character sequence. Both putty and windows telnet
are sending CR LF as end-of-line sequence. This change pretty much
requires that I will one day implement a raw transport mode. closes #30

View differences:

wconsd.c
#include <stdio.h>
#include <stdlib.h>
#define VERSION "0.2"
#define VERSION "0.2.1"
/* Size of buffers for send and receive */
#define BUFSIZE 1024
......
/*
* Scan for CR NUL sequences and uncook them
* TODO - maybe implement a "cooked" mode to bypass this *
* it also appears that I need to uncook CR LF sequences
* TODO - implement a "cooked" mode to bypass all this
* mangling
*/
pbuf=buf;
bytes_to_scan=size;
while ((pbuf=memchr(pbuf,0x0d,bytes_to_scan))!=NULL) {
pbuf++;
if (*pbuf!=0x00) {
if (*pbuf!=0x00&&*pbuf!=0x0a) {
continue;
}
......
/* IAC WILL ECHO */
/* IAC WILL suppress go ahead */
/* IAC WILL status */
netprintf(conn,"\xff\xfb\x01\xff\xfb\x03\xff\xfb\x05");
/* IAC WONT linemode */
netprintf(conn,"\xff\xfb\x01\xff\xfb\x03\xff\xfb\x05\xff\xfc\x22");
netprintf(conn,"\r\nwconsd serial port server (version %s)\r\n\r\n",VERSION);
send_help(conn);

Also available in: Unified diff