Closed awarbler closed 1 month ago
What I did was removed duplicated code, accumulation logic : the character based parsing logic that accumulates data in the msg_buf and checks for the\n# deliminter is intact
the prompt mode: once the full message is received and processed, we switch to prompt mode = 1 and we handle errors as well for the socket failures.
I cant test it because I am not getting an output for ls, date, and etc.
I haven't had a chance to debug your code so I am working blindly here.
if you think I need to make changes please let me know gabriel.
I will move on to the next item that needs to get done which is The thread should intercept the messages and act depending on the type of message (CMD/CTL/TEXT) Implement character based parsing to find message delimiters [TODO]
unless you have something else you need me to do first
okay so here are the changes I made in the client
Do you want me to make the changes to the file? debugged-branch-gabriel
for the communication thread // Communication thread to handle communication with the server void commmunication_thread(void args){ // buffer for receiving response char buf[BUFFER_SIZE] = {0}; char msg_buf[BUFFER_SIZE] = {0}; int bytesRead; int message_len = 0;
}