Skip to content
Snippets Groups Projects
Commit 5e8810ed authored by rswindell's avatar rswindell
Browse files

Significant upgrade (increased smblib version string to 2.40):

New smb.hash file uses multiple hashing methods (CRC-16, CRC-32 and MD5) to
calculate hashes of various "distinguishing marks" (e.g. message ID and body
text) to create a permanent history of message "fingerprints" that can be used
for duplicate message detection or fast location of messages based on one
of these "distinguishing marks". For example, reading each message header
in a message base to find a message with a specific message-ID (i.e.
how get_msg_by_id() currently works) significantly slows down message
importing with auto-thread linkage (a newly added feature). This hash file
will be used to speed this up considerably as well as improve duplicate
message detection.

This feature is supported with the following new smblib functions:
smb_findhash, smb_hashmsg, smb_hash, smb_msghashes, and smb_addhashes.

smb_addmsghdr() currently calls smb_hashmsg(), but this will probably change
with yet another new function call (smb_addmsg?) which will have access to the
body text (a very useful hash for duplicate message detection).

Existing SMB message bases will not have an existing .hash file (chksmb will
"missing hash" errors), but fixsmb can be used to create the .hash file for
existing message bases. Other than the chksmb errors, there are no real
problems with missing hashes, accept for the potential for failed auto-thread
linkage when importing replies to existing messages. Over time, this will fix
itself as new messages are imported and their hashes are stored automatically.

Projects using smblib now must link with crc16.c, crc32.c, and md5.c.

Other changes:
Created GETMSGTXT_TAIL_ONLY convenience macro.
smb_open/close_ha/da functions are now just macros to the new smb_open_fp and
smb_close_fp functions. These functions were 99% redundant.
New macros smb_open/close_hash also point to smb_open/close_fp.
More use of SAFEPRINTF macros and safe_snprintf().
parent f1f04b8a
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment