Random fixes
This commit is contained in:
@@ -60,22 +60,28 @@ void FidoArea::raw_scan(bool __scanpm) {
|
||||
register ulong* _msgndx = Msgn->tag;
|
||||
|
||||
gposixdir d(real_path());
|
||||
if(WideDebug)
|
||||
WideLog->printf("- %s/*.msg", d.fullpath());
|
||||
const gdirentry *de;
|
||||
while((de = d.nextentry("*.msg", true)) != NULL) {
|
||||
if(d.ok) {
|
||||
if(WideDebug)
|
||||
WideLog->printf("- %s", de->name.c_str());
|
||||
register ulong _msgno = (ulong)atol(de->name.c_str());
|
||||
if(_msgno) {
|
||||
if((_active % FIDO_SCANBUFSIZE) == 0) {
|
||||
_msgndx = Msgn->Resize(_active+FIDO_SCANBUFSIZE);
|
||||
_msgnoptr = _msgndx + _active;
|
||||
WideLog->printf("- %s/*.msg", d.fullpath());
|
||||
const gdirentry *de;
|
||||
while((de = d.nextentry("*.msg", true)) != NULL) {
|
||||
if(WideDebug)
|
||||
WideLog->printf("- %s", de->name.c_str());
|
||||
register ulong _msgno = (ulong)atol(de->name.c_str());
|
||||
if(_msgno) {
|
||||
if((_active % FIDO_SCANBUFSIZE) == 0) {
|
||||
_msgndx = Msgn->Resize(_active+FIDO_SCANBUFSIZE);
|
||||
_msgnoptr = _msgndx + _active;
|
||||
}
|
||||
*_msgnoptr++ = _msgno;
|
||||
_active++;
|
||||
}
|
||||
*_msgnoptr++ = _msgno;
|
||||
_active++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(WideDebug)
|
||||
WideLog->printf("- Invalid path: %s", real_path());
|
||||
}
|
||||
|
||||
// Sort the index
|
||||
Msgn->SetCount(_active);
|
||||
|
@@ -343,6 +343,11 @@ extern JamData* jamdata;
|
||||
extern int jamdatano;
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
char *jamstrlwr(char *str);
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
#endif
|
||||
|
@@ -67,7 +67,7 @@ void JamInit(const char* jampath, int harddelete, int jamsmapihw) {
|
||||
|
||||
// Calculate CRC32 of our username for the lastreads
|
||||
INam _name;
|
||||
strlwr(strcpy(_name, WideUsername[0]));
|
||||
jamstrlwr(strcpy(_name, WideUsername[0]));
|
||||
jamwide->userid = jamwide->usercrc = strCrc32(_name, NO, CRC32_MASK_CCITT);
|
||||
|
||||
// Enable replies lookahead feature
|
||||
@@ -216,3 +216,15 @@ void JamArea::resume() {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
char *jamstrlwr(char *str) {
|
||||
|
||||
char *p = str;
|
||||
while(*p) {
|
||||
if((*p >= 'A') && (*p <= 'Z'))
|
||||
*p = *p - 'A' + 'a';
|
||||
++p;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
@@ -287,7 +287,7 @@ void JamArea::raw_scan(int __keep_index, int __scanpm) {
|
||||
int umax = (WidePersonalmail & PM_ALLNAMES) ? WideUsernames : 1;
|
||||
dword* ucrc = (dword*)throw_calloc(umax, sizeof(dword));
|
||||
for(int uc=0; uc<umax; uc++) {
|
||||
strlwr(strcpy(uname, WideUsername[uc]));
|
||||
jamstrlwr(strcpy(uname, WideUsername[uc]));
|
||||
ucrc[uc] = strCrc32(uname, NO, CRC32_MASK_CCITT);
|
||||
}
|
||||
PMrk->ResetAll();
|
||||
|
@@ -324,9 +324,9 @@ void JamArea::save_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
|
||||
__hdr.timesread = __msg->timesread;
|
||||
__hdr.passwordcrc = 0xFFFFFFFFL;
|
||||
|
||||
__hdr.msgidcrc = strCrc32(strlwr(strcpy(_buf, __msg->msgids)), NO, CRC32_MASK_CCITT);
|
||||
__hdr.replycrc = strCrc32(strlwr(strcpy(_buf, __msg->replys)), NO, CRC32_MASK_CCITT);
|
||||
_idx.usercrc = strCrc32(strlwr(strcpy(_buf, __msg->to)), NO, CRC32_MASK_CCITT);
|
||||
__hdr.msgidcrc = strCrc32(jamstrlwr(strcpy(_buf, __msg->msgids)), NO, CRC32_MASK_CCITT);
|
||||
__hdr.replycrc = strCrc32(jamstrlwr(strcpy(_buf, __msg->replys)), NO, CRC32_MASK_CCITT);
|
||||
_idx.usercrc = strCrc32(jamstrlwr(strcpy(_buf, __msg->to)), NO, CRC32_MASK_CCITT);
|
||||
|
||||
__hdr.datewritten = __msg->written;
|
||||
__hdr.datereceived = __msg->received;
|
||||
|
@@ -222,8 +222,24 @@ void SquishArea::raw_scan(int __keep_index, int __scanpm) {
|
||||
for(int u=0; u<umax; u++) {
|
||||
if((idx->hash & 0x80000000LU) == 0) {
|
||||
if(idx->hash == uhash[u]) {
|
||||
gotpm = true;
|
||||
break;
|
||||
// Open, read and close data file
|
||||
if(not isopen)
|
||||
data->fhsqd = ::sopen(AddPath(real_path(), ".sqd"), O_RDONLY|O_BINARY, WideSharemode, S_STDRD);
|
||||
if(data->fhsqd != -1) {
|
||||
lseekset(data->fhsqd, idx->offset + sizeof(SqshFrm));
|
||||
// Load the message header
|
||||
SqshHdr __hdr;
|
||||
memset(&__hdr, 0, sizeof(SqshHdr));
|
||||
read(data->fhsqd, &__hdr, sizeof(SqshHdr));
|
||||
if(not isopen) {
|
||||
::close(data->fhsqd);
|
||||
data->fhsqd = -1;
|
||||
}
|
||||
if(streql(__hdr.to, WideUsername[u])) {
|
||||
gotpm = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user