mirror of
				https://github.com/PurpleI2P/i2pd.git
				synced 2025-11-04 00:20:46 +00:00 
			
		
		
		
	Merge remote-tracking branch 'purple/openssl' into i2np-transport-limits
This commit is contained in:
		
						commit
						42ec6db746
					
				
					 6 changed files with 48 additions and 18 deletions
				
			
		| 
						 | 
				
			
			@ -1,5 +1,6 @@
 | 
			
		|||
#include <algorithm>
 | 
			
		||||
#include <cassert>
 | 
			
		||||
#include <string>
 | 
			
		||||
#include "Crypto.h"
 | 
			
		||||
#include "Log.h"
 | 
			
		||||
#include "FS.h"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -29,7 +29,7 @@ namespace http {
 | 
			
		|||
  inline bool is_http_method(const std::string & str) {
 | 
			
		||||
    return std::find(HTTP_METHODS.begin(), HTTP_METHODS.end(), str) != std::end(HTTP_METHODS);
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  void strsplit(const std::string & line, std::vector<std::string> &tokens, char delim, std::size_t limit = 0) {
 | 
			
		||||
    std::size_t count = 0;
 | 
			
		||||
    std::stringstream ss(line);
 | 
			
		||||
| 
						 | 
				
			
			@ -195,6 +195,11 @@ namespace http {
 | 
			
		|||
    return out;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
	bool URL::is_i2p() const
 | 
			
		||||
	{
 | 
			
		||||
		return host.rfind(".i2p") == ( host.size() - 4 );
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
  void HTTPMsg::add_header(const char *name, std::string & value, bool replace) {
 | 
			
		||||
    add_header(name, value.c_str(), replace);
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -56,6 +56,11 @@ namespace http
 | 
			
		|||
     * @note Returns relative url if schema if empty, absolute url otherwise
 | 
			
		||||
     */
 | 
			
		||||
    std::string to_string ();
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @brief return true if the host is inside i2p
 | 
			
		||||
     */
 | 
			
		||||
    bool is_i2p() const;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  struct HTTPMsg 
 | 
			
		||||
| 
						 | 
				
			
			@ -89,7 +94,7 @@ namespace http
 | 
			
		|||
 | 
			
		||||
    /** @brief Serialize HTTP request to string */
 | 
			
		||||
    std::string to_string();
 | 
			
		||||
	void write(std::ostream & o);
 | 
			
		||||
		void write(std::ostream & o);
 | 
			
		||||
 | 
			
		||||
	void AddHeader (const std::string& name, const std::string& value);
 | 
			
		||||
	void UpdateHeader (const std::string& name, const std::string& value);  
 | 
			
		||||
| 
						 | 
				
			
			@ -131,7 +136,7 @@ namespace http
 | 
			
		|||
    std::string to_string();
 | 
			
		||||
 | 
			
		||||
		void write(std::ostream & o);
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
    /** @brief Checks that response declared as chunked data */
 | 
			
		||||
    bool is_chunked() const ;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue