diff options
author | 2008-10-21 13:54:48 -0400 | |
---|---|---|
committer | 2008-10-21 13:54:48 -0400 | |
commit | 8656393c5cbc5171e5baa30bc79fe13ffa0f406d (patch) | |
tree | 0def64e149d89811b6bcb98012313482e60f4c1c | |
parent | 69559dc94815a000729c7ccef8216dec5b5158cc (diff) |
Fix a nasty driver bug, involving memory restarts and marked-up request strings
-rw-r--r-- | demo/listFun.ur | 1 | ||||
-rw-r--r-- | src/c/driver.c | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/demo/listFun.ur b/demo/listFun.ur index c4451e1d..c281a07d 100644 --- a/demo/listFun.ur +++ b/demo/listFun.ur @@ -12,6 +12,7 @@ functor Make(M : sig fun console (ls : list M.t) = return <xml><body> Current list: {toXml ls}<br/> + Reversed list: {toXml (rev ls)}<br/> Length: {[length ls]}<br/> <br/> diff --git a/src/c/driver.c b/src/c/driver.c index 705bb613..94436298 100644 --- a/src/c/driver.c +++ b/src/c/driver.c @@ -116,7 +116,7 @@ static void *worker(void *data) { *back = 0; if (s = strstr(buf, "\r\n\r\n")) { - char *cmd, *path, *inputs; + char *cmd, *path, path_copy[uw_bufsize+1], *inputs; *s = 0; @@ -175,7 +175,8 @@ static void *worker(void *data) { uw_write(ctx, "Content-type: text/html\r\n\r\n"); uw_write(ctx, "<html>"); - fk = uw_begin(ctx, path); + strcpy(path_copy, path); + fk = uw_begin(ctx, path_copy); if (fk == SUCCESS) { uw_write(ctx, "</html>"); break; |