summaryrefslogtreecommitdiff
path: root/test_http_server.cc
diff options
context:
space:
mode:
authorAndrew de los Reyes <adlr@chromium.org>2010-04-15 14:02:17 -0700
committerAndrew de los Reyes <adlr@chromium.org>2010-04-15 14:02:17 -0700
commit08c4e27baaa7b40732b99642e1f21bf889d022ef (patch)
tree816583a62961b5caa1f1e13ba74e88ff070cf2c6 /test_http_server.cc
parentb10320d4f76a2d263566f6eed471921382fae800 (diff)
update engine: 32- and 64-bit compile
Review URL: http://codereview.chromium.org/1599029
Diffstat (limited to 'test_http_server.cc')
-rw-r--r--test_http_server.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/test_http_server.cc b/test_http_server.cc
index 94c88fa1..9fbe97f5 100644
--- a/test_http_server.cc
+++ b/test_http_server.cc
@@ -14,6 +14,7 @@
#include <sys/socket.h>
#include <sys/types.h>
#include <errno.h>
+#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -98,7 +99,7 @@ void WriteString(int fd, const string& str) {
string Itoa(off_t num) {
char buf[100] = {0};
- snprintf(buf, sizeof(buf), "%lld", num);
+ snprintf(buf, sizeof(buf), "%" PRIi64, num);
return buf;
}
@@ -120,6 +121,7 @@ void WriteHeaders(int fd, bool support_range, off_t full_size,
}
void HandleQuitQuitQuit(int fd) {
+ WriteHeaders(fd, true, 0, 0);
exit(0);
}
@@ -142,14 +144,15 @@ void HandleBig(int fd, const HttpRequest& request) {
void HandleFlaky(int fd, const HttpRequest& request) {
const off_t full_length = kBigLength;
WriteHeaders(fd, true, full_length, request.offset);
- const off_t content_length = min(9000LL, full_length - request.offset);
+ const off_t content_length =
+ min(static_cast<off_t>(9000), full_length - request.offset);
const bool should_sleep = (request.offset % (9000 * 7)) == 0;
string buf;
for (int i = request.offset; i % 10; i++)
buf.append(1, 'a' + (i % 10));
- while (buf.size() < content_length)
+ while (static_cast<off_t>(buf.size()) < content_length)
buf.append("abcdefghij");
buf.resize(content_length);