Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

simple_http: actually reuse sockets #80

Closed
wants to merge 1 commit into from

Commits on Dec 7, 2022

  1. simple_http: actually reuse sockets

    serde_json::from_reader requires that the other side close the socket
    for it to complete. Therefore we were forcing the server to always close
    streams to us, never reusing any single sockets. In fact, it was more a
    burden because after the first request for every request we would have
    to call the request() function twice: once for it to notice that the
    socket was closed on the other side (receiving an EOF on line 202 and
    confusingly returning an error telling the HTTP header was malformed).
    
    Instead, get back to what was previously used in previous versions: read
    a line from the stream (using '\n' to mark the end of the request
    instead of a connection close) and parse it afterward.
    darosior committed Dec 7, 2022
    Configuration menu
    Copy the full SHA
    7a4252b View commit details
    Browse the repository at this point in the history