diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-08-24 12:36:32 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-08-24 12:36:32 +0000 |
commit | c42da981f4cd20f265eaffedc540c7c306407af2 (patch) | |
tree | ae299524b3c64ae3ba7cae5af05940b5eba0003f | |
parent | 98d3f2d41c3637938b4c0c33bde93e9d9d9d905a (diff) | |
download | libmicrohttpd-c42da981f4cd20f265eaffedc540c7c306407af2.tar.gz libmicrohttpd-c42da981f4cd20f265eaffedc540c7c306407af2.zip |
-nicer indentation
-rw-r--r-- | doc/examples/tlsauthentication.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/doc/examples/tlsauthentication.c b/doc/examples/tlsauthentication.c index f68a686f..30d19feb 100644 --- a/doc/examples/tlsauthentication.c +++ b/doc/examples/tlsauthentication.c | |||
@@ -83,6 +83,7 @@ get_file_size (const char *filename) | |||
83 | return 0; | 83 | return 0; |
84 | } | 84 | } |
85 | 85 | ||
86 | |||
86 | static char * | 87 | static char * |
87 | load_file (const char *filename) | 88 | load_file (const char *filename) |
88 | { | 89 | { |
@@ -91,15 +92,15 @@ load_file (const char *filename) | |||
91 | long size; | 92 | long size; |
92 | 93 | ||
93 | size = get_file_size (filename); | 94 | size = get_file_size (filename); |
94 | if (size == 0) | 95 | if (0 == size) |
95 | return NULL; | 96 | return NULL; |
96 | 97 | ||
97 | fp = fopen (filename, "rb"); | 98 | fp = fopen (filename, "rb"); |
98 | if (!fp) | 99 | if (! fp) |
99 | return NULL; | 100 | return NULL; |
100 | 101 | ||
101 | buffer = malloc (size + 1); | 102 | buffer = malloc (size + 1); |
102 | if (!buffer) | 103 | if (! buffer) |
103 | { | 104 | { |
104 | fclose (fp); | 105 | fclose (fp); |
105 | return NULL; | 106 | return NULL; |
@@ -116,6 +117,7 @@ load_file (const char *filename) | |||
116 | return buffer; | 117 | return buffer; |
117 | } | 118 | } |
118 | 119 | ||
120 | |||
119 | static int | 121 | static int |
120 | ask_for_authentication (struct MHD_Connection *connection, const char *realm) | 122 | ask_for_authentication (struct MHD_Connection *connection, const char *realm) |
121 | { | 123 | { |
@@ -124,7 +126,7 @@ ask_for_authentication (struct MHD_Connection *connection, const char *realm) | |||
124 | char *headervalue; | 126 | char *headervalue; |
125 | const char *strbase = "Basic realm="; | 127 | const char *strbase = "Basic realm="; |
126 | 128 | ||
127 | response = MHD_create_response_from_buffer (0, NULL, | 129 | response = MHD_create_response_from_buffer (0, NULL, |
128 | MHD_RESPMEM_PERSISTENT); | 130 | MHD_RESPMEM_PERSISTENT); |
129 | if (!response) | 131 | if (!response) |
130 | return MHD_NO; | 132 | return MHD_NO; |
@@ -198,7 +200,7 @@ secret_page (struct MHD_Connection *connection) | |||
198 | const char *page = "<html><body>A secret.</body></html>"; | 200 | const char *page = "<html><body>A secret.</body></html>"; |
199 | 201 | ||
200 | response = | 202 | response = |
201 | MHD_create_response_from_buffer (strlen (page), (void *) page, | 203 | MHD_create_response_from_buffer (strlen (page), (void *) page, |
202 | MHD_RESPMEM_PERSISTENT); | 204 | MHD_RESPMEM_PERSISTENT); |
203 | if (!response) | 205 | if (!response) |
204 | return MHD_NO; | 206 | return MHD_NO; |