diff options
| author | bwarsaw | 2001-05-14 18:16:30 +0000 |
|---|---|---|
| committer | bwarsaw | 2001-05-14 18:16:30 +0000 |
| commit | f04bb42e60fb9800b99c0b7bb36f198636d7b3ea (patch) | |
| tree | 463f7d149701a51063cdabc88e7c4eecb87089d1 /Mailman/SecurityManager.py | |
| parent | b0203e6fa189fa98523802031ca2e35dc98d73ed (diff) | |
| download | mailman-f04bb42e60fb9800b99c0b7bb36f198636d7b3ea.tar.gz mailman-f04bb42e60fb9800b99c0b7bb36f198636d7b3ea.tar.zst mailman-f04bb42e60fb9800b99c0b7bb36f198636d7b3ea.zip | |
enqueue(): The `received_time' metadata (which is set here once, but
only if it has no prior value), is encoded into the file name so that
we can guarantee FIFO order on the processed files. We can't encode
the received time in the file attributes because there isn't enough
precision (and I suspect that stat'ing all those files will be too
much of a disk I/O drain).
Instead, the filebase is composed of the string representation of the
current time in float seconds, the symbol `+', and the SHA1 hexdigest
of a hash of the uniquifying data. This makes it easy and quick to
decode received time for FIFO sorting, but retains the "random" digest
for bitrange slicing. Note that the received_time metadata value is
never changed once its set so the first part of the filebase will
remain unchanged as it moves between queues (while the hexdigest will
almost definitely change on each queue move).
dequeue(): Be more robust about missing .msg or .db files when the
other exists (usually, it'll be the .msg file that's missing). Return
None for either the msg or data part of the 2-tuple return value,
where None means "missing".
files(): Utililize the new file naming convention to break apart the
file name and sort the files in FIFO order, while still retaining the
bitrange random hash feature.
MarshalSwitchboard: All Python versions up to and including Python 2.1
have a bug in the marshal representation of binary floating point
numbers. Specifically, it loses precision that Mailman requires. The
solution in this class is to have a hardcoded list of known float
attributes, convert them to strings via repr() before marshaling the
dictionary, and convert them back to floats -- via a safe eval() --
when reading the marshal back from file.
Diffstat (limited to 'Mailman/SecurityManager.py')
0 files changed, 0 insertions, 0 deletions
