40 #include "lpc43xx_dualcore_config.h"
55 "<html><head><title>Congrats!</title></head>"
56 "<body><h1>Welcome to our lwIP HTTP server!</h1>"
57 "<p>This is a small test page, served by httpd of "
58 "lwip.</p></body></html>";
81 if (xSemaphoreTake(*mx, 500) != pdTRUE) {
100 #elif defined(OS_UCOS_III)
104 #include "os_cfg_app.h"
131 static OS_MUTEX fsmutex;
133 OSMutexCreate(&fsmutex,
"DOS_FS_Mutex", &os_err);
172 const char *pszExt =
NULL;
180 hdrs[1] = g_psHTTPHeaderStrings[HTTP_HDR_SERVER];
184 if (( fName ==
NULL) || ( *fName == 0) ) {
185 hdrs[0] = g_psHTTPHeaderStrings[HTTP_HDR_NOT_FOUND];
186 hdrs[2] = g_psHTTPHeaderStrings[DEFAULT_404_HTML];
193 if (strstr(fName,
"404")) {
194 iLoop = HTTP_HDR_NOT_FOUND;
196 else if (strstr(fName,
"400")) {
197 iLoop = HTTP_HDR_BAD_REQUEST;
199 else if (strstr(fName,
"501")) {
200 iLoop = HTTP_HDR_NOT_IMPL;
205 hdrs[0] = g_psHTTPHeaderStrings[iLoop];
209 pszExt = strrchr(fName,
'.');
214 if (pszExt ==
NULL) {
220 for (iLoop = 0; (iLoop < NUM_HTTP_HEADERS); iLoop++)
222 if (!strcmp(g_psHTTPHeaders[iLoop].extension, pszExt)) {
224 g_psHTTPHeaderStrings[g_psHTTPHeaders[iLoop].headerIndex];
229 if (iLoop == NUM_HTTP_HEADERS) {
231 hdrs[2] = g_psHTTPHeaderStrings[HTTP_HDR_DEFAULT_TYPE];
235 iLoop = strlen(hdrs[0]);
236 strcpy(buff, hdrs[0]);
237 strcat(buff, hdrs[1]);
238 strcat(buff, hdrs[2]);
260 fds = malloc(
sizeof(*fds));
262 DEBUGSTR(
"Malloc Failure, Out of Memory!\r\n");
265 memset(fds, 0,
sizeof(*fds));
292 LWIP_DEBUGF(HTTPD_DEBUG, (
"DFS: ERROR: Mutex Init!\r\n"));
297 LWIP_DEBUGF(HTTPD_DEBUG, (
"DFS: ERROR: Mutex Timeout!\r\n"));
300 memset(&tmpds, 0,
sizeof(tmpds));
305 LWIP_DEBUGF(HTTPD_DEBUG, (
"DFS: OPEN: File %s does not exist\r\n", name));
310 fds = malloc(
sizeof(*fds));
312 DEBUGSTR(
"Malloc Failure, Out of Memory!\r\n");
316 memcpy(fds, &tmpds,
sizeof(*fds));
349 if (
f_read(&fds->
fi, (uint8_t *) buffer, count, &i))
370 void assert_printf(
char *msg,
int line,
char *file)
372 DEBUGOUT(
"ASSERT: %s at %s:%d\r\n", msg, file, line);
376 const char *lwip_strerr(err_t eno)