For large HTTP file downloads, never copy the whole file into IO buffer

Do file transfer by small chunks.
Saving state in the `nc->proto_data`, which will be the placeholder for more HTTP state, e.g. for CGI-related data.
<a href='#crh-start'></a><a href='#crh-data-%7B%22approved%22%3A%20%7B%22https%3A//github.com/mmikulicic%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/52673%3Fv%3D2%22%7D%7D%2C%20%22comments%22%3A%20%7B%22General%20Comment%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/cesanta/net_skeleton/pull/45%23issuecomment-61400945%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22%3Ashipit%3A%22%2C%20%22created_at%22%3A%20%222014-11-02T10%3A33%3A57Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/52673%3Fv%3D2%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/mmikulicic%22%7D%7D%5D%2C%20%22title%22%3A%20%22General%20Comment%22%7D%2C%20%22Commit%201260d95602acfd72d81f0a096732cddbfd320800%20modules/http.c%204%2013%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/cesanta/net_skeleton/commit/1260d95602acfd72d81f0a096732cddbfd320800%23commitcomment-8399197%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22It%20looks%20like%20this%20structure%20is%20very%20specific%20to%20the%20transfer_file_data%20function.%5Cr%5Cnproto_data_http%20seems%20a%20too%20generic%20name%2C%20perhaps%20transfer_file_proto_data%20%3F%22%2C%20%22created_at%22%3A%20%222014-11-02T10%3A13%3A37Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/52673%3Fv%3D2%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/mmikulicic%22%7D%7D%2C%20%7B%22body%22%3A%20%22Very%20soon%20it%27ll%20contain%20%60struct%20ns_connection%20%2Acgi_conn%60%20member%2C%20for%20handling%20CGI%20requests.%5Cr%5CnFor%20serving%20large%20directory%20listings%2C%20we%20may%20add%20%60DIR%20%2A%60%20member.%22%2C%20%22created_at%22%3A%20%222014-11-02T10%3A20%3A22Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/601816%3Fv%3D2%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/cpq%22%7D%7D%2C%20%7B%22body%22%3A%20%22Will%20all%20those%20fields%20be%20used%20together%20%3F%5Cr%5CnIs%20your%20idea%20to%20just%20have%20one%20single%20struct%20filled%20with%20whatever%20fields%20are%20needed%20by%20the%20HTTP%20handler%20and%20each%20action%20will%20just%20use%20a%20few%20fields%20at%20a%20time%3F%5Cr%5Cn%22%2C%20%22created_at%22%3A%20%222014-11-02T10%3A30%3A33Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/52673%3Fv%3D2%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/mmikulicic%22%7D%7D%2C%20%7B%22body%22%3A%20%22%3A%2B1%3A%22%2C%20%22created_at%22%3A%20%222014-11-02T10%3A33%3A46Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/52673%3Fv%3D2%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/mmikulicic%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20modules/http.c%3AL13%20%281260d95%29%22%7D%7D%2C%20%22processed%22%3A%20%5B%22https%3A//github.com/cesanta/net_skeleton/pull/45%23issuecomment-61400945%22%2C%20%22https%3A//github.com/cesanta/net_skeleton/commit/1260d95602acfd72d81f0a096732cddbfd320800%23commitcomment-8399197%22%2C%20%22https%3A//github.com/cesanta/net_skeleton/commit/1260d95602acfd72d81f0a096732cddbfd320800%23commitcomment-8399211%22%2C%20%22https%3A//github.com/cesanta/net_skeleton/commit/1260d95602acfd72d81f0a096732cddbfd320800%23commitcomment-8399232%22%2C%20%22https%3A//github.com/cesanta/net_skeleton/commit/1260d95602acfd72d81f0a096732cddbfd320800%23commitcomment-8399239%22%5D%7D'></a>
<a href='https://www.codereviewhub.com/'><img src='http://www.codereviewhub.com/site/github-bar.png' height=40></a>

<img src='http://www.codereviewhub.com/site/github-approved-avatar.png'><a href='https://github.com/mmikulicic'><img src='https://avatars.githubusercontent.com/u/52673?v=2' width=34 height=34></a>

- [x] <a href='#crh-comment-Commit 1260d95602acfd72d81f0a096732cddbfd320800 modules/http.c 4 13'></a> <img src='http://www.codereviewhub.com/site/github-completed.png' height=16 width=60>&nbsp;<b><a href='https://github.com/cesanta/net_skeleton/commit/1260d95602acfd72d81f0a096732cddbfd320800#commitcomment-8399197'>File: modules/http.c:L13 (1260d95)</a></b>
- <a href='https://github.com/mmikulicic'><img border=0 src='https://avatars.githubusercontent.com/u/52673?v=2' height=16 width=16'></a> It looks like this structure is very specific to the transfer_file_data function.
proto_data_http seems a too generic name, perhaps transfer_file_proto_data ?
- <a href='https://github.com/cpq'><img border=0 src='https://avatars.githubusercontent.com/u/601816?v=2' height=16 width=16'></a> Very soon it'll contain `struct ns_connection *cgi_conn` member, for handling CGI requests.
For serving large directory listings, we may add `DIR *` member.
- <a href='https://github.com/mmikulicic'><img border=0 src='https://avatars.githubusercontent.com/u/52673?v=2' height=16 width=16'></a> Will all those fields be used together ?
Is your idea to just have one single struct filled with whatever fields are needed by the HTTP handler and each action will just use a few fields at a time?


<a href='https://www.codereviewhub.com/cesanta/net_skeleton/pull/45?mark_as_completed=1'><img src='http://www.codereviewhub.com/site/github-mark-as-completed.png' height=26></a>&nbsp;<a href='https://www.codereviewhub.com/cesanta/net_skeleton/pull/45?approve=1'><img src='http://www.codereviewhub.com/site/github-approve.png' height=26></a>&nbsp;<a href='https://www.codereviewhub.com/cesanta/net_skeleton/pull/45?approve=0'><img src='http://www.codereviewhub.com/site/github-undo-approve.png' height=26></a>&nbsp;<a href='https://github.com/cesanta/net_skeleton/pull/45'><img src='http://www.codereviewhub.com/site/github-refresh.png' height=26></a>
<a href='#crh-end'></a>