NLnetLabs / simdzone

Fast and standards compliant DNS zone parser
BSD 3-Clause "New" or "Revised" License
63 stars 11 forks source link

Consider non-padded fallback parse functions to eliminate need for padded input #174

Open k0ekk0ek opened 5 months ago

k0ekk0ek commented 5 months ago

The scanner copies the last block of input before analyzing, but many parse functions require the guarantee that input is properly padded. For parsing files this is fine because the logic is hidden from the user. For parsing string inputs this is not the case and the user is required to pass a null-terminated but padded string, which is somewhat of a weird interface. It is possible to return a specialized error code from advance if not enough data is available anymore to guarantee enough padding for vectorized operation and fallback to stricter fallback parsing in that case. For now it's a little too much to pickup for the initial release, but it may be a nice usability improvement for a future release.