2 次代码提交 4f993b3613 ... f5eac5a976

作者 SHA1 备注 提交日期
  Justin Tracey f5eac5a976 README: add a note about repo status 3 月之前
  Justin Tracey 020aeedb68 client: nit: no need to specify tokio sleep 3 月之前
共有 2 个文件被更改,包括 8 次插入5 次删除
  1. 3 0
      README.md
  2. 5 5
      src/bin/mgen-client.rs

+ 3 - 0
README.md

@@ -1,5 +1,8 @@
 ## MGen
 
+### N.B.: This work will soon be under submission.
+Please do not share this repo too widely yet to help maintain double-blind reviewing.
+
 MGen is a set of tools for generating simulated messenger traffic.
 It is designed for use analogous to (and likely in conjunction with) [TGen](https://github.com/shadow/tgen), but for simulating traffic generated from communications in messenger apps, such as Signal or WhatsApp, rather than web traffic or file downloads.
 Notably, this allows for studying network traffic properties of messenger apps in [Shadow](https://github.com/shadow/shadow).

+ 5 - 5
src/bin/mgen-client.rs

@@ -191,7 +191,7 @@ async fn reader(
                         let mut res = client.get(url.clone()).await;
                         while res.is_err() {
                             log!("Error fetching: {}", res.unwrap_err());
-                            tokio::time::sleep(retry).await;
+                            sleep(retry).await;
                             res = client.get(url.clone()).await;
                         }
                     });
@@ -260,7 +260,7 @@ async fn uploader(
             let mut res = client.request(request).await;
             while res.is_err() {
                 log!("{},{},Error uploading: {}", user, url, res.unwrap_err());
-                tokio::time::sleep(retry).await;
+                sleep(retry).await;
                 res = client.get(url.clone()).await;
             }
         }
@@ -324,7 +324,7 @@ async fn socket_updater(
                     str_params.recipient,
                     e
                 );
-                tokio::time::sleep(retry).await;
+                sleep(retry).await;
                 continue;
             }
             Err(MessengerError::Fatal(e)) => return e,
@@ -339,7 +339,7 @@ async fn socket_updater(
                     str_params.recipient,
                     e
                 );
-                tokio::time::sleep(retry).await;
+                sleep(retry).await;
                 continue;
             }
         };
@@ -379,7 +379,7 @@ async fn manage_conversation(
     mut state_from_reader: StateFromReader,
     mut state_to_writer: StateToWriter<MessageHolder>,
 ) {
-    tokio::time::sleep(Duration::from_secs_f64(config.bootstrap)).await;
+    sleep(Duration::from_secs_f64(config.bootstrap)).await;
     log!("{},{},awake", &config.user, &config.group);
 
     let mut rng = Xoshiro256PlusPlus::from_entropy();