clementfarabet / async

An async framework for Lua/Torch.
116 stars 35 forks source link

chunk encoding fixes, callback additions #22

Closed soumith closed 8 years ago

soumith commented 8 years ago

This PR integrates three fixes:

  1. Remove the "Always try to default to JSON for body, even if content-type not specified". This code is plain wrong, and is actually introducing unnecessary work-arounds for the user.
  2. If the Transfer-Encoding is specified to be 'chunked', then Content-length is not set anymore.
  3. The raw client socket is given to the callback as the 3rd argument. This is quite useful with keepAlive connections when you want to write to them.

Some minor splitting of long-lines is done at places.

clementfarabet commented 8 years ago

great, thanks!