MLIB
Loading...
Searching...
No Matches
httpd.h File Reference

Implementation of httpd and http_connection classes. More...

#include "tcpserver.h"
#include <string>
#include <map>
#include <deque>

Go to the source code of this file.

Data Structures

struct  mlib::ci_less
 Case insensitive comparison function. More...
 
class  mlib::http_connection
 Representation of a HTTP client connection request. More...
 
class  mlib::httpd
 Small multi-threaded HTTP server. More...
 

Macros

#define HTTPD_MAX_HEADER   8192
 Maximum size of HTTP header.
 
Error codes
#define HTTPD_OK   0
 Success.
 
#define HTTPD_ERR_WRITE   -1
 Socket write failure.
 
#define HTTPD_ERR_FOPEN   -2
 File open failure.
 
#define HTTPD_ERR_FREAD   -3
 File read failure.
 

Typedefs

typedef std::map< std::string, std::string, ci_lessmlib::str_pairs
 
typedef int(* mlib::uri_handler) (const char *uri, http_connection &client, void *info)
 User defined URL handler function.
 

Functions

void mlib::parse_urlparams (const char *par_str, str_pairs &params)
 Parse a URL encoded string of parameters.
 

Detailed Description

Implementation of httpd and http_connection classes.

(c) Mircea Neacsu 2007-2014. All rights reserved.

Typedef Documentation

◆ str_pairs

typedef std::map<std::string, std::string, ci_less> mlib::str_pairs

Key-value string pairs used for headers, URL-encoded data, etc. Keys are case insensitive.