]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Size rigour.
authorBen Laurie <ben@apache.org>
Sun, 24 Oct 1999 19:24:13 +0000 (19:24 +0000)
committerBen Laurie <ben@apache.org>
Sun, 24 Oct 1999 19:24:13 +0000 (19:24 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84032 13f79535-47bb-0310-9956-ffa450edef68

include/util_script.h
modules/generators/mod_autoindex.c
modules/http/http_protocol.c
modules/loggers/mod_log_config.c
server/rfc1413.c
server/util_script.c

index 5fc64ccd380b35f64c89b34a04b5ffe643d450fc..6ef075aa9e9f9d6b5f07ee42c886e4cefcaaa00a 100644 (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,
                                       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);
 
index 6f1ea1c1c8b7e7c46fb65c1698c6cb9b183db8b0..1077fe5c3530b2e1449179edc0b01e8a82c673fa 100644 (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)
 {
     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;
index 4e5d2bac0a41568160d8f716de3fd838051a4b36..66497f188f59f0b1bb3435aef940c51d5313b3fa 100644 (file)
@@ -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)
index 636645bbe9fdea41b17fa8d07069033b5396a2e8..4d173862e651a8f689c4b7f205d9f26136c54a19 100644 (file)
@@ -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;
 
index 30564dca82179d46b7200228289a97d53d3ea294..8c73b912efc1b106dc254e442dd3cd6b937ef250 100644 (file)
@@ -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) {
index 08bf8dc3990dc11ea729ce72b50e3f9691a763f2..187d9015e706297ec81886178b3bc4fcdaf2d56a 100644 (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 */
-    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);
     }
 }