request_processor.cpp

00001
00002 /***************************************************************************
00003  *  request_processor.cpp - HTTP request processor
00004  *
00005  *  Created: Mon Oct 13 22:02:25 2008
00006  *  Copyright  2006-2008  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU Library General Public License for more details.
00019  *
00020  *  Read the full text in the LICENSE.GPL file in the doc directory.
00021  */
00022
00023 #include "request_processor.h"
00024
00025 #include <sys/types.h>
00026 #include <stdint.h>
00027 #include <cstdarg>
00028 #include <microhttpd.h>
00029 #include <cstring>
00030 
00031 /** @class WebRequestProcessor "request_processor.h"
00032  * Abstract web request processor.
00033  * Interface used to define web request processor that can be registered to
00034  * the WebRequestDispatcher.
00035  * @author Tim Niemueller
00036  *
00037  *
00038  * @fn virtual WebReply * WebRequestProcessor::process_request(const char *url, const char *method, const char *version,  const char *upload_data, size_t *upload_data_size, void **session_data) =  0
00039  * Process a request.
00040  * @param url URL, may contain escape sequences
00041  * @param method HTTP method
00042  * @param version HTTP version
00043  * @param upload_data uploaded data
00044  * @param upload_data_size size of upload_data parameter
00045  * @param session_data session data pointer
00046  * @return a WebReply instance, more specifically either a DynamicWebReply or a StaticWebReply
00047  * that is sent as reply, or NULL to cause a 404 (not found) error.
00048  */
00049 
00050 /** Virtual empty destructor. */
00051 WebRequestProcessor::~WebRequestProcessor()
00052 {
00053 }