mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
* http now buffers the entire request body from the container before copying it to the response writer (and sets content length). this is a level of sad i don't feel comfortable talking about but it is what it is. * json protocol was buffering the entire body so there wasn't any reason for us to try to write this directly to the container stdin manually, we needed to add a bufio.Writer around it anyway it was making too many write(fd) syscalls with the way it was. this is just easier overall and has the same performance as http now in my tests, whereas previously this was 50% slower [than http]. * add buffer pool for http & json to share/use. json doesn't create a new buffer every stinkin request. we need to plumb down content length so that we can properly size the buffer for json, have to add header size and everything together but it's probably faster than malloc(); punting on properly sizing. * json now sets content type to the length of the body from the returned json blurb from the container this does not handle imposing a maximum size of the response returned from a container, which we need to add, but this has been open for some time (specifically, on json). we can impose this by wrapping the pipes, but there's some discussion to be had for json specifically we won't be able to just cut off the output stream and use that (http we can do this). anyway, filing a ticket... closes #326 :(((((((