From a10c6234e4d652c780198e691b6780689758b063 Mon Sep 17 00:00:00 2001 From: ChouTatsumi <choutatsumi@gmail.com> Date: Mon, 29 Apr 2019 21:57:22 +1000 Subject: [PATCH] test 21:57 --- server.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server.c b/server.c index 202b8cf..4d3d863 100644 --- a/server.c +++ b/server.c @@ -358,6 +358,8 @@ bool show_modified_page(int sockfd, const char* htmldir, char* added, } close(filefd); + print_buff(buff); + // move the trailing part backward int p1, p2; for (p1 = size - 1, p2 = p1 - added_length; p1 >= size - inset_index; @@ -368,6 +370,8 @@ bool show_modified_page(int sockfd, const char* htmldir, char* added, // copy the username strncpy(buff + p2, added, added_length); + print_buff(buff); + if (write(sockfd, buff, size) < 0) { perror("write"); return false; @@ -419,7 +423,9 @@ bool show_accepted_page(int sockfd) { strcat(added, added_suffix); - return show_modified_page(sockfd, ACCEPTED_PAGE, added, 212); + printf("added is now %s", added); + + return show_modified_page(sockfd, ACCEPTED_PAGE, added, 230); } void print_buff(char* request) { -- GitLab