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:
@ -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,
|
||||
int (*getsfunc) (char *, int, void *),
|
||||
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,
|
||||
int shellcmd);
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
char buf[IOBUFSIZE + 1];
|
||||
int i, n, c, ch;
|
||||
int i, c, ch;
|
||||
ap_ssize_t n;
|
||||
ap_status_t stat;
|
||||
|
||||
ap_rputs("<PRE>\n", r);
|
||||
@ -1080,7 +1081,8 @@ static char *find_title(request_rec *r)
|
||||
{
|
||||
char titlebuf[MAX_STRING_LEN], *find = "<TITLE>";
|
||||
ap_file_t *thefile = NULL;
|
||||
int x, y, n, p;
|
||||
int x, y, p;
|
||||
ap_ssize_t n;
|
||||
|
||||
if (r->status != HTTP_OK) {
|
||||
return NULL;
|
||||
|
@ -2012,7 +2012,7 @@ API_EXPORT(long) ap_send_fd_length(ap_file_t *fd, request_rec *r, long length)
|
||||
char buf[IOBUFSIZE];
|
||||
long total_bytes_sent = 0;
|
||||
register int w, o;
|
||||
int n;
|
||||
ap_ssize_t n;
|
||||
ap_status_t status;
|
||||
|
||||
if (length == 0)
|
||||
|
@ -739,7 +739,7 @@ static int config_log_transaction(request_rec *r, config_log_state *cls,
|
||||
int *strl;
|
||||
request_rec *orig;
|
||||
int i;
|
||||
int len = 0;
|
||||
ap_ssize_t len = 0;
|
||||
ap_array_header_t *format;
|
||||
char *envar;
|
||||
|
||||
|
@ -155,7 +155,7 @@ static int get_rfc1413(ap_socket_t *sock, const char *local_ip,
|
||||
#endif
|
||||
i = 0;
|
||||
while(i < strlen(buffer)) {
|
||||
int j = strlen(buffer + i);
|
||||
ap_ssize_t j = strlen(buffer + i);
|
||||
ap_status_t status;
|
||||
status = ap_send(sock, buffer+i, &j);
|
||||
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.
|
||||
*/
|
||||
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;
|
||||
status = ap_recv(sock, buffer+i, &j);
|
||||
if (status != APR_SUCCESS && status != APR_EINTR) {
|
||||
|
@ -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 */
|
||||
if (size == (size_t)-1) {
|
||||
if (size == (ap_ssize_t)-1) {
|
||||
ap_rputs(" -", r);
|
||||
}
|
||||
else if (!size) {
|
||||
@ -639,13 +639,13 @@ API_EXPORT(void) ap_send_size(size_t size, request_rec *r)
|
||||
ap_rputs(" 1k", r);
|
||||
}
|
||||
else if (size < 1048576) {
|
||||
ap_rprintf(r, "%4dk", (size + 512) / 1024);
|
||||
ap_rprintf(r, "%4ldk", (size + 512) / 1024);
|
||||
}
|
||||
else if (size < 103809024) {
|
||||
ap_rprintf(r, "%4.1fM", size / 1048576.0);
|
||||
}
|
||||
else {
|
||||
ap_rprintf(r, "%4dM", (size + 524288) / 1048576);
|
||||
ap_rprintf(r, "%4ldM", (size + 524288) / 1048576);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user