diff options
author | Yang Tse <yangsita@gmail.com> | 2007-10-03 23:38:07 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2007-10-03 23:38:07 +0000 |
commit | 0ac5fd354b87edbc926b23e2d6a065371beacfb3 (patch) | |
tree | ab13b16f9edc38895d4a76c7df3b61eee0f721a5 /tests | |
parent | a11c8a6ea0cd3c63bc28a673881a46d52e0597e7 (diff) |
If TCP_NODELAY is not defined we can't disable the Nagle algorithm
Diffstat (limited to 'tests')
-rw-r--r-- | tests/server/sws.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/server/sws.c b/tests/server/sws.c index 1391bf93f..65b81a4c0 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -788,7 +788,6 @@ int main(int argc, char *argv[]) #ifdef CURL_SWS_FORK_ENABLED bool use_fork = FALSE; #endif - int opt; while(argc>arg) { if(!strcmp("--version", argv[arg])) { @@ -951,15 +950,17 @@ int main(int argc, char *argv[]) #endif logmsg("====> Client connect"); +#ifdef TCP_NODELAY /* * Disable the Nagle algorithm to make it easier to send out a large * response in many small segments to torture the clients more. */ - opt = 1; + flag = 1; if (setsockopt(msgsock, IPPROTO_TCP, TCP_NODELAY, - (void *)&opt, sizeof(opt)) == -1) { + (void *)&flag, sizeof(flag)) == -1) { logmsg("====> TCP_NODELAY failed"); } +#endif do { if(get_request(msgsock, &req)) |