projects
/
invirt/third/libt4.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
All random numbers generated via one PRNG seeded in one place.
[invirt/third/libt4.git]
/
rpc
/
connection.cc
diff --git
a/rpc/connection.cc
b/rpc/connection.cc
index
31ec5fa
..
8966cc2
100644
(file)
--- a/
rpc/connection.cc
+++ b/
rpc/connection.cc
@@
-56,7
+56,7
@@
bool connection::send(const string & b) {
wpdu_ = {inflight, b, 0};
- if (lossy_ && (random()%100) < lossy_) {
+ if (std::bernoulli_distribution(lossy_*.01)(global->random_generator)) {
IF_LEVEL(1) LOG << "send LOSSY TEST shutdown fd " << fd;
shutdown(fd,SHUT_RDWR);
}