diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-04-09 11:30:46 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-04-09 11:30:46 -0400 |
commit | 3aa44159c53af1d6459a85dc1841c7c494d52464 (patch) | |
tree | bf545d67d57ab47bb0f262a3a9e78394c64162c0 /bufferevent-internal.h | |
parent | e86af4b7e56ed5b7050cb4f41ae534f54748598c (diff) | |
download | libevent-3aa44159c53af1d6459a85dc1841c7c494d52464.tar.gz |
Tweak the new evutil_weakrand_() code
Make its state actually get seeded.
Document it more thoroughly.
Turn its state into a structure.
Fix a bug in evutil_weakrand_range_() where it could return the top of
the range.
Change its return type to ev_int32_t.
Add a quick unit test to make sure that the value of
evutil_weakrand_range_() is in range.
Diffstat (limited to 'bufferevent-internal.h')
-rw-r--r-- | bufferevent-internal.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bufferevent-internal.h b/bufferevent-internal.h index ad2c25c7..461c46e7 100644 --- a/bufferevent-internal.h +++ b/bufferevent-internal.h @@ -105,8 +105,8 @@ struct bufferevent_rate_limit_group { * to refill. */ struct event master_refill_event; - /** Seed for weak random number generator. */ - ev_uint32_t weakrand_seed; + /** Seed for weak random number generator. Protected by 'lock' */ + struct evutil_weakrand_state weakrand_seed; /** Lock to protect the members of this group. This lock should nest * within every bufferevent lock: if you are holding this lock, do |