1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 00:50:20 +02:00

ws/context: Increase write() visibility to public (#402)

This type is introduced to avoid confusion between the `.binary()` and `.write_raw()` methods on WebSocket contexts
This commit is contained in:
Tobias Bieniek
2018-07-19 19:04:13 +02:00
committed by Douman
parent 2988a84e5f
commit 0925a7691a
4 changed files with 31 additions and 20 deletions

View File

@@ -27,7 +27,7 @@ use client::{
Pipeline, SendRequest, SendRequestError,
};
use super::frame::Frame;
use super::frame::{Frame, FramedMessage};
use super::proto::{CloseReason, OpCode};
use super::{Message, ProtocolError, WsWriter};
@@ -529,10 +529,10 @@ pub struct ClientWriter {
impl ClientWriter {
/// Write payload
#[inline]
fn write(&mut self, mut data: Binary) {
fn write(&mut self, mut data: FramedMessage) {
let inner = self.inner.borrow_mut();
if !inner.closed {
let _ = inner.tx.unbounded_send(data.take());
let _ = inner.tx.unbounded_send(data.0.take());
} else {
warn!("Trying to write to disconnected response");
}