[swift-server-dev] Next HTTP API meeting

Johannes Weiß johannesweiss at apple.com
Tue Apr 4 13:39:58 CDT 2017


> On 4 Apr 2017, at 18:15, Helge Heß via swift-server-dev <swift-server-dev at swift.org> wrote:
> 
> On 4. Apr 2017, at 18:06, Johannes Weiß <johannesweiss at apple.com> wrote:
>> I agree that should be added to the API I proposed. It still makes a big difference without the completion handler for the chunk handler but I agree there's applications for which it just wouldn't work.
> 
> Well it doesn’t work for anything that would need actual back pressure support ;-> (well, of course it would ‘work', but would be very inefficient and quickly overload the server).
> A done callback should do.

agreed


>>>> given that the underlying HTTP parser library needs to parse everything anyway, we just ignore everything that we don't care about. So it'll still be handed to the client but the client would just ignore everything by doing nothing.
>>> 
>>> So if I upload a 10000TB file to iCloud, you still /dev/null process it? That doesn’t seem sensible to me :-)
>> 
>> well, you need to parse it anyway
> 
> I can’t follow you on this one. Why would I have to parse it? If I eventually detect that the content is more than I want to handle or that they payload is b0rked (e.g. invalid iCalendar data, or amount exceeding limits, says it sends a text/plain but actually uploads an avi etc), I would just want to close the stream?

you can't really just close it as there might already be another HTTP request pipelined in the same connection. If you're behind a load balancer it might even be from a different client.


>> The question is how many applications actually want to stream a very large amount of data to just ignore it.
> 
> That is exactly the point, if someone is sending you endless or invalid or unexpected data, you want to stop that from polluting your server and just stop.
> 
>> As I said at the beginning
> 
> No one is complaining, just passing on notes ;-> So your plan is to send along an updated proposal at some point?

I can absolutely do that. My thinking so far was that in the next phone meeting we decide whether that API is generally what people think is acceptable. And if yes we improve the API where necessary. But if there's interest I'm happy to send a v2 around.

Cheers,
  Johannes


More information about the swift-server-dev mailing list