summaryrefslogtreecommitdiff
path: root/src/message.rs
diff options
context:
space:
mode:
authorStuart Stock <stuart@int08h.com>2019-02-10 18:41:44 -0600
committerStuart Stock <stuart@int08h.com>2019-02-10 18:41:44 -0600
commit177372f63a33b25a075c4cba446319929950b0f8 (patch)
tree5f274bf2f4874a6dc66770c71cf1a036432f122f /src/message.rs
parent62e6dd64a276dbf8e10cbe6a4111f0cfb98d163f (diff)
downloadroughenough-177372f63a33b25a075c4cba446319929950b0f8.zip
initial version of client response mangling
Diffstat (limited to 'src/message.rs')
-rw-r--r--src/message.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/message.rs b/src/message.rs
index d598dee..fea3014 100644
--- a/src/message.rs
+++ b/src/message.rs
@@ -69,6 +69,19 @@ impl RtMessage {
}
}
+ ///
+ /// Dangerous: construct a new RtMessage **without validation or error checking**.
+ ///
+ /// Intended _only_ for construction of deliberately bogus responses as part of [Roughtime's
+ /// ecosystem](https://roughtime.googlesource.com/roughtime/+/HEAD/ECOSYSTEM.md#maintaining-a-healthy-software-ecosystem).
+ ///
+ pub fn new_deliberately_invalid(tags: Vec<Tag>, values: Vec<Vec<u8>>) -> Self {
+ RtMessage {
+ tags,
+ values,
+ }
+ }
+
/// Internal function to create a single tag message
fn single_tag_message(bytes: &[u8], msg: &mut Cursor<&[u8]>) -> Result<Self, Error> {
if bytes.len() < 8 {