Everything 'should' just work

This commit is contained in:
2025-05-21 15:09:16 +02:00
parent 50e6f227a0
commit 6f43ab070e
9 changed files with 34 additions and 135 deletions
+2 -1
View File
@@ -14,7 +14,8 @@ using namespace std;
struct MetricsExporter {
static void serve(shared_ptr<unordered_map<uint32_t, Crawler>> crawler);
static void process_request(int client_fd);
static void send_data(int client_fd, const string& data);
};
inline string HEAD = "HTTP/1.1 200 OK\r\nContent-Type: text/plain; version=0.0.4\r\n\r\n";
#endif
+1 -2
View File
@@ -19,8 +19,7 @@ class ServerUtils {
static void send_css(int client_fd);
static void send_data(int client_fd, const string& data);
static void send_image(int client_fd, const string& path, image_type type);
static size_t send_all(int client_fd, const char* data, size_t length);
static uint32_t get_ip_2(int client_fd);
static uint32_t get_ip(int client_fd);
};
const string HTML_RESPONSE_HEADER =
+1 -1
View File
@@ -9,4 +9,4 @@ struct Track {
string UserAgent;
};
#endif //TRACK_H
#endif
-2
View File
@@ -12,7 +12,6 @@ struct WordUtils {
static unordered_map<string, unordered_map<string, int>> load_data(const string& path);
static string load_css(const string& path);
static vector<string> predict_next_word(const string& input, const unordered_map<string, unordered_map<string, int>>& word_frequencies, size_t count);
static vector<string> predict_next_word_2(const string& input, const unordered_map<string, unordered_map<string, int>>& word_frequencies, size_t count);
static string load_file(const string& path);
static vector<string> split_string(const string& input, data_type type);
static string extract_url(const string& input);
@@ -20,7 +19,6 @@ struct WordUtils {
static bool contains_image(const string& input);
static string extract_image_name(const string& input);
static string create_tag(const unordered_map<string, unordered_map<string, int>>& word_frequencies, const char& hash);
static string create_tag_2(const unordered_map<string, unordered_map<string, int>>& word_frequencies, const char& hash);
static string create_link(const unordered_map<string, unordered_map<string, int>>& word_frequencies, unsigned long hash);
static string create_image(const string& image);
static unsigned int hash_url(const string& input);