RTC Forums
November 25, 2024, 12:08:22 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Limit data sent to the server via a POST request?  (Read 5430 times)
testmonkey
Guest
« 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.



Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 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
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.023 seconds with 17 queries.