diff --git a/src/sbbs3/download.cpp b/src/sbbs3/download.cpp index 9c7e4d0d63db072df60c00296f4391ee73e62053..9d0c3d9a4d4dfc3f7314e4a259ded06f409743cc 100644 --- a/src/sbbs3/download.cpp +++ b/src/sbbs3/download.cpp @@ -104,25 +104,23 @@ const char* sbbs_t::protcmdline(prot_t* prot, enum XFER_TYPE type) return("invalid transfer type"); } -bool sbbs_t::data_transfer_begin() +void sbbs_t::data_transfer_begin(uchar& local_binary_tx, uchar& remote_binary_tx) { sys_status|=SS_FILEXFER; /* disable spy during file xfer */ - bool telnet_was_nvt = telnet_is_nvt(); + local_binary_tx = telnet_local_option[TELNET_BINARY_TX]; + remote_binary_tx = telnet_remote_option[TELNET_BINARY_TX]; /* enable telnet binary transmission in both directions */ request_telnet_opt(TELNET_DO,TELNET_BINARY_TX); request_telnet_opt(TELNET_WILL,TELNET_BINARY_TX); console |= CON_RAW_IN; - return telnet_was_nvt; } -void sbbs_t::data_transfer_end(bool telnet_was_nvt) +void sbbs_t::data_transfer_end(uchar local_binary_tx, uchar remote_binary_tx) { sys_status&=~SS_FILEXFER; - if(telnet_was_nvt) { - /* Got back to Text/NVT mode */ - request_telnet_opt(TELNET_DONT,TELNET_BINARY_TX); - request_telnet_opt(TELNET_WONT,TELNET_BINARY_TX); - } + /* Got back to Text/NVT mode */ + request_telnet_opt(local_binary_tx, TELNET_BINARY_TX); + request_telnet_opt(remote_binary_tx, TELNET_BINARY_TX); console &= ~CON_RAW_IN; } @@ -168,11 +166,12 @@ int sbbs_t::protocol(prot_t* prot, enum XFER_TYPE type cmdline=cmdstr(protcmdline(prot,type), fpath, fspec, NULL, ex_mode); SAFEPRINTF(msg,"Transferring %s",cmdline); spymsg(msg); - bool was_nvt_mode = data_transfer_begin(); + uchar local_binary_tx, remote_binary_tx; + data_transfer_begin(local_binary_tx, remote_binary_tx); time_t start = time(NULL); i=external(cmdline,ex_mode,p); time_t end = time(NULL); - data_transfer_end(was_nvt_mode); + data_transfer_end(local_binary_tx, remote_binary_tx); // Save DSZLOG to logfile if((stream=fnopen(NULL,protlog,O_RDONLY))!=NULL) { diff --git a/src/sbbs3/sbbs.h b/src/sbbs3/sbbs.h index 7e45978efa24ba57c19d5aae62a139814f4f8e32..9dfa9a92aa4fc155030429450598a5a83a068960 100644 --- a/src/sbbs3/sbbs.h +++ b/src/sbbs3/sbbs.h @@ -539,11 +539,6 @@ public: int telnet_rows = 0; int telnet_cols = 0; int telnet_speed = 0; - bool telnet_is_nvt() { - return !(telnet_mode & TELNET_MODE_OFF) - && telnet_local_option[TELNET_BINARY_TX] != TELNET_DO - && telnet_remote_option[TELNET_BINARY_TX] != TELNET_WILL; - } xpevent_t telnet_ack_event; @@ -1174,8 +1169,8 @@ public: bool bulkupload(int dirnum); /* download.cpp */ - bool data_transfer_begin(void); - void data_transfer_end(bool was_telnet_nvt_mode); + void data_transfer_begin(uchar& local_binary_tx, uchar& remote_binary_tx); + void data_transfer_end(uchar local_binary_tx, uchar remote_binary_tx); void downloadedfile(file_t* f); void notdownloaded(off_t size, time_t elapsed); void downloadedbytes(off_t size, time_t elapsed);