Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

codec: check serialization result length #496

Open
wants to merge 7 commits into
base: v0.5.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:
RUST_BACKTRACE: 1
RUSTFLAGS: "--deny=warnings"
GRPC_VERSION: 1.26.0
TEST_BIND: 1

jobs:
Linux-Format-PKG-Test:
Expand All @@ -37,7 +38,8 @@ jobs:
- uses: actions/checkout@v2
- run: which go && go version && which cargo && cargo version && clang --version && openssl version
- run: scripts/reset-submodule.cmd
- run: scripts/generate-bindings.sh && git diff --exit-code HEAD
- run: env TEST_BIND=0 scripts/generate-bindings.sh && git diff --exit-code HEAD
- run: scripts/generate-bindings.sh
- run: cargo build --no-default-features
- run: cargo build --no-default-features --features protobuf-codec
- run: cargo build --no-default-features --features prost-codec
Expand Down Expand Up @@ -103,4 +105,4 @@ jobs:
- run: go version ; cargo version ; cmake --version
- run: scripts/reset-submodule.cmd
- run: cargo build
- run: cargo test --all
- run: cargo test --all
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:
global:
- RUST_BACKTRACE=1
- RUSTFLAGS="--deny=warnings"
- TEST_BIND=1

install:
- if ! which go 2>/dev/null; then
Expand Down Expand Up @@ -72,12 +73,13 @@ jobs:
- which go && go version
- if [[ $TRAVIS_OS_NAME == "linux" ]] && [[ $TRAVIS_RUST_VERSION == "stable" ]]; then
rustup component add rustfmt && cargo fmt --all -- --check;
scripts/generate-bindings.sh && git diff --exit-code HEAD;
env TEST_BIND=0 scripts/generate-bindings.sh && git diff --exit-code HEAD;
fi
- ./scripts/generate-bindings.sh
- cargo build --no-default-features
- cargo build --no-default-features --features protobuf-codec
- cargo build --no-default-features --features prost-codec
- cargo build
- cargo test --all
- cargo test --features "openssl" --all
- cargo test --features "openssl-vendored" --all
- cargo test --features "openssl-vendored" --all
5 changes: 3 additions & 2 deletions benchmark/src/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ impl Generic {

#[inline]
#[allow(clippy::ptr_arg)]
pub fn bin_ser(t: &Vec<u8>, buf: &mut Vec<u8>) {
buf.extend_from_slice(t)
pub fn bin_ser(t: &Vec<u8>, buf: &mut Vec<u8>) -> grpc::Result<()> {
buf.extend_from_slice(t);
Ok(())
}

#[inline]
Expand Down
Loading