httpd: round down sendfile byte count to 64k *: style fixes
No binary (build failed)
—
(log yok)
| @@ -45,7 +45,7 @@ static unsigned julian; | |
| /* leap year -- account for Gregorian reformation in 1752 */ | |
| static int leap_year(unsigned yr) | |
| { | |
| - | if (yr <= 1752) |
| + | if (yr <= 1752) |
| return !(yr % 4); | |
| return (!(yr % 4) && (yr % 100)) || !(yr % 400); | |
| } | |
| @@ -475,8 +475,8 @@ static action*** parse_params(char **argv) | |
| "-o\0" | |
| USE_FEATURE_FIND_NOT( "!\0" ) | |
| #if ENABLE_DESKTOP | |
| - | "-and\0" |
| - | "-or\0" |
| + | "-and\0" |
| + | "-or\0" |
| USE_FEATURE_FIND_NOT( "-not\0" ) | |
| #endif | |
| "-print\0" | |
| @@ -487,7 +487,7 @@ static action*** parse_params(char **argv) | |
| USE_FEATURE_FIND_EXEC( "-exec\0" ) | |
| USE_FEATURE_FIND_PAREN( "(\0" ) | |
| /* All options starting from here require argument */ | |
| - | "-name\0" |
| + | "-name\0" |
| USE_FEATURE_FIND_PATH( "-path\0" ) | |
| USE_FEATURE_FIND_REGEX( "-regex\0" ) | |
| USE_FEATURE_FIND_TYPE( "-type\0" ) | |
| @@ -16,7 +16,7 @@ int ttysize_main(int argc, char **argv) | |
| { | |
| unsigned w,h; | |
| struct winsize wsz; | |
| - | |
| + | |
| w = 80; | |
| h = 24; | |
| if (!ioctl(0, TIOCGWINSZ, &wsz)) { | |
| @@ -1395,7 +1395,8 @@ static int sendFile(const char *url) | |
| fd++; /* write to fd #1 in inetd mode */ | |
| #if ENABLE_FEATURE_HTTPD_USE_SENDFILE | |
| do { | |
| - | count = sendfile(fd, f, &offset, MAXINT(ssize_t)); |
| + | /* byte count is rounded down to 64k */ |
| + | count = sendfile(fd, f, &offset, MAXINT(ssize_t) - 0xffff); |
| if (count < 0) { | |
| if (offset == 0) | |
| goto fallback; | |
| @@ -75,7 +75,7 @@ static const char runcon_longopts[] ALIGN1 = | |
| "type\0" Required_argument "t" | |
| "range\0" Required_argument "l" | |
| "compute\0" No_argument "c" | |
| - | "help\0" No_argument "h" |
| + | "help\0" No_argument "h" |
| ; | |
| #endif | |