Alright!
I have had this code up and running for a while now, and I noticed something... And of course I do not know how to fix it!
Under Erwin's Board system there appears to be a point where no new notes can be -saved- on any of the boards over a reboot and Im not sure why this happens. But I did look through my log file and found these two entries:
I grepped for these phrases and found:
from db.c
and from board.c in the function load_board
Now being totally stumped on this, Im not sure why the board system will only load up 8 total posts but save all the rest into the ../notes directory.
Any ideas?
I have had this code up and running for a while now, and I noticed something... And of course I do not know how to fix it!
Under Erwin's Board system there appears to be a point where no new notes can be -saved- on any of the boards over a reboot and Im not sure why this happens. But I did look through my log file and found these two entries:
Sat Jan 1 17:41:38 2005 :: Loading Global Boards
Sat Jan 1 17:41:38 2005 :: [*****] BUG: fread_string: string too long
Sat Jan 1 17:41:38 2005 :: [*****] BUG: Load_notes: bad key word.
I grepped for these phrases and found:
from db.c
if ( ln >= (MAX_STRING_LENGTH - 1) )
{
bug( "fread_string: string too long" );
*plast = '\0';
return STRALLOC( buf );
}
and from board.c in the function load_board
void load_board( GLOBAL_BOARD_DATA *board )
{
FILE *fp, *fp_archive;
NOTE_DATA *last_note;
char filename[200];
sprintf (filename, "%s%s", NOTE_DIR, board->short_name);
fp = fopen (filename, "r");
/* Silently return */
if (!fp)
return;
/* Start note fetching. copy of db.c: load_notes() */
last_note = NULL;
for ( ; ; )
{
NOTE_DATA *pnote;
char letter;
do
{
letter = getc( fp );
if ( feof(fp) )
{
fclose( fp );
return;
}
}
while ( isspace(letter) );
ungetc( letter, fp );
CREATE( pnote, NOTE_DATA, sizeof( *pnote ) );
if ( str_cmp( fread_word( fp ), "sender" ) )
break;
pnote->sender = fread_string( fp );
if ( str_cmp( fread_word( fp ), "date" ) )
break;
pnote->date = fread_string( fp );
if ( str_cmp( fread_word( fp ), "stamp" ) )
break;
pnote->date_stamp = fread_number( fp );
if ( str_cmp( fread_word( fp ), "expire" ) )
break;
pnote->expire = fread_number( fp );
if ( str_cmp( fread_word( fp ), "to" ) )
break;
pnote->to_list = fread_string( fp );
if ( str_cmp( fread_word( fp ), "subject" ) )
break;
pnote->subject = fread_string( fp );
if ( str_cmp( fread_word( fp ), "text" ) )
break;
pnote->text = fread_string( fp );
pnote->next = NULL; /* jic */
/* Should this note be archived right now ? */
if (pnote->expire < current_time)
{
char archive_name[200];
sprintf (archive_name, "%s%s.old", NOTE_DIR, board->short_name);
fp_archive = fopen (archive_name, "a");
if (!fp_archive)
bug ("Could not open archive boards for writing",0);
else
{
append_note (fp_archive, pnote);
fclose (fp_archive); /* it might be more efficient to close this later */
}
free_global_note (pnote);
board->changed = TRUE;
continue;
}
if ( board->note_first == NULL )
board->note_first = pnote;
else
last_note->next = pnote;
}
bug( "Load_notes: bad key word.", 0 );
return; /* just return */
}
Now being totally stumped on this, Im not sure why the board system will only load up 8 total posts but save all the rest into the ../notes directory.
Any ideas?