1
0
mirror of https://github.com/apache/httpd.git synced 2025-07-30 20:03:10 +03:00

Size rigour.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84032 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ben Laurie
1999-10-24 19:24:13 +00:00
parent df37d04f04
commit 9030edb03b
6 changed files with 13 additions and 11 deletions

View File

@ -80,7 +80,7 @@ API_EXPORT(int) ap_scan_script_header_err_buff(request_rec *r, BUFF *f,
API_EXPORT(int) ap_scan_script_header_err_core(request_rec *r, char *buffer, API_EXPORT(int) ap_scan_script_header_err_core(request_rec *r, char *buffer,
int (*getsfunc) (char *, int, void *), int (*getsfunc) (char *, int, void *),
void *getsfunc_data); void *getsfunc_data);
API_EXPORT(void) ap_send_size(size_t size, request_rec *r); API_EXPORT(void) ap_send_size(ap_ssize_t size, request_rec *r);
API_EXPORT(int) ap_call_exec(request_rec *r, ap_child_info_t *pinfo, char *argv0, char **env, API_EXPORT(int) ap_call_exec(request_rec *r, ap_child_info_t *pinfo, char *argv0, char **env,
int shellcmd); int shellcmd);

View File

@ -887,7 +887,8 @@ static int ignore_entry(autoindex_config_rec *d, char *path)
static void do_emit_plain(request_rec *r, ap_file_t *f) static void do_emit_plain(request_rec *r, ap_file_t *f)
{ {
char buf[IOBUFSIZE + 1]; char buf[IOBUFSIZE + 1];
int i, n, c, ch; int i, c, ch;
ap_ssize_t n;
ap_status_t stat; ap_status_t stat;
ap_rputs("<PRE>\n", r); ap_rputs("<PRE>\n", r);
@ -1080,7 +1081,8 @@ static char *find_title(request_rec *r)
{ {
char titlebuf[MAX_STRING_LEN], *find = "<TITLE>"; char titlebuf[MAX_STRING_LEN], *find = "<TITLE>";
ap_file_t *thefile = NULL; ap_file_t *thefile = NULL;
int x, y, n, p; int x, y, p;
ap_ssize_t n;
if (r->status != HTTP_OK) { if (r->status != HTTP_OK) {
return NULL; return NULL;

View File

@ -2012,7 +2012,7 @@ API_EXPORT(long) ap_send_fd_length(ap_file_t *fd, request_rec *r, long length)
char buf[IOBUFSIZE]; char buf[IOBUFSIZE];
long total_bytes_sent = 0; long total_bytes_sent = 0;
register int w, o; register int w, o;
int n; ap_ssize_t n;
ap_status_t status; ap_status_t status;
if (length == 0) if (length == 0)

View File

@ -739,7 +739,7 @@ static int config_log_transaction(request_rec *r, config_log_state *cls,
int *strl; int *strl;
request_rec *orig; request_rec *orig;
int i; int i;
int len = 0; ap_ssize_t len = 0;
ap_array_header_t *format; ap_array_header_t *format;
char *envar; char *envar;

View File

@ -155,7 +155,7 @@ static int get_rfc1413(ap_socket_t *sock, const char *local_ip,
#endif #endif
i = 0; i = 0;
while(i < strlen(buffer)) { while(i < strlen(buffer)) {
int j = strlen(buffer + i); ap_ssize_t j = strlen(buffer + i);
ap_status_t status; ap_status_t status;
status = ap_send(sock, buffer+i, &j); status = ap_send(sock, buffer+i, &j);
if (status != APR_SUCCESS && status != APR_EINTR) { if (status != APR_SUCCESS && status != APR_EINTR) {
@ -181,7 +181,7 @@ static int get_rfc1413(ap_socket_t *sock, const char *local_ip,
* this allows it to work on both ASCII and EBCDIC machines. * this allows it to work on both ASCII and EBCDIC machines.
*/ */
while((cp = strchr(buffer, '\012')) == NULL && i < sizeof(buffer) - 1) { while((cp = strchr(buffer, '\012')) == NULL && i < sizeof(buffer) - 1) {
int j = sizeof(buffer) - 1 - i; ap_ssize_t j = sizeof(buffer) - 1 - i;
ap_status_t status; ap_status_t status;
status = ap_recv(sock, buffer+i, &j); status = ap_recv(sock, buffer+i, &j);
if (status != APR_SUCCESS && status != APR_EINTR) { if (status != APR_SUCCESS && status != APR_EINTR) {

View File

@ -626,10 +626,10 @@ API_EXPORT(int) ap_scan_script_header_err_buff(request_rec *r, BUFF *fb,
} }
API_EXPORT(void) ap_send_size(size_t size, request_rec *r) API_EXPORT(void) ap_send_size(ap_ssize_t size, request_rec *r)
{ {
/* XXX: this -1 thing is a gross hack */ /* XXX: this -1 thing is a gross hack */
if (size == (size_t)-1) { if (size == (ap_ssize_t)-1) {
ap_rputs(" -", r); ap_rputs(" -", r);
} }
else if (!size) { else if (!size) {
@ -639,13 +639,13 @@ API_EXPORT(void) ap_send_size(size_t size, request_rec *r)
ap_rputs(" 1k", r); ap_rputs(" 1k", r);
} }
else if (size < 1048576) { else if (size < 1048576) {
ap_rprintf(r, "%4dk", (size + 512) / 1024); ap_rprintf(r, "%4ldk", (size + 512) / 1024);
} }
else if (size < 103809024) { else if (size < 103809024) {
ap_rprintf(r, "%4.1fM", size / 1048576.0); ap_rprintf(r, "%4.1fM", size / 1048576.0);
} }
else { else {
ap_rprintf(r, "%4dM", (size + 524288) / 1048576); ap_rprintf(r, "%4ldM", (size + 524288) / 1048576);
} }
} }