~nickbp/tokio-scgi

4edb755a77b4aa578c0b1551bac2ad7e55ee5bc3 — Nick Parker 10 months ago 68cc874
Update tokio/tokio-util
7 files changed, 13 insertions(+), 15 deletions(-)

M Cargo.toml
M examples/client.rs
M examples/server.rs
M src/client.rs
M src/lib.rs
M src/server.rs
M tests/property_tests.rs
M Cargo.toml => Cargo.toml +3 -3
@@ 14,10 14,10 @@ repository = "https://github.com/nickbp/tokio-scgi"
exclude = ["README.md", "images/"]

[dependencies]
bytes = "0.5"
bytes = "0.6"
futures = "0.3"
tokio = { version = "0.2", features = ["io-util", "macros", "rt-core", "tcp", "uds"] }
tokio-util = { version = "0.2", features = ["codec"] }
tokio = { version = "0.3", features = ["io-util", "macros", "net", "rt-multi-thread"] }
tokio-util = { version = "0.5", features = ["codec"] }

[dev-dependencies]
proptest = "0.10"

M examples/client.rs => examples/client.rs +1 -1
@@ 1,4 1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![deny(warnings)]

use bytes::{BufMut, BytesMut};
use futures::{SinkExt, StreamExt};

M examples/server.rs => examples/server.rs +3 -3
@@ 1,4 1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![deny(warnings)]

use bytes::{BufMut, BytesMut};
use futures::{SinkExt, StreamExt};


@@ 36,7 36,7 @@ async fn main() -> Result<(), std::io::Error> {

    if endpoint.contains('/') {
        // Probably a path to a file, assume the argument is a unix socket
        let mut bind = unix_init(endpoint)?;
        let bind = unix_init(endpoint)?;
        loop {
            let (conn, _addr) = bind.accept().await?;
            task::spawn(async move {


@@ 52,7 52,7 @@ async fn main() -> Result<(), std::io::Error> {
        }
    } else {
        // Probably a TCP endpoint, try to resolve it in case it's a hostname
        let mut bind = tcp_init(endpoint).await?;
        let bind = tcp_init(endpoint).await?;
        loop {
            let (conn, addr) = bind.accept().await?;
            task::spawn(async move {

M src/client.rs => src/client.rs +2 -3
@@ 1,4 1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![deny(warnings)]

use bytes::{BufMut, BytesMut};
use std::io;


@@ 47,8 47,7 @@ impl Decoder for SCGICodec {

/// Creates and produces SCGI requests. Invoke once with `Request`, followed by zero or more calls
/// with `BodyFragment`.
impl Encoder for SCGICodec {
    type Item = SCGIRequest;
impl Encoder<SCGIRequest> for SCGICodec {
    type Error = io::Error;

    fn encode(&mut self, data: SCGIRequest, buf: &mut BytesMut) -> Result<(), io::Error> {

M src/lib.rs => src/lib.rs +1 -1
@@ 1,4 1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![deny(warnings)]

//! SCGI request codec for Tokio.
//!

M src/server.rs => src/server.rs +2 -3
@@ 1,4 1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![deny(warnings)]

use bytes::{Buf, BufMut, BytesMut};
use std::{io, mem};


@@ 269,8 269,7 @@ fn consume_header_string(bytes_with_nul: BytesMut) -> Result<String, io::Error> 
}

/// Forwards a raw response to an SCGI request back to the client.
impl Encoder for SCGICodec {
    type Item = Vec<u8>;
impl Encoder<Vec<u8>> for SCGICodec {
    type Error = io::Error;

    fn encode(&mut self, data: Vec<u8>, buf: &mut BytesMut) -> Result<(), io::Error> {

M tests/property_tests.rs => tests/property_tests.rs +1 -1
@@ 1,4 1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![deny(warnings)]

use bytes::{BufMut, BytesMut};
use proptest::prelude::*;