• ROOL's avatar
    Fix for race condition fetching headers · 1c9549ea
    ROOL authored
    Detail:
      There was an assumption that if the recv() in http_read_more_header() returned an error, the subsequent recv() in http_reading_response() would also return the same error. However, if callbacks were allowed to run in between and data arrived from the server, the 2nd recv() can return data.
      In turn, this caused the statemachine to believe it was now reading the body, and forced AcornHTTP to invent a fake header for the client - when neither situation was true.
      Change the logic so that EWOULDBLOCK keeps the state machine in reading mode, other errors (or closed connection) stop as before.
    
      Unrelated - header.c corrects grammar, start.c uses boolean initialiser.
    Admin:
      Submission for TCP/IP bounty.
    
    Version 1.03. Tagged as 'HTTP-1_03'
    1c9549ea
header 29.1 KB