Giter VIP home page Giter VIP logo

Comments (3)

steveklabnik avatar steveklabnik commented on July 22, 2024

I believe #90 has fixed this, by setting it automatically. @jbolila , any chance you could give master a try and see if wrk works?

from simple-server.

scurest avatar scurest commented on July 22, 2024

On master, examples/server.rs's response now looks like

< HTTP/1.1 200 OK
< content-length: 11
< 

so it does include the content length and curl doesn't produce * no chunk, no close, no size. Assume close to signal end anymore.

But the Date and Connection fields are still missing. Date would be nice and easy to add. I'm not sure what would need to change to make keep-alive work though.


about wrk:

In my tests, since wg/wrk@522ec60 (~3 yrs ago) wrk will compute Req/Sec even without the Content-Length header.

The server will invariably crash after wrk finishes though. Cause is a broken pipe error here

simple-server/src/lib.rs

Lines 265 to 266 in 10103f5

self.handle_connection(stream)
.expect("Error handling connection.");

from simple-server.

scurest avatar scurest commented on July 22, 2024

Oh. but there still isn't Content-Length for these errors:

simple-server/src/lib.rs

Lines 318 to 321 in 10103f5

let resp = Response::builder()
.status(StatusCode::PAYLOAD_TOO_LARGE)
.body("<h1>413</h1><p>Request too large!<p>".as_bytes())
.unwrap();

simple-server/src/lib.rs

Lines 341 to 343 in 10103f5

let response = response_builder
.body("<h1>404</h1><p>Not found!<p>".as_bytes())
.unwrap();

simple-server/src/lib.rs

Lines 378 to 380 in 10103f5

let response = response_builder
.body("<h1>500</h1><p>Internal Server Error!<p>".as_bytes())
.unwrap();

from simple-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.