Skip to content
Snippets Groups Projects
Commit 0360643a authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Suspend RIP processing for file transfers

parent 3a25c009
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #1520 passed
...@@ -97,6 +97,7 @@ static uint8_t *ripbuf = NULL; ...@@ -97,6 +97,7 @@ static uint8_t *ripbuf = NULL;
static size_t ripbuf_size = 0; static size_t ripbuf_size = 0;
static size_t ripbuf_pos = 0; static size_t ripbuf_pos = 0;
static size_t ripbufpos = 0; static size_t ripbufpos = 0;
static bool rip_suspended = false;
   
static struct mouse_field *rip_pressed = NULL; static struct mouse_field *rip_pressed = NULL;
   
...@@ -13157,6 +13158,23 @@ init_rip(int enabled) ...@@ -13157,6 +13158,23 @@ init_rip(int enabled)
} }
} }
   
void
suspend_rip(bool suspend)
{
if (suspend) {
if (rip.enabled) {
rip_suspended = true;
rip.enabled = false;
}
}
else {
if (rip_suspended) {
rip_suspended = false;
rip.enabled = true;
}
}
}
int int
rip_kbhit(void) rip_kbhit(void)
{ {
......
...@@ -5,5 +5,6 @@ void init_rip(int enabled); ...@@ -5,5 +5,6 @@ void init_rip(int enabled);
size_t parse_rip(BYTE *buf, unsigned blen, unsigned maxlen); size_t parse_rip(BYTE *buf, unsigned blen, unsigned maxlen);
int rip_getch(void); int rip_getch(void);
int rip_kbhit(void); int rip_kbhit(void);
void suspend_rip(bool suspend);
#endif #endif
...@@ -875,6 +875,7 @@ void begin_upload(struct bbslist *bbs, BOOL autozm, int lastch) ...@@ -875,6 +875,7 @@ void begin_upload(struct bbslist *bbs, BOOL autozm, int lastch)
} }
setvbuf(fp,NULL,_IOFBF,0x10000); setvbuf(fp,NULL,_IOFBF,0x10000);
suspend_rip(true);
if(autozm) if(autozm)
zmodem_upload(bbs, fp, path); zmodem_upload(bbs, fp, path);
else { else {
...@@ -904,6 +905,7 @@ void begin_upload(struct bbslist *bbs, BOOL autozm, int lastch) ...@@ -904,6 +905,7 @@ void begin_upload(struct bbslist *bbs, BOOL autozm, int lastch)
break; break;
} }
} }
suspend_rip(false);
uifcbail(); uifcbail();
restorescreen(savscrn); restorescreen(savscrn);
freescreen(savscrn); freescreen(savscrn);
...@@ -941,6 +943,7 @@ void begin_download(struct bbslist *bbs) ...@@ -941,6 +943,7 @@ void begin_download(struct bbslist *bbs)
i=0; i=0;
uifc.helpbuf="Select Protocol"; uifc.helpbuf="Select Protocol";
hold_update=FALSE; hold_update=FALSE;
suspend_rip(true);
switch(uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,NULL,"Protocol",opts)) { switch(uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,NULL,"Protocol",opts)) {
case -1: case -1:
check_exit(FALSE); check_exit(FALSE);
...@@ -963,6 +966,7 @@ void begin_download(struct bbslist *bbs) ...@@ -963,6 +966,7 @@ void begin_download(struct bbslist *bbs)
xmodem_download(bbs, XMODEM|RECV,path); xmodem_download(bbs, XMODEM|RECV,path);
break; break;
} }
suspend_rip(false);
hold_update=old_hold; hold_update=old_hold;
uifcbail(); uifcbail();
restorescreen(savscrn); restorescreen(savscrn);
...@@ -2613,11 +2617,13 @@ BOOL doterm(struct bbslist *bbs) ...@@ -2613,11 +2617,13 @@ BOOL doterm(struct bbslist *bbs)
zrqbuf[++j]=0; zrqbuf[++j]=0;
if(j==sizeof(zrqinit)-1) { /* Have full sequence (Assumes zrinit and zrqinit are same length */ if(j==sizeof(zrqinit)-1) { /* Have full sequence (Assumes zrinit and zrqinit are same length */
WRITE_OUTBUF(); WRITE_OUTBUF();
suspend_rip(true);
if(!strcmp((char *)zrqbuf, (char *)zrqinit)) if(!strcmp((char *)zrqbuf, (char *)zrqinit))
zmodem_download(bbs); zmodem_download(bbs);
else else
begin_upload(bbs, TRUE, inch); begin_upload(bbs, TRUE, inch);
setup_mouse_events(&ms); setup_mouse_events(&ms);
suspend_rip(false);
zrqbuf[0]=0; zrqbuf[0]=0;
remain=1; remain=1;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment