Yet another PETSCII<->ASCII issue solved - this time it caused failure to send the right content type.

This commit is contained in:
oliverschmidt 2007-12-09 23:35:03 +00:00
parent 43d394f758
commit b1e1f07f64

View file

@ -30,7 +30,7 @@
* *
* Author: Adam Dunkels <adam@sics.se> * Author: Adam Dunkels <adam@sics.se>
* *
* $Id: httpd-cfs.c,v 1.8 2007/12/01 21:27:48 oliverschmidt Exp $ * $Id: httpd-cfs.c,v 1.9 2007/12/09 23:35:03 oliverschmidt Exp $
*/ */
#include <string.h> #include <string.h>
@ -115,6 +115,7 @@ PT_THREAD(handle_output(struct httpd_state *s))
petsciiconv_topetscii(s->filename, sizeof(s->filename)); petsciiconv_topetscii(s->filename, sizeof(s->filename));
s->fd = cfs_open(s->filename, CFS_READ); s->fd = cfs_open(s->filename, CFS_READ);
petsciiconv_toascii(s->filename, sizeof(s->filename));
if(s->fd < 0) { if(s->fd < 0) {
s->fd = cfs_open("404.html", CFS_READ); s->fd = cfs_open("404.html", CFS_READ);
if(s->fd < 0) { if(s->fd < 0) {
@ -159,7 +160,9 @@ PT_THREAD(handle_input(struct httpd_state *s))
strncpy(s->filename, &s->inputbuf[1], sizeof(s->filename)); strncpy(s->filename, &s->inputbuf[1], sizeof(s->filename));
} }
petsciiconv_topetscii(s->filename, sizeof(s->filename));
webserver_log_file(&uip_conn->ripaddr, s->filename); webserver_log_file(&uip_conn->ripaddr, s->filename);
petsciiconv_toascii(s->filename, sizeof(s->filename));
s->state = STATE_OUTPUT; s->state = STATE_OUTPUT;
while(1) { while(1) {