From e71ff9dc18c0e4d0cd63f0c168e64205af4ccb5a Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Fri, 9 Aug 2013 18:23:08 +0200 Subject: mothra: log post data with debug flag, increase max token length from 1K to 4K --- sys/src/cmd/mothra/forms.c | 9 ++++++++- sys/src/cmd/mothra/html.h | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/src/cmd/mothra/forms.c b/sys/src/cmd/mothra/forms.c index 0d9054b81..321751214 100644 --- a/sys/src/cmd/mothra/forms.c +++ b/sys/src/cmd/mothra/forms.c @@ -687,12 +687,19 @@ void h_submitinput(Panel *p, int){ if(debug)fprint(2, "GET %s\n", buf); geturl(buf, -1, 0, 0); } else { + if(debug){ + fprint(2, "POST %s ->\n", form->action); + if(form->ctype) + mencodeform(form, 2); + else + uencodeform(form, 2); + fprint(2, "\n"); + } /* only set for multipart/form-data */ if(form->ctype) mencodeform(form, fd); else uencodeform(form, fd); - if(debug)fprint(2, "POST %s\n", form->action); geturl(form->action, fd, 0, 0); } } diff --git a/sys/src/cmd/mothra/html.h b/sys/src/cmd/mothra/html.h index 0e3d1a8ea..0988a7e80 100644 --- a/sys/src/cmd/mothra/html.h +++ b/sys/src/cmd/mothra/html.h @@ -4,7 +4,7 @@ #define NSTACK 100 /* html grammar is not recursive, so 30 or so should do */ #define NHBUF 8192 /* Input buffer size */ #define NPEEKC 3 /* Maximum lookahead */ -#define NTOKEN 1024 /* Maximum token length */ +#define NTOKEN 4096 /* Maximum token length */ #define NATTR 512 /* Maximum number of attributes of a tag */ typedef struct Pair Pair; typedef struct Tag Tag; -- cgit v1.2.3