• src/smblib/smblib.c smbli

    From rswindell@VERT to CVS commit on Sunday, July 08, 2018 03:50:00
    src/smblib smblib.c 1.176 1.177 smblib.h 1.85 1.86
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/home/rswindell/sbbs/src/smblib

    Modified Files:
    smblib.c smblib.h
    Log Message:
    Re-write of smb_getmsgidx_by_time() - using a proper binary search
    algorithm now. Also, now returns the index offset of the matched index
    (if found), negative error value otherwise.

    I was testing something and noticed that the old smb_getmsgidx_by_time() implementation could sometimes return the index of a message posted before
    the requested time. That was fixed by re-writing the binary search logic.

    Also, I found it useful in my testing to have this function return the
    offset of the matching index (in addition to the index record itself), so checks of the return value need to compare >= SMB_SUCCESS, not just ==
    or != SMB_SUCCESS.



    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Tuesday, July 24, 2018 05:15:00
    src/smblib smblib.c 1.179 1.180 smblib.h 1.86 1.87
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/tmp/cvs-serv5685/smblib

    Modified Files:
    smblib.c smblib.h
    Log Message:
    Singificantlly improve message scan pointer initialization (e.g. for new
    users) and adjusting scan ptrs by date or set to "Last msg" while online:
    - speed (on my system, reduced from 12 to < 2 seconds)
    This involved 2 enhancements: check msgbase index file timestamp (fast)
    before opening any files. When opening the msgbase, just open the index
    file (no other msgbase files) - required new smblib function: smb_open_index. - fixed off-by-one when setting by date (when setting the new-scan ptr to
    Jan-1-2018, you want that first message posted on/after Jan-1-2018 to be
    found as "new", not the first message posted *after* that date.
    - re-added the fixmsgptrs() call in putmsgptrs(), inadvertently removed
    in the .ixb -> .ini ptr storage update in rev 1.192 of userdat.c.



    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net