#1  
Old 19th February 2008, 09:10
Liac Liac is offline
Junior Member
 
Join Date: Jun 2007
Posts: 11
Thanks: 2
Thanked 0 Times in 0 Posts
 
Wink Safest design (c++)?

Hi there

I'm relatively new to Linux programming and that is why I need your advice.

Imagine that you are coding a server (in C++ under Linux), that listens for connection attempts, accepts them, and handles each request and sends a response (similar to an HTTP server).

Now, imagine some malicious user found a way to crash your program every time it sends a specific request. Obviously this issue will have to be fixed, but until the admin discovers it, I want my server to be as resistant as possible against this type of attack.

So my previous design was to put the server (that listens and accepts connection) AND the routines (that handle each request) into ONE executable and create a thread for every new request.

This has the disadvantage that one single exception/error crashes the whole program (right?)--all threads and all currently handled requests will be gone, which is bad if someone else tries to communicate with my server right at this moment.

Now my question: What is the best and safest design to solve that problem?

- Create a new process for every request? If so, how can you transfer the socket and other information to the new process, communicate with that process, etc?

- Or is there a way to put it all in one process and let an error crash ONLY the current thread, not the whole program?

I avoided the possibility to create multiple executables so far, but if that is the best way, I'll do that.

Thanks in advance for your advice
Reply With Quote
Sponsored Links
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need a design advice for ajax. danf.1979 Programming/Scripts 1 24th May 2007 21:37
ISPConfig design hamerr General 0 24th April 2007 18:02
Infoirmation disclosure by design worries. djtremors General 2 5th November 2006 21:55
Ispconfig Scalability. Multiserver Enviroment Design And Deployment. elies Installation/Configuration 8 23rd February 2006 12:57
New HF Design falko Smalltalk 0 7th August 2005 16:38


All times are GMT +2. The time now is 17:15.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.