|
@@ -293,6 +293,7 @@ connect:
|
|
|
++failed;
|
|
++failed;
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
+ int total_rdbytes = 0;
|
|
|
write:
|
|
write:
|
|
|
if (timerexpired) break;
|
|
if (timerexpired) break;
|
|
|
wrbytes = write(sock, request, len);
|
|
wrbytes = write(sock, request, len);
|
|
@@ -319,7 +320,16 @@ read:
|
|
|
if (verbose) {
|
|
if (verbose) {
|
|
|
printf("%.*s\n", rdbytes, buf);
|
|
printf("%.*s\n", rdbytes, buf);
|
|
|
}
|
|
}
|
|
|
|
|
+ static int s_rdbytes = 0;
|
|
|
|
|
+ if (s_rdbytes == 0) {
|
|
|
|
|
+ s_rdbytes = rdbytes;
|
|
|
|
|
+ }
|
|
|
bytes += rdbytes;
|
|
bytes += rdbytes;
|
|
|
|
|
+ total_rdbytes += rdbytes;
|
|
|
|
|
+ if (total_rdbytes < s_rdbytes) {
|
|
|
|
|
+ // NOTE: some http server head and body send not one packet.
|
|
|
|
|
+ goto read;
|
|
|
|
|
+ }
|
|
|
++succeed;
|
|
++succeed;
|
|
|
close:
|
|
close:
|
|
|
if (!keepalive) {
|
|
if (!keepalive) {
|