Commits (6)
......@@ -30,6 +30,7 @@ void sbbs_t::batchmenu()
char str[129],tmp2[250],done=0,ch;
char tmp[512];
char keys[32];
BOOL sort = -1;
uint i,n,xfrprot,xfrdir;
int64_t totalcdt,totalsize;
time_t start,end;
......@@ -93,14 +94,14 @@ void sbbs_t::batchmenu()
break;
case 'L':
{
bool sort = !noyes(text[SortAlphaQ]);
ini = batch_list_read(&cfg, useron.number, XFER_BATCH_UPLOAD);
filenames = iniGetSectionList(ini, NULL);
if(strListCount(filenames)) {
sort = !noyes(text[SortAlphaQ]);
if(sort)
strListSortAlphaCase(filenames);
bputs(text[UploadQueueLstHdr]);
for(size_t i = 0; filenames[i]; ++i) {
for(size_t i = 0; filenames[i] != NULL && !msgabort(); ++i) {
const char* filename = filenames[i];
char value[INI_MAX_VALUE_LEN];
bprintf(text[UploadQueueLstFmt]
......@@ -118,10 +119,12 @@ void sbbs_t::batchmenu()
ini = batch_list_read(&cfg, useron.number, XFER_BATCH_DOWNLOAD);
filenames = iniGetSectionList(ini, NULL);
if(strListCount(filenames)) {
if(sort == -1)
sort = !noyes(text[SortAlphaQ]);
if(sort)
strListSortAlphaCase(filenames);
bputs(text[DownloadQueueLstHdr]);
for(size_t i = 0; filenames[i]; ++i) {
for(size_t i = 0; filenames[i] && !msgabort(); ++i) {
const char* filename = filenames[i];
file_t f = {{}};
if(!batch_file_load(&cfg, ini, filename, &f))
......@@ -141,14 +144,19 @@ void sbbs_t::batchmenu()
totalcdt += f.cost;
smb_freefilemem(&f);
}
bprintf(text[DownloadQueueTotals]
,byte_estimate_to_str(totalcdt, tmp, sizeof(tmp), 1, 1)
,byte_estimate_to_str(totalsize, str, sizeof(tmp), 1, 1)
,cur_cps ? sectostr((uint)(totalsize/(uint64_t)cur_cps), tmp2) : "??:??:??");
if(!msgabort())
bprintf(text[DownloadQueueTotals]
,byte_estimate_to_str(totalcdt, tmp, sizeof(tmp), 1, 1)
,byte_estimate_to_str(totalsize, str, sizeof(tmp), 1, 1)
,cur_cps ? sectostr((uint)(totalsize/(uint64_t)cur_cps), tmp2) : "??:??:??");
} else
bputs(text[DownloadQueueIsEmpty]);
iniFreeStringList(filenames);
iniFreeStringList(ini);
if(sort == TRUE) {
batch_list_sort(&cfg, useron.number, XFER_BATCH_UPLOAD);
batch_list_sort(&cfg, useron.number, XFER_BATCH_DOWNLOAD);
}
break;
}
case 'R':
......@@ -262,12 +270,14 @@ BOOL sbbs_t::start_batch_download()
uint64_t totalcdt = 0;
for(size_t i=0; filenames[i] != NULL; ++i) {
progress(text[Scanning], i, file_count);
file_t f = {{}};
if(batch_file_load(&cfg, ini, filenames[i], &f)) {
totalcdt += f.cost;
smb_freefilemem(&f);
}
}
bputs(text[Scanned]);
if(totalcdt > useron.cdt+useron.freecdt) {
bprintf(text[YouOnlyHaveNCredits]
,u64toac(useron.cdt+useron.freecdt,tmp));
......@@ -410,6 +420,8 @@ bool sbbs_t::create_batchdn_lst(bool native)
errormsg(WHERE, ERR_OPEN, path);
return false;
}
const char* list_desc = "Batch Download File List";
bprintf(text[CreatingFileList], list_desc);
str_list_t ini = batch_list_read(&cfg, useron.number, XFER_BATCH_DOWNLOAD);
str_list_t filenames = iniGetSectionList(ini, /* prefix: */NULL);
for(size_t i = 0; filenames[i] != NULL; ++i) {
......@@ -441,6 +453,7 @@ bool sbbs_t::create_batchdn_lst(bool native)
fclose(fp);
iniFreeStringList(ini);
iniFreeStringList(filenames);
bprintf(text[CreatedFileList], list_desc);
return true;
}
......
......@@ -1399,7 +1399,7 @@ void sbbs_t::progress(const char* text, int count, int total, int interval)
if(cfg.node_num == 0)
return; // Don't output this for events
double now = xp_timer();
if((now - last_progress) * 1000 < interval)
if(count < total && (now - last_progress) * 1000 < interval)
return;
if(text == NULL) text = "";
float pct = total ? ((float)count/total)*100.0F : 100.0F;
......
......@@ -147,6 +147,7 @@ void vdd_getstatus(vdd_status_t* status)
memset(status,0,sizeof(vdd_status_t));
}
#define HAPPY_PORT_STATUS FOSSIL_MDM_STATUS_DCD_CHNG | FOSSIL_MDM_STATUS_DCD | FOSSIL_MDM_STATUS_CTS | FOSSIL_LINE_STATUS_THRE | FOSSIL_LINE_STATUS_TSRE
WORD PortStatus()
{
WORD status=FOSSIL_MDM_STATUS_DCD_CHNG; /* AL bit 3 (change in DCD) always set */
......@@ -170,6 +171,9 @@ WORD PortStatus()
if(!vdd_status.outbuf_full) /* output buffer is empty */
status|=FOSSIL_LINE_STATUS_TSRE;
if(vdd_status.outbuf_full < vdd_status.outbuf_size)
status|=FOSSIL_MDM_STATUS_CTS;
return(status);
}
......@@ -263,7 +267,7 @@ void interrupt winNTint14(
break;
case FOSSIL_FUNC_GET_STATUS: /* request status */
_ax=PortStatus();
if(_ax == FOSSIL_MDM_STATUS_DCD_CHNG | FOSSIL_MDM_STATUS_DCD | FOSSIL_LINE_STATUS_THRE | FOSSIL_LINE_STATUS_TSRE)
if(_ax == HAPPY_PORT_STATUS)
vdd_op(VDD_MAYBE_YIELD);
break;
case FOSSIL_FUNC_INIT: /* initialize */
......
......@@ -572,6 +572,8 @@ void sbbs_t::set_mouse(long flags)
struct mouse_hotspot* sbbs_t::add_hotspot(struct mouse_hotspot* spot)
{
if(!term_supports(MOUSE))
return NULL;
if(spot->y < 0)
spot->y = row;
if(spot->minx < 0)
......
......@@ -66,7 +66,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;WIN32;_CONSOLE;SBBS_EXPORTS;RINGBUF_SEM;RINGBUF_EVENT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;WIN32;_CONSOLE;SBBS_EXPORTS;RINGBUF_SEM;RINGBUF_EVENT;RINGBUF_MUTEX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeaderOutputFile>.\msvc.win32.debug\sexyz/sexyz.pch</PrecompiledHeaderOutputFile>
......@@ -110,7 +110,7 @@
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;WIN32;_CONSOLE;SBBS_EXPORTS;RINGBUF_SEM;RINGBUF_EVENT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;WIN32;_CONSOLE;SBBS_EXPORTS;RINGBUF_SEM;RINGBUF_EVENT;RINGBUF_MUTEX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
......
......@@ -848,7 +848,7 @@ int zmodem_recv_data32(zmodem_t* zm, unsigned char * p, unsigned maxlen, unsigne
break;
if(*len >= maxlen) {
lprintf(zm, LOG_ERR, "%lu Subpacket OVERFLOW (%u > %u)",(ulong)zm->ack_file_pos, *len, maxlen);
lprintf(zm, LOG_ERR, "%lu Subpacket OVERFLOW (%u >= %u)",(ulong)zm->ack_file_pos, *len, maxlen);
return SUBPKTOVERFLOW;
}
crc = ucrc32(c,crc);
......