Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
key-value-store
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Samarth Joshi
key-value-store
Commits
34ad384c
Commit
34ad384c
authored
Oct 25, 2020
by
Roshan Rabinarayan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aaaa
parent
3a2059c9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
KVServer.c
KVServer.c
+3
-2
server
server
+0
-0
No files found.
KVServer.c
View file @
34ad384c
...
@@ -106,12 +106,13 @@ void *worker(void *args) {
...
@@ -106,12 +106,13 @@ void *worker(void *args) {
fflush
(
stdout
);
fflush
(
stdout
);
read
(
read_pipe
,
newfd
,
sizeof
(
newfd
));
read
(
read_pipe
,
newfd
,
sizeof
(
newfd
));
printf
(
"
\n
read %d"
,
*
newfd
);
printf
(
"
\n
read %d"
,
*
newfd
);
if
(
epoll_ctl
(
epollfd
,
EPOLL_CTL_ADD
,
newfd
,
)
==
-
1
)
{
if
(
epoll_ctl
(
epollfd
,
EPOLL_CTL_ADD
,
*
newfd
,
&
ev
)
==
-
1
)
{
perror
(
"epoll_ctl: read_pipe"
);
perror
(
"epoll_ctl: read_pipe"
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
fflush
(
stdout
);
fflush
(
stdout
);
}
else
{
}
else
{
struct
message
*
requestMessage
=
malloc
(
sizeof
(
struct
message
));
struct
message
*
requestMessage
=
malloc
(
sizeof
(
struct
message
));
read
(
events
[
i
].
data
.
fd
,
requestMessage
,
sizeof
(
struct
message
));
read
(
events
[
i
].
data
.
fd
,
requestMessage
,
sizeof
(
struct
message
));
printf
(
"[Message Received from client]
\n
[[Status:%c]
\n
[Key:%s]
\n
[Value:%s]]"
,
requestMessage
->
status
,
requestMessage
->
key
,
requestMessage
->
value
);
printf
(
"[Message Received from client]
\n
[[Status:%c]
\n
[Key:%s]
\n
[Value:%s]]"
,
requestMessage
->
status
,
requestMessage
->
key
,
requestMessage
->
value
);
...
...
server
View file @
34ad384c
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment