Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Cs283
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Joey Le
Cs283
Commits
c85aa628
There was an error fetching the commit references. Please try again later.
Commit
c85aa628
authored
3 months ago
by
Joey Le
Browse files
Options
Downloads
Patches
Plain Diff
Fixed rsh_server.c exec client requests
parent
6e8c9eeb
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Assignment-06/starter/rsh_server.c
+3
-5
3 additions, 5 deletions
Assignment-06/starter/rsh_server.c
with
3 additions
and
5 deletions
Assignment-06/starter/rsh_server.c
+
3
−
5
View file @
c85aa628
...
@@ -47,6 +47,8 @@
...
@@ -47,6 +47,8 @@
* TO DO SOMETHING WITH THE is_threaded ARGUMENT HOWEVER.
* TO DO SOMETHING WITH THE is_threaded ARGUMENT HOWEVER.
*/
*/
int
start_server
(
char
*
ifaces
,
int
port
,
int
is_threaded
){
int
start_server
(
char
*
ifaces
,
int
port
,
int
is_threaded
){
(
void
)
is_threaded
;
int
svr_socket
;
int
svr_socket
;
int
rc
;
int
rc
;
...
@@ -353,11 +355,6 @@ int exec_client_requests(int cli_socket) {
...
@@ -353,11 +355,6 @@ int exec_client_requests(int cli_socket) {
send_message_string
(
cli_socket
,
"Exiting...
\n
"
);
send_message_string
(
cli_socket
,
"Exiting...
\n
"
);
send_message_eof
(
cli_socket
);
send_message_eof
(
cli_socket
);
return
OK
;
return
OK
;
}
else
if
(
strcmp
(
cmd
.
argv
[
0
],
"stop-server"
)
==
0
)
{
free
(
cmd
.
_cmd_buffer
);
send_message_string
(
cli_socket
,
"Stopping server...
\n
"
);
send_message_eof
(
cli_socket
);
return
OK_EXIT
;
}
else
if
(
strcmp
(
cmd
.
argv
[
0
],
"cd"
)
==
0
)
{
}
else
if
(
strcmp
(
cmd
.
argv
[
0
],
"cd"
)
==
0
)
{
if
(
cmd
.
argc
==
1
)
{
if
(
cmd
.
argc
==
1
)
{
chdir
(
getenv
(
"HOME"
));
chdir
(
getenv
(
"HOME"
));
...
@@ -405,6 +402,7 @@ int exec_client_requests(int cli_socket) {
...
@@ -405,6 +402,7 @@ int exec_client_requests(int cli_socket) {
/*
/*
* send_message_eof(cli_socket)
* send_message_eof(cli_socket)
* cli_socket: The server-side socket that is connected to the client
* cli_socket: The server-side socket that is connected to the client
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment