Skip to content
Snippets Groups Projects
Commit f3d702a5 authored by Joey Le's avatar Joey Le
Browse files

Made it so exec remote cmd loop actually loops and doesn't exit over 1 command

parent aa58c5c0
Branches
No related tags found
No related merge requests found
...@@ -97,7 +97,7 @@ int exec_remote_cmd_loop(char *address, int port) { ...@@ -97,7 +97,7 @@ int exec_remote_cmd_loop(char *address, int port) {
char rsp_buff[RDSH_COMM_BUFF_SZ]; char rsp_buff[RDSH_COMM_BUFF_SZ];
int cli_socket; int cli_socket;
ssize_t recv_bytes; ssize_t recv_bytes;
int is_eof = 0; // Declare and initialize int is_eof = 0;
// Debug: Starting the client // Debug: Starting the client
printf("CLIENT: Starting client. Connecting to server at %s:%d...\n", address, port); printf("CLIENT: Starting client. Connecting to server at %s:%d...\n", address, port);
...@@ -192,6 +192,8 @@ int exec_remote_cmd_loop(char *address, int port) { ...@@ -192,6 +192,8 @@ int exec_remote_cmd_loop(char *address, int port) {
(void)is_eof; // Suppress unused variable warning (void)is_eof; // Suppress unused variable warning
return client_cleanup(cli_socket, NULL, NULL, OK); return client_cleanup(cli_socket, NULL, NULL, OK);
} }
/* /*
* start_client(server_ip, port) * start_client(server_ip, port)
* server_ip: a string in ip address format, indicating the servers IP * server_ip: a string in ip address format, indicating the servers IP
......
...@@ -59,7 +59,7 @@ int parse_pipeline(const char *cmd_line, command_list_t *clist); ...@@ -59,7 +59,7 @@ int parse_pipeline(const char *cmd_line, command_list_t *clist);
//server prototypes for rsh_server.c - see documentation for each function to //server prototypes for rsh_server.c - see documentation for each function to
//see what they do //see what they do
int start_server(char *ifaces, int port, int is_threaded); int start_server(char *ifaces, int port, int isthreaded);
int boot_server(char *ifaces, int port); int boot_server(char *ifaces, int port);
int stop_server(int svr_socket); int stop_server(int svr_socket);
int send_message_eof(int cli_socket); int send_message_eof(int cli_socket);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment