Clone wiki

lhttpc / Version_1.2.4


Bug fix


  • Fix handling of HTTP response code 304 (patch by benslavin )


  • Fix handling of unexpected 100 Continue response (patch by legoscia )


  • Fix Host header, add port number (reported by benoitc )


  • Fix confusion of arguments in request/9 (introduced in 1.2.0)


  • Add support for options
    • {connect_timeout, Milliseconds}: Aborts the connect phase after Milliseconds
    • {send_retry, N}: The client will retry sending the request N times if the connection is closed
  • Add support for downloading chunked transfer encoding
  • More consistent error handling
    • The client can either return {ok, Result} or {error, Reason}. Reason wasn't very well defined before
      • connection_closed: The server closed the connection on us (N times in case it happens just after sending the request)
      • connect_timeout: If the TCP stack gives up or we hit the connect_timeout option
      • timeout: If the overall request timeout value is hit
    • All other errors (socket, protocol etc. will result in a runtime error)
  • Better connection handling (issues #2 and #3 on
    • Now understands what to do with connections to servers < HTTP/1.1
    • Now respects "Connection: close" in request headers, which means clients can choose to not use persistent connections
  • RFC Compliance
    • Fix reading of chunked encoding since section 3.6 claims that "All transfer-coding values are case-insensitive"
    • Support for responses that doesn't have an entity body (thanks to Steve Ellis)
      • No body for the HEAD and OPTIONS (unless indicated for the latter) methods
      • Don't try to read a body when receiving a 204 status