My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Functions
httpops.c File Reference
#include "logging.h"
#include "webserver/httpops.h"

Go to the source code of this file.

Macros

#define BASE_HTTP_HEADER   "HTTP/1.1 200 OK\r\nContent-Type: %s\r\nContent-Length: %d\r\n\r\n"
 
#define NOT_FOUND_HEADER   "HTTP/1.1 404 Not Found\r\n\r\n"
 
#define NOT_IMPLEMENTED_HEADER   "HTTP/1.1 501 Not Implemented\r\n\r\n"
 
#define DEFAULT_MIME_TYPE   "text/html"
 

Functions

char * path_to_mimetype (char *path)
 
int url_to_path (char *url, char *dir, char *path, int capacity)
 
int generate_header (char *dest, int code, int capacity, int body_len, char *mime_type)
 

Macro Definition Documentation

#define BASE_HTTP_HEADER   "HTTP/1.1 200 OK\r\nContent-Type: %s\r\nContent-Length: %d\r\n\r\n"

Definition at line 24 of file httpops.c.

#define DEFAULT_MIME_TYPE   "text/html"

Definition at line 33 of file httpops.c.

#define NOT_FOUND_HEADER   "HTTP/1.1 404 Not Found\r\n\r\n"

Definition at line 27 of file httpops.c.

#define NOT_IMPLEMENTED_HEADER   "HTTP/1.1 501 Not Implemented\r\n\r\n"

Definition at line 30 of file httpops.c.

Function Documentation

int generate_header ( char *  dest,
int  code,
int  capacity,
int  body_len,
char *  mime_type 
)

Definition at line 88 of file httpops.c.

char* path_to_mimetype ( char *  path)

Definition at line 36 of file httpops.c.

int url_to_path ( char *  url,
char *  dir,
char *  path,
int  capacity 
)

Definition at line 62 of file httpops.c.