X-Git-Url: http://git.dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fsendfile.c;h=48787fdd635195838162abf9f23fb4413d20fbbf;hb=81cfca6c6ec15e3a8f94e278f2bdfcc1249eb122;hp=601661b0656ad650ec56ea08111d36f5f729ea36;hpb=0328ac04990bf22e635930aa37abb8c2128a17f1;p=ashd.git diff --git a/src/sendfile.c b/src/sendfile.c index 601661b..48787fd 100644 --- a/src/sendfile.c +++ b/src/sendfile.c @@ -120,10 +120,10 @@ static void checkcache(char *file, struct stat *sb) if((hdr = getenv("REQ_IF_MODIFIED_SINCE")) != NULL) { if(parsehttpdate(hdr) < sb->st_mtime) return; - printf("HTTP/1.1 304 Not Modified\r\n"); - printf("Date: %s\r\n", fmthttpdate(time(NULL))); - printf("Content-Length: 0\r\n"); - printf("\r\n"); + printf("HTTP/1.1 304 Not Modified\n"); + printf("Date: %s\n", fmthttpdate(time(NULL))); + printf("Content-Length: 0\n"); + printf("\n"); exit(0); } } @@ -175,12 +175,12 @@ int main(int argc, char **argv) checkcache(file, &sb); - printf("HTTP/1.1 200 OK\r\n"); - printf("Content-Type: %s\r\n", contype); - printf("Content-Length: %ji\r\n", (intmax_t)sb.st_size); - printf("Last-Modified: %s\r\n", fmthttpdate(sb.st_mtime)); - printf("Date: %s\r\n", fmthttpdate(time(NULL))); - printf("\r\n"); + printf("HTTP/1.1 200 OK\n"); + printf("Content-Type: %s\n", contype); + printf("Content-Length: %ji\n", (intmax_t)sb.st_size); + printf("Last-Modified: %s\n", fmthttpdate(sb.st_mtime)); + printf("Date: %s\n", fmthttpdate(time(NULL))); + printf("\n"); fflush(stdout); if(strcasecmp(argv[optind], "head")) passdata(fd, 1);