Skip to content
Snippets Groups Projects
Commit e7bca3fc authored by rswindell's avatar rswindell
Browse files

Created escape_telnet_iac (0xff) option.

parent 61037312
Branches
Tags
No related merge requests found
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "crc32.h" #include "crc32.h"
#include "sexyz.h" #include "sexyz.h"
#include "telnet.h"
#define ENDOFFRAME 2 #define ENDOFFRAME 2
#define FRAMEOK 1 #define FRAMEOK 1
...@@ -207,6 +208,8 @@ int zmodem_send_esc(zmodem_t* zm, unsigned char c) ...@@ -207,6 +208,8 @@ int zmodem_send_esc(zmodem_t* zm, unsigned char c)
int zmodem_tx(zmodem_t* zm, unsigned char c) int zmodem_tx(zmodem_t* zm, unsigned char c)
{ {
int result;
switch (c) { switch (c) {
case DLE: case DLE:
case DLE|0x80: /* even if high-bit set */ case DLE|0x80: /* even if high-bit set */
...@@ -221,6 +224,13 @@ int zmodem_tx(zmodem_t* zm, unsigned char c) ...@@ -221,6 +224,13 @@ int zmodem_tx(zmodem_t* zm, unsigned char c)
if(zm->escape_all_control_characters && (zm->last_sent&0x7f) == '@') if(zm->escape_all_control_characters && (zm->last_sent&0x7f) == '@')
return zmodem_send_esc(zm, c); return zmodem_send_esc(zm, c);
break; break;
case TELNET_IAC:
if(zm->escape_telnet_iac) {
if((result=zmodem_send_raw(zm, ZDLE))!=0)
return(result);
return zmodem_send_raw(zm, ZRUB1);
}
break;
default: default:
if(zm->escape_all_control_characters && (c&0x60)==0) if(zm->escape_all_control_characters && (c&0x60)==0)
return zmodem_send_esc(zm, c); return zmodem_send_esc(zm, c);
......
...@@ -251,6 +251,7 @@ typedef struct { ...@@ -251,6 +251,7 @@ typedef struct {
long crc_request; long crc_request;
/* Configuration */ /* Configuration */
BOOL escape_telnet_iac;
unsigned send_timeout; unsigned send_timeout;
unsigned recv_timeout; unsigned recv_timeout;
unsigned max_errors; unsigned max_errors;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment