make docs now works (needs doxygen installed), added documentation to a LOT of stuff, refactored most utility functions, complete rewrites of DDV sockets and the FLV parsers, updated HTTP_Box_Parser and Connector_HTTP to be able to cope with these new changes - Connector_RTMP, Buffer and Connector_RAW are currently broken. Need to be fixed ASAP.

This commit is contained in:
Thulinma 2011-04-06 03:53:30 +02:00
parent 1ea85a27df
commit cc78697ba2
19 changed files with 1470 additions and 918 deletions

41
util/http_parser.h Normal file
View file

@ -0,0 +1,41 @@
#pragma once
#include <map>
#include <string>
#include <stdlib.h>
#include <stdio.h>
#include "ddv_socket.h"
class HTTPReader{
public:
HTTPReader();
bool Read(DDV::Socket & sock);
bool Read(FILE * F);
std::string GetHeader(std::string i);
std::string GetVar(std::string i);
void SetHeader(std::string i, std::string v);
void SetHeader(std::string i, int v);
void SetVar(std::string i, std::string v);
void SetBody(std::string s);
void SetBody(char * buffer, int len);
std::string BuildRequest();
std::string BuildResponse(std::string code, std::string message);
void SendResponse(DDV::Socket & conn, std::string code, std::string message);
void SendBodyPart(DDV::Socket & conn, char * buffer, int len);
void SendBodyPart(DDV::Socket & conn, std::string bodypart);
void Clean();
bool CleanForNext();
std::string body;
std::string method;
std::string url;
std::string protocol;
unsigned int length;
private:
bool seenHeaders;
bool seenReq;
bool parse();
std::string HTTPbuffer;
std::map<std::string, std::string> headers;
std::map<std::string, std::string> vars;
void Trim(std::string & s);
};//HTTPReader