Project

General

Profile

« Previous | Next » 

Revision 201f6e65

Added by Hamish Coleman about 15 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
30 30
#include <stdio.h>
31 31
#include <stdlib.h>
32 32

  
33
#define VERSION "0.2"
33
#define VERSION "0.2.1"
34 34

  
35 35
/* Size of buffers for send and receive */
36 36
#define BUFSIZE 1024
......
490 490

  
491 491
		/*
492 492
		 * Scan for CR NUL sequences and uncook them
493
		 * TODO - maybe implement a "cooked" mode to bypass this *
493
		 * it also appears that I need to uncook CR LF sequences
494
		 * TODO - implement a "cooked" mode to bypass all this
495
		 * mangling
494 496
		 */
495 497
		pbuf=buf;
496 498
		bytes_to_scan=size;
497 499
		while ((pbuf=memchr(pbuf,0x0d,bytes_to_scan))!=NULL) {
498 500
			pbuf++;
499
			if (*pbuf!=0x00) {
501
			if (*pbuf!=0x00&&*pbuf!=0x0a) {
500 502
				continue;
501 503
			}
502 504

  
......
768 770
	/* IAC WILL ECHO */
769 771
	/* IAC WILL suppress go ahead */
770 772
	/* IAC WILL status */
771
	netprintf(conn,"\xff\xfb\x01\xff\xfb\x03\xff\xfb\x05");
773
	/* IAC WONT linemode */
774
	netprintf(conn,"\xff\xfb\x01\xff\xfb\x03\xff\xfb\x05\xff\xfc\x22");
772 775

  
773 776
	netprintf(conn,"\r\nwconsd serial port server (version %s)\r\n\r\n",VERSION);
774 777
	send_help(conn);

Also available in: Unified diff