commit 1b0b8c014d04189c6e55e09288dd68ef5bc1e447 parent 8893ec6980741cd78030d4c093f6665728d135a1 Author: Nils Durner <durner@gnunet.org> Date: Wed, 20 Jan 2010 21:07:20 +0000 use untranslated file input mode, important on Windows Diffstat:
8 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/doc/chapters/largerpost.inc b/doc/chapters/largerpost.inc @@ -225,7 +225,7 @@ take this as the name the file will be stored on the server and make sure no fil @verbatim if (!con_info->fp) { - if (NULL != (fp = fopen (filename, "r")) ) + if (NULL != (fp = fopen (filename, "rb")) ) { fclose (fp); con_info->answerstring = fileexistspage; diff --git a/doc/examples/largepost.c b/doc/examples/largepost.c @@ -80,7 +80,7 @@ iterate_post (void *coninfo_cls, enum MHD_ValueKind kind, const char *key, if (!con_info->fp) { - if (NULL != (fp = fopen (filename, "r"))) + if (NULL != (fp = fopen (filename, "rb"))) { fclose (fp); con_info->answerstring = fileexistspage; diff --git a/src/examples/fileserver_example.c b/src/examples/fileserver_example.c @@ -62,7 +62,7 @@ ahc_echo (void *cls, return MHD_YES; } *ptr = NULL; /* reset when done */ - file = fopen (&url[1], "r"); + file = fopen (&url[1], "rb"); if (file == NULL) { response = MHD_create_response_from_data (strlen (PAGE), diff --git a/src/examples/fileserver_example_dirs.c b/src/examples/fileserver_example_dirs.c @@ -55,7 +55,7 @@ dir_reader (void *cls, uint64_t pos, char *buf, int max) return snprintf (buf, max, "<a href=\"/%s\">%s</a><br>", e->d_name, - e->d_name); + e->d_name); } @@ -83,9 +83,9 @@ ahc_echo (void *cls, return MHD_YES; } *ptr = NULL; /* reset when done */ - file = fopen (&url[1], "r"); + file = fopen (&url[1], "rb"); if (file == NULL) - { + { response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN, 32 * 1024, &dir_reader, diff --git a/src/examples/fileserver_example_external_select.c b/src/examples/fileserver_example_external_select.c @@ -62,7 +62,7 @@ ahc_echo (void *cls, return MHD_YES; } *ptr = NULL; /* reset when done */ - file = fopen (&url[1], "r"); + file = fopen (&url[1], "rb"); if (file == NULL) { response = MHD_create_response_from_data (strlen (PAGE), diff --git a/src/examples/https_fileserver_example.c b/src/examples/https_fileserver_example.c @@ -131,7 +131,7 @@ http_ahc (void *cls, } *ptr = NULL; /* reset when done */ - file = fopen (&url[1], "r"); + file = fopen (url, "rb"); if (file == NULL) { response = MHD_create_response_from_data (strlen (EMPTY_PAGE), @@ -142,7 +142,7 @@ http_ahc (void *cls, } else { - stat (&url[1], &buf); + stat (url, &buf); response = MHD_create_response_from_callback (buf.st_size, 32 * 1024, /* 32k PAGE_NOT_FOUND size */ &file_reader, file, (MHD_ContentReaderFreeCallback) diff --git a/src/testcurl/https/tls_authentication_test.c b/src/testcurl/https/tls_authentication_test.c @@ -174,7 +174,7 @@ setup_ca_cert () { FILE *cert_fd; - if (NULL == (cert_fd = fopen (ca_cert_file_name, "w+"))) + if (NULL == (cert_fd = fopen (ca_cert_file_name, "wb+"))) { fprintf (stderr, "Error: failed to open `%s': %s\n", ca_cert_file_name, strerror (errno)); diff --git a/src/testcurl/https/tls_test_common.c b/src/testcurl/https/tls_test_common.c @@ -87,7 +87,7 @@ http_ahc (void *cls, struct MHD_Connection *connection, } *ptr = NULL; /* reset when done */ - file = fopen (url, "r"); + file = fopen (url, "rb"); if (file == NULL) { response = MHD_create_response_from_data (strlen (PAGE_NOT_FOUND), @@ -290,7 +290,7 @@ setup_test_file () { FILE *test_fd; - if (NULL == (test_fd = fopen (TEST_FILE_NAME, "w+"))) + if (NULL == (test_fd = fopen (TEST_FILE_NAME, "wb+"))) { fprintf (stderr, "Error: failed to open `%s': %s\n", TEST_FILE_NAME, strerror (errno));