Bring preprocessor directives in line.

This commit is contained in:
Emil Mikulic 2011-05-01 19:29:13 +10:00
parent a3b31af2be
commit 07be6a2f1b
1 changed files with 15 additions and 19 deletions

View File

@ -1912,12 +1912,11 @@ static void process_request(struct connection *conn) {
/* Receiving request. */
static void poll_recv_request(struct connection *conn) {
#define BUFSIZE 65536
char buf[BUFSIZE];
char buf[1<<15];
ssize_t recvd;
assert(conn->state == RECV_REQUEST);
recvd = recv(conn->socket, buf, BUFSIZE, 0);
recvd = recv(conn->socket, buf, sizeof(buf), 0);
if (debug)
printf("poll_recv_request(%d) got %d bytes\n",
conn->socket, (int)recvd);
@ -1935,7 +1934,6 @@ static void poll_recv_request(struct connection *conn) {
return;
}
conn->last_active = now;
#undef BUFSIZE
/* append to conn->request */
assert(recvd > 0);
@ -2046,11 +2044,10 @@ static ssize_t send_from_file(const int s, const int fd,
size = 1<<20;
return sendfile(s, fd, &ofs, size);
#else
#define BUFSIZE 20000
char buf[BUFSIZE];
size_t amount = min((size_t)BUFSIZE, size);
char buf[1<<15];
size_t amount = min(sizeof(buf), size);
ssize_t numread;
#undef BUFSIZE
if (lseek(fd, ofs, SEEK_SET) == -1)
err(1, "fseek(%d)", (int)ofs);
@ -2152,7 +2149,6 @@ static void httpd_poll(void) {
/* set recv/send fd_sets */
#define MAX_FD_SET(sock, fdset) { FD_SET(sock,fdset); \
max_fd = (max_fd<sock) ? sock : max_fd; }
MAX_FD_SET(sockin, &recv_set);
LIST_FOREACH_SAFE(conn, &connlist, entries, next) {