Skip to content

Commit

Permalink
Bugs Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
yash9439 committed Nov 20, 2023
1 parent d2688b8 commit 7a1f731
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 14 deletions.
23 changes: 11 additions & 12 deletions NamingServerModule.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,9 +517,9 @@ void get_path_ss(char *path, PathToServerMap *s, int *foundFlag)
strcpy(s->path, path);
foundFlag = 1;
}
else {
HASH_FIND_STR(serversByPath, path, s);
}

HASH_FIND_STR(serversByPath, path, s);

if(s != NULL)
{
char t[1024];
Expand Down Expand Up @@ -678,9 +678,8 @@ void *handleClientInput(void *socketDesc)
strcpy(s->path, path);
foundFlag = 1;
}
else {
HASH_FIND_STR(serversByPath, path, s);
}

HASH_FIND_STR(serversByPath, path, s);

if(s != NULL)
{
Expand Down Expand Up @@ -790,9 +789,8 @@ void *handleClientInput(void *socketDesc)
strcpy(s->path, path);
foundFlag = 1;
}
else {
HASH_FIND_STR(serversByPath, path, s);
}

HASH_FIND_STR(serversByPath, path, s);


if (s != NULL)
Expand Down Expand Up @@ -921,9 +919,9 @@ void *handleClientInput(void *socketDesc)
strcpy(s->path, path);
foundFlag = 1;
}
else {
HASH_FIND_STR(serversByPath, path, s);
}

HASH_FIND_STR(serversByPath, path, s);


if(s != NULL)
{
Expand Down Expand Up @@ -1206,6 +1204,7 @@ void *handleClientInput(void *socketDesc)
if (foundFlag == 0)
{
printf("Destination path not found\n");
send(clientsock, "Destination path not found", strlen("Destination path not found"), 0);
return NULL;
}

Expand Down
Binary file modified client
Binary file not shown.
41 changes: 39 additions & 2 deletions log.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,39 @@
Mon Nov 20 23:44:08 2023: Initializing Naming Server...
Mon Nov 20 23:44:08 2023: Bind failed
Tue Nov 21 02:26:19 2023: Initializing Naming Server...
Tue Nov 21 02:26:19 2023: Naming Server started listening...
Tue Nov 21 02:26:21 2023: Received storage server 1 details:
Tue Nov 21 02:26:21 2023: IP Address: 127.0.0.2
Tue Nov 21 02:26:21 2023: NM Port: 5000
Tue Nov 21 02:26:21 2023: Client Port: 4000
Tue Nov 21 02:26:21 2023: NUM PATHS: 11
Tue Nov 21 02:26:21 2023: Accessible Paths: ./src
Tue Nov 21 02:26:21 2023: Accessible Paths: ./src/q
Tue Nov 21 02:26:21 2023: Accessible Paths: ./src/jainit
Tue Nov 21 02:26:21 2023: Accessible Paths: ./src/NamingServer.c
Tue Nov 21 02:26:21 2023: Accessible Paths: ./src/helloWorld.txt
Tue Nov 21 02:26:21 2023: Accessible Paths: ./src/2d
Tue Nov 21 02:26:21 2023: Accessible Paths: ./src/2d/1d
Tue Nov 21 02:26:21 2023: Accessible Paths: ./src/2d/1d/1
Tue Nov 21 02:26:21 2023: Accessible Paths: ./src/2d/1d/11
Tue Nov 21 02:26:21 2023: Accessible Paths: ./src/2d/ct_new
Tue Nov 21 02:26:21 2023: Accessible Paths: ./src/yo
Tue Nov 21 02:26:21 2023: Registration Successful
Tue Nov 21 02:26:24 2023: Client connected...
Tue Nov 21 02:26:46 2023: Received command: COPY ./src/jainit ./src/1/2/3

Tue Nov 21 02:26:46 2023: Token 0: COPY
Tue Nov 21 02:26:46 2023: Token 1: ./src/jainit
Tue Nov 21 02:26:46 2023: Token 2: ./src/1/2/3
Tue Nov 21 02:26:46 2023: Source path: ./src/jainit
Tue Nov 21 02:26:46 2023: Source path: ./src/jainit
Tue Nov 21 02:26:46 2023: Destination path: ./src/1/2/3
Tue Nov 21 02:26:46 2023: length of source path: 12
Tue Nov 21 02:26:46 2023: length of destination path: 11
Tue Nov 21 02:26:46 2023: Storage server 0
Tue Nov 21 02:26:46 2023: Path 0: ./src
Tue Nov 21 02:26:46 2023: length of path: 5
Tue Nov 21 02:26:46 2023: Path 1: ./src/q
Tue Nov 21 02:26:46 2023: length of path: 7
Tue Nov 21 02:26:46 2023: Path 2: ./src/jainit
Tue Nov 21 02:26:46 2023: length of path: 12
Tue Nov 21 02:26:46 2023: Found source path
Tue Nov 21 02:26:46 2023: Found flagasdfasdf: 1
Binary file modified n
Binary file not shown.
Binary file modified s
Binary file not shown.

0 comments on commit 7a1f731

Please sign in to comment.