Skip to content

Hangs when calling "handle_put" function #27

@denisovpi

Description

@denisovpi

Problem Description

Code hangs when calling "write_bytes" function inside "handle_put".

file.write_bytes(bytes).await?;

I suspect it has something to do with this future.
while let Some(data) = body.data().await {

Steps to Reproduce

  1. Build project from master (or tag v0.2.0) branch.
  2. Run: RUST_LOG=webdav_handler=debug cargo run --example hyper.
  3. Run litmus: TESTS="http" HTDOCS=htdocs TESTROOT=. ./litmus http://localhost:4918/ someuser somepass.

Actual Result

[...] X-Litmus: XLitmus("http: 1 (begin)")
[...] == START REQUEST Delete "/litmus/"
[...] == END REQUEST result FsError(NotFound)
[...] X-Litmus: XLitmus("http: 1 (begin)")
[...] == START REQUEST MkCol "/litmus/"
[...] == END REQUEST result OK
[...] X-Litmus: XLitmus("http")
[...] == START REQUEST Put "/litmus/expect100"        <-- hangs

Expected Result

[...] X-Litmus: XLitmus("http: 1 (begin)")
[...] == START REQUEST Delete "/litmus/"
[...] == END REQUEST result FsError(NotFound)
[...] X-Litmus: XLitmus("http: 1 (begin)")
[...] == START REQUEST MkCol "/litmus/"
[...] == END REQUEST result OK
[...] X-Litmus: XLitmus("http")
[...] == START REQUEST Put "/litmus/expect100"
[...] == END REQUEST result OK                        <-- end request

Known Workarounds

  • Use MemFs instead of LocalFs.

  • Run: RUST_LOG=webdav_handler=debug cargo run --example sample-litmus-server

  • Use webdav-handler v0.1.x

Environment

  • Ubuntu 22.04
  • Tested with Rust 1.59 and Rust 1.68
  • stable-x86_64-unknown-linux-gnu
  • rustc 1.68.0 (2c8cc3432 2023-03-06)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions