diff --git a/server.c b/server.c index 202b8cf9c760a493880363dca674d5fbe7a81b27..4d3d86314b2bce72aeaad43a2152915841293aa9 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) {