use untranslated file input mode, important on Windows

This commit is contained in:
Nils Durner
2010-01-20 21:07:20 +00:00
parent 8893ec6980
commit 1b0b8c014d
8 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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),
+3 -3
View File
@@ -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,
@@ -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),
+2 -2
View File
@@ -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)
+1 -1
View File
@@ -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));
+2 -2
View File
@@ -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));