Coder Social home page Coder Social logo

Comments (14)

ronag avatar ronag commented on August 17, 2024 1

Possibly an edge case not worth fixing... I think this mostly happens with very old servers.

from undici.

ronag avatar ronag commented on August 17, 2024 1

I mean we could just explicitly state in the README that persistent connection and pipelining must be supported by the target host. Is that good enough?

from undici.

ronag avatar ronag commented on August 17, 2024 1

Yup. What happens otherwise? Does it throw when there already requests queued?

Everything inflight fails except for the first request. So with pipelining=1, every other request would fail (if the queue is full).

from undici.

mcollina avatar mcollina commented on August 17, 2024

How would the server communicate that back to the client?

from undici.

ronag avatar ronag commented on August 17, 2024

The server may send a "Connection: Close" header after the first request is sent indicating it does not want to use a persistent connection.

from undici.

ronag avatar ronag commented on August 17, 2024

So basically the logic here would be that the client does not pipeline until the first request has succeeded with a persistent connection in order to indicate that the server seems to support pipelining.

from undici.

mcollina avatar mcollina commented on August 17, 2024

That would be nice. However I fear it's a lot of complexity.
How are other clients doing it, if at all? Isn't this part of HTTP/1.1 that server has to support?

from undici.

ronag avatar ronag commented on August 17, 2024

Probably, I’ll take a look. This might be another one of those edge cases.

Sorry to bring up every possible edge case. Just trying to be throughout.

from undici.

ronag avatar ronag commented on August 17, 2024

How are other clients doing it, if at all? Isn't this part of HTTP/1.1 that server has to support?

@szmarczak do you have any input?

from undici.

szmarczak avatar szmarczak commented on August 17, 2024

Isn't this part of HTTP/1.1 that server has to support?

No. Pipelining happens only on a persistent (keep-alive) connection and is optional. Unfortunately the HTTP/1.1 RFC does not specify how to verify whether the server supports pipelining or not and how many concurrent requests at maximum it should have.

from undici.

ronag avatar ronag commented on August 17, 2024

Unfortunately the HTTP/1.1 RFC does not specify how to verify whether the server supports pipelining or not and how many concurrent requests at maximum it should have.

I mean... you can kind of detect it by sending a request to the server and see what it does.

So basically the logic here would be that the client does not pipeline until the first request has succeeded with a persistent connection in order to indicate that the server seems to support pipelining.

from undici.

szmarczak avatar szmarczak commented on August 17, 2024

you can kind of detect it by sending a request to the server and see what it does.

One request is not sufficient. Because the connection is keep-alive it doesn't mean that it supports pipelining (according to the RFC). But I too think that most servers do support pipelining. To check if the server supports pipelining, you need to make two requests.

I see your point. I say let's assume that every keep-alive server does support pipelining, then only one request is enough to make the check.

from undici.

szmarczak avatar szmarczak commented on August 17, 2024

Yup. What happens otherwise? Does it throw when there already requests queued?

from undici.

szmarczak avatar szmarczak commented on August 17, 2024

Seems to be fine :)

from undici.

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.