RTC Forums

Subscription => Support => Topic started by: testmonkey on December 17, 2009, 05:26:34 AM



Title: Limit data sent to the server via a POST request?
Post by: testmonkey on December 17, 2009, 05:26:34 AM
I have created a simple RTC Web Server using RtcHttpServer and RtcDataProvider. Version 2.83.

I would like to know what is the best way to limit data sent to the server via a POST request?

Presently I am waiting for Request.Complete to be true before processing the incoming data. This works fine, but I am concerned that a malicious client might try to flood the server with a huge amount of data in an attempt to break the server.

So instead of waiting for the POST request to complete, can I kill the request/connection after a certain x number of bytes?

Any thoughts/suggestions are welcome.

Thanks.





Title: Re: Limit data sent to the server via a POST request?
Post by: D.Tkalcec (RTC) on December 17, 2009, 05:45:35 AM
You can always force the client to disconnect from the Server by using the "Disconnect" method from inside events triggered by the RTC SDK on your Server.

You might also want to take a look at the MaxHeaderSize and MaxRequestSize properties on the TRtcHttpServer component, but note that these properties are global (not per request) and should be handled carefully. Default value 0 means to limit, any other value sets the maximum number of bytes you will accept in a request (MaxHeaderSize = HTTP header, MaxRequestSize = complete request). If you want to accept file uploads, make sure this size is large enough to hold the largest file you want to allow for uploading.

Best Regards,
Danijel Tkalcec