Broke down most warnings
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
#include "lookup.h"
|
#include "lookup.h"
|
||||||
|
|
||||||
|
static int free_space = TABLE_SIZE;
|
||||||
|
static lookup_head *table;
|
||||||
|
|
||||||
void init_lookup_table()
|
void init_lookup_table()
|
||||||
{
|
{
|
||||||
table = malloc(sizeof(lookup_head));
|
table = malloc(sizeof(lookup_head));
|
||||||
|
|||||||
@@ -15,9 +15,6 @@ typedef struct lookup_head
|
|||||||
lookup_table *head;
|
lookup_table *head;
|
||||||
}lookup_head;
|
}lookup_head;
|
||||||
|
|
||||||
static lookup_head *table;
|
|
||||||
static int free_space = TABLE_SIZE;
|
|
||||||
|
|
||||||
void init_lookup_table();
|
void init_lookup_table();
|
||||||
|
|
||||||
void push_lookup(lookup_request *request);
|
void push_lookup(lookup_request *request);
|
||||||
|
|||||||
+1
-12
@@ -120,14 +120,6 @@ void send_reply(int conn, struct request *request) {
|
|||||||
|
|
||||||
fprintf(stderr, "Resource hash: %u\n", resource_hash);
|
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);
|
neighbor responsible = check_neighborhood(resource_hash);
|
||||||
lookup_request *req = find_lookup(resource_hash);
|
lookup_request *req = find_lookup(resource_hash);
|
||||||
|
|
||||||
@@ -207,9 +199,6 @@ void send_reply(int conn, struct request *request) {
|
|||||||
offset = strlen(reply);
|
offset = strlen(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
direct_send: // ... do goto, yes you read that right ;)
|
|
||||||
|
|
||||||
//offset = strlen(reply);
|
|
||||||
// Send the reply back to the client
|
// Send the reply back to the client
|
||||||
if (send(conn, reply, offset, 0) == -1) {
|
if (send(conn, reply, offset, 0) == -1) {
|
||||||
perror("send");
|
perror("send");
|
||||||
@@ -438,7 +427,7 @@ static int setup_server_socket_udp(struct sockaddr_in addr){
|
|||||||
|
|
||||||
static void handle_udp_request(){
|
static void handle_udp_request(){
|
||||||
fprintf(stderr, "---%d---\n", _NODE_ID);
|
fprintf(stderr, "---%d---\n", _NODE_ID);
|
||||||
size_t received_bytes = 0;
|
ssize_t received_bytes = 0;
|
||||||
lookup_request lr = {0};
|
lookup_request lr = {0};
|
||||||
|
|
||||||
struct sockaddr_storage caller_addr;
|
struct sockaddr_storage caller_addr;
|
||||||
|
|||||||
Reference in New Issue
Block a user