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:
		
							parent
							
								
									4349e04e5f
								
							
						
					
					
						commit
						62ccca1427
					
				
					 13 changed files with 1132 additions and 601 deletions
				
			
		
							
								
								
									
										41
									
								
								util/http_parser.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								util/http_parser.h
									
										
									
									
									
										Normal 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
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue