1
0
Fork 0
mirror of git://git.psyc.eu/libpsyc synced 2024-08-15 03:19:02 +00:00

testServer: no_render option

This commit is contained in:
Gabor Adam Toth 2011-05-13 23:31:43 +02:00
parent 0b823493f9
commit 0d415308b8

View file

@ -62,6 +62,7 @@ int main (int argc, char **argv)
w - v > 0 && memchr(w+1, (int)'v', strlen(opts) - (w - opts)) ? 3 : 2 : 1 : 0; w - v > 0 && memchr(w+1, (int)'v', strlen(opts) - (w - opts)) ? 3 : 2 : 1 : 0;
uint8_t routing_only = opts && memchr(opts, (int)'r', strlen(opts)); uint8_t routing_only = opts && memchr(opts, (int)'r', strlen(opts));
uint8_t parse_multiple = opts && memchr(opts, (int)'m', strlen(opts)); uint8_t parse_multiple = opts && memchr(opts, (int)'m', strlen(opts));
uint8_t no_render = opts && memchr(opts, (int)'n', strlen(opts));
uint8_t progress = opts && memchr(opts, (int)'p', strlen(opts)); uint8_t progress = opts && memchr(opts, (int)'p', strlen(opts));
uint8_t stats = opts && memchr(opts, (int)'s', strlen(opts)); uint8_t stats = opts && memchr(opts, (int)'s', strlen(opts));
size_t recv_buf_size = argc > 3 ? atoi(argv[3]) : 0; size_t recv_buf_size = argc > 3 ? atoi(argv[3]) : 0;
@ -114,7 +115,7 @@ int main (int argc, char **argv)
hints.ai_socktype = SOCK_STREAM; hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_PASSIVE; hints.ai_flags = AI_PASSIVE;
if ((rv = getaddrinfo(NULL, port, &hints, &ai)) != 0) if ((rv = getaddrinfo(NULL, port, &hints, &ai)) != 0)
{ {
fprintf(stderr, "error: %s\n", gai_strerror(rv)); fprintf(stderr, "error: %s\n", gai_strerror(rv));
exit(1); exit(1);
} }
@ -295,6 +296,8 @@ int main (int argc, char **argv)
if (!parse_multiple) // parse multiple packets? if (!parse_multiple) // parse multiple packets?
ret = -1; ret = -1;
if (!no_render)
{
packets[i].flag = psyc_isParseContentLengthFound(&parsers[i]) ? packets[i].flag = psyc_isParseContentLengthFound(&parsers[i]) ?
PSYC_PACKET_NEED_LENGTH : PSYC_PACKET_NO_LENGTH; PSYC_PACKET_NEED_LENGTH : PSYC_PACKET_NO_LENGTH;
@ -319,6 +322,7 @@ int main (int argc, char **argv)
perror("render error"); perror("render error");
ret = -1; ret = -1;
} }
}
// reset packet // reset packet
packets[i].routingLength = 0; packets[i].routingLength = 0;