diff options
Diffstat (limited to '03_exercise/srv/shell.c')
-rw-r--r-- | 03_exercise/srv/shell.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/03_exercise/srv/shell.c b/03_exercise/srv/shell.c index 74c492b..b956d3c 100644 --- a/03_exercise/srv/shell.c +++ b/03_exercise/srv/shell.c @@ -111,13 +111,16 @@ void send_file(int client_fd, char *path) { sprintf(buffer, "<<!%ld!", sz); sprintf(&(buffer[3 + length + 1]), "%s!\n", path); + usleep(150); if (write(client_fd, buffer, strlen(buffer)) != strlen(buffer)) { perror("write header"); return; } + usleep(150); flag = 1; setsockopt(client_fd, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(int)); + usleep(150); flag = 0; setsockopt(client_fd, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(int)); |