Broke down most warnings
This commit is contained in:
+1
-12
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user