Broke down most warnings

This commit is contained in:
Ano-sys
2025-01-12 01:05:43 +01:00
parent 9196cf4b3b
commit 5e6401c668
3 changed files with 4 additions and 15 deletions
+3
View File
@@ -1,5 +1,8 @@
#include "lookup.h"
static int free_space = TABLE_SIZE;
static lookup_head *table;
void init_lookup_table()
{
table = malloc(sizeof(lookup_head));
-3
View File
@@ -15,9 +15,6 @@ typedef struct lookup_head
lookup_table *head;
}lookup_head;
static lookup_head *table;
static int free_space = TABLE_SIZE;
void init_lookup_table();
void push_lookup(lookup_request *request);
+1 -12
View File
@@ -120,14 +120,6 @@ void send_reply(int conn, struct request *request) {
fprintf(stderr, "Resource hash: %u\n", resource_hash);
if (resource_hash == -1)
{
perror("Pseudo_hash failed - 404\n");
reply = "HTTP/1.1 404 Not Found\r\nContent-Length: 0\r\n\r\n";
offset = strlen(reply);
goto direct_send;
}
neighbor responsible = check_neighborhood(resource_hash);
lookup_request *req = find_lookup(resource_hash);
@@ -207,9 +199,6 @@ void send_reply(int conn, struct request *request) {
offset = strlen(reply);
}
direct_send: // ... do goto, yes you read that right ;)
//offset = strlen(reply);
// Send the reply back to the client
if (send(conn, reply, offset, 0) == -1) {
perror("send");
@@ -438,7 +427,7 @@ static int setup_server_socket_udp(struct sockaddr_in addr){
static void handle_udp_request(){
fprintf(stderr, "---%d---\n", _NODE_ID);
size_t received_bytes = 0;
ssize_t received_bytes = 0;
lookup_request lr = {0};
struct sockaddr_storage caller_addr;