some improvements and fixed intendations
This commit is contained in:
parent
ddef20a8e7
commit
c4a3ddae50
@ -71,6 +71,7 @@ int main(int argc, char **argv)
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// RECEIVE DATA
|
||||
// https://man7.org/linux/man-pages/man2/recv.2.html
|
||||
/*
|
||||
size = recv(create_socket, buffer, BUF - 1, 0);
|
||||
if (size == -1)
|
||||
{
|
||||
@ -85,6 +86,7 @@ int main(int argc, char **argv)
|
||||
buffer[size] = '\0';
|
||||
printf("%s", buffer); // ignore error
|
||||
}
|
||||
*/
|
||||
|
||||
do {
|
||||
printf("Please specify a command (SEND, LIST, READ, DEL, QUIT): ");
|
||||
@ -113,7 +115,7 @@ int main(int argc, char **argv)
|
||||
fgets(receiver, BUF - 1, stdin);
|
||||
printf("Subject: ");
|
||||
fgets(subject, 80, stdin);
|
||||
printf("Message: \n");
|
||||
printf("Message: ");
|
||||
char line[BUF];
|
||||
message[0] = '\0';
|
||||
while (true)
|
||||
@ -200,11 +202,11 @@ int main(int argc, char **argv)
|
||||
{
|
||||
buffer[size] = '\0';
|
||||
printf("<< %s\n", buffer); // ignore error
|
||||
if (strcmp("OK", buffer) != 0)
|
||||
/*if (strcmp("OK", buffer) != 0) // needs proper verification, since responses vary between commands
|
||||
{
|
||||
fprintf(stderr, "<< Server error occured, abort\n");
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
} while (!isQuit);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user