From 3220777ff989b922c7e124f63d296221316d9e87 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Fri, 29 Mar 2019 18:22:49 -0700 Subject: [PATCH] Added ws::Message::Nop, no-op websockets message --- actix-http/CHANGES.md | 6 +++++- actix-http/src/ws/codec.rs | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md index e9596349..5659597c 100644 --- a/actix-http/CHANGES.md +++ b/actix-http/CHANGES.md @@ -1,6 +1,10 @@ # Changes -## [0.1.0-alpha.2] - 2019-xx-xx +## [0.1.0-alpha.2] - 2019-03-29 + +### Added + +* Added ws::Message::Nop, no-op websockets message ### Changed diff --git a/actix-http/src/ws/codec.rs b/actix-http/src/ws/codec.rs index 286d15f8..ad599ffa 100644 --- a/actix-http/src/ws/codec.rs +++ b/actix-http/src/ws/codec.rs @@ -18,6 +18,8 @@ pub enum Message { Pong(String), /// Close message with optional reason Close(Option), + /// No-op. Useful for actix-net services + Nop, } /// `WebSocket` frame @@ -87,6 +89,7 @@ impl Encoder for Codec { Parser::write_message(dst, txt, OpCode::Pong, true, !self.server) } Message::Close(reason) => Parser::write_close(dst, reason, !self.server), + Message::Nop => (), } Ok(()) }