Click here to Skip to main content
12,702,455 members (35,717 online)
Click here to Skip to main content


47 bookmarked

STL WebServer

, 8 May 2000
A set of classes written in STL that implement a web server
#if !defined(HttpRequestProcess_H)
#define HttpRequestProcess_H

#include "HttpRequest.h"
#include "HttpResponse.h"

#include <string>
using namespace std;

class HttpRequestProcess
	HttpRequest		_request;				// stores processed request info
	HttpResponse	_resp;
	long			_processState;			// state of processing 
	string			_buffer;				// buffer to process
	long			_length;				// length of buffer
	string			_line;					// current process line


	HttpRequestProcess ();
	HttpRequestProcess ( LPTSTR buffer, long length );

	virtual ~HttpRequestProcess ();

	// create/release methods
	bool create  ( LPTSTR buffer, long length );
	void release ();

	// methods
	bool process		( LPTSTR buffer, long length );
	bool process		();
	bool getLine		( int & index );
	void processLine	();
	void addToBody		( int nBytes, int index );
	bool bodySent		();

	// access methods for http buffer
	HttpResponse & getResponse ()
		return _resp;

	string getBody ()
		return _resp.getBody();

	void getString ( string & set )

	LPTSTR data ()
		return (LPTSTR) _resp.c_str();

	LPCTSTR c_str () 
		return _resp.c_str();

	long size ()
		return _resp.size();



By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

David Hubbard
United States United States
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170118.1 | Last Updated 9 May 2000
Article Copyright 2000 by David Hubbard
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid