deflatehd: Require empty line for each HTTP/1 style header set

This commit is contained in:
Tatsuhiro Tsujikawa 2013-11-17 22:49:38 +09:00
parent 8915e91b17
commit c22cb53b5e
1 changed files with 8 additions and 3 deletions

View File

@ -225,14 +225,18 @@ static int perform_from_http1text(nghttp2_hd_context *deflater)
inputlen += nv->namelen + nv->valuelen; inputlen += nv->namelen + nv->valuelen;
} }
deflate_hd(deflater, nva, nvlen, inputlen, seq); if(!end) {
if(seq > 0) {
printf(",\n");
}
deflate_hd(deflater, nva, nvlen, inputlen, seq);
}
for(i = 0; i < nvlen; ++i) { for(i = 0; i < nvlen; ++i) {
free(nva[i].name); free(nva[i].name);
free(nva[i].value); free(nva[i].value);
} }
if(end) break; if(end) break;
printf(",\n");
++seq; ++seq;
} }
printf("]\n"); printf("]\n");
@ -272,7 +276,8 @@ static void print_help(void)
"]\n" "]\n"
"\n" "\n"
"With -t option, the program can accept more familiar HTTP/1 style\n" "With -t option, the program can accept more familiar HTTP/1 style\n"
"header field block. Each header set is delimited by empty line:\n" "header field block. Each header set must be followed by one empty\n"
"line:\n"
"\n" "\n"
"Example:\n" "Example:\n"
":method: GET\n" ":method: GET\n"