changeset 265:6468241715e6

nginx-0.0.2-2004-02-20-19:48:59 import
author Igor Sysoev <igor@sysoev.ru>
date Fri, 20 Feb 2004 16:48:59 +0000
parents cd009bf7400d
children 5238e93961a1
files auto/lib/md5/conf auto/lib/test auto/summary src/core/ngx_conf_file.c src/http/modules/ngx_http_gzip_filter.c src/http/modules/proxy/ngx_http_proxy_handler.h src/http/ngx_http_file_cache.c src/os/unix/ngx_freebsd_sendfile_chain.c
diffstat 8 files changed, 63 insertions(+), 47 deletions(-) [+]
line wrap: on
line diff
--- a/auto/lib/md5/conf
+++ b/auto/lib/md5/conf
@@ -37,6 +37,7 @@ ngx_lib_inc="#include <sys/types.h>
     if [ $ngx_found = yes ]; then
         CORE_LIBS="$CORE_LIBS $ngx_libs"
         MD5=YES
+        MD5_LIB=md5
         ngx_found=no
 
     else
@@ -51,19 +52,24 @@ ngx_lib_inc="#include <sys/types.h>
     if [ $ngx_found = yes ]; then
         CORE_LIBS="$CORE_LIBS $ngx_libs"
         MD5=YES
+        MD5_LIB=md
         ngx_found=no
 
     else
-        ngx_lib="OpenSSL md5"
+        ngx_lib_inc="#include <sys/types.h>
+#include <openssl/md5.h>"
+        ngx_lib="OpenSSL md5 crypto"
         ngx_lib_test="MD5_CTX md5; MD5_Init(&md5)"
-        ngx_libs=-lmd5
+        ngx_libs=-lcrypto
         . auto/lib/test
     fi
 
 
     if [ $ngx_found = yes ]; then
         have=HAVE_OPENSSL_MD5 . auto/have
+        have=HAVE_OPENSSL_MD5_H . auto/have
         CORE_LIBS="$CORE_LIBS $ngx_libs"
         MD5=YES
+        MD5_LIB=crypto
     fi
 fi
--- a/auto/lib/test
+++ b/auto/lib/test
@@ -1,5 +1,5 @@
 
-echo "checking for $ngx_lib library"
+echo $ngx_n "checking for $ngx_lib library ..." $ngx_c
 echo >> $NGX_ERR
 echo "checking for $ngx_lib library" >> $NGX_ERR
 
@@ -12,12 +12,12 @@ eval "$CC $cc_test_flags -o $NGX_AUTOTES
      >> $NGX_ERR 2>&1"
 
 if [ -x $NGX_AUTOTEST ]; then
-    echo " + $ngx_lib found"
+    echo " found"
 
     ngx_found=yes
 
 else
-    echo " + $ngx_lib not found"
+    echo " not found"
 fi
 
 rm $NGX_AUTOTEST*
--- a/auto/summary
+++ b/auto/summary
@@ -2,15 +2,19 @@
 echo
 echo "Configuration summary"
 
-case $PCRE in
-    YES)   echo " + using system PCRE library" ;;
-    NONE)  echo " + PCRE library is not used" ;;
-    NO)    echo " + PCRE library is not found" ;;
-    *)     echo " + using PCRE library: $PCRE" ;;
-esac
+if [ $USE_PCRE = DISABLED ]; then
+    echo " + PCRE library is disabled"
+
+else
+    case $PCRE in
+        YES)   echo " + using system PCRE library" ;;
+        NO)    echo " + PCRE library is not found" ;;
+        *)     echo " + using PCRE library: $PCRE" ;;
+    esac
+fi
 
 case $MD5 in
-    YES)   echo " + using system md5 library" ;;
+    YES)   echo " + md5: using system $MD5_LIB library" ;;
     NONE)  echo " + md5 library is not used" ;;
     NO)    echo " + md5 library is not found" ;;
     *)     echo " + using md5 library: $MD5" ;;
--- a/src/core/ngx_conf_file.c
+++ b/src/core/ngx_conf_file.c
@@ -582,11 +582,11 @@ char *ngx_conf_set_flag_slot(ngx_conf_t 
 {
     char  *p = conf;
 
-    int         flag;
-    ngx_str_t  *value;
+    ngx_flag_t   flag;
+    ngx_str_t   *value;
 
 
-    if (*(int *) (p + cmd->offset) != NGX_CONF_UNSET) {
+    if (*(ngx_flag_t *) (p + cmd->offset) != NGX_CONF_UNSET) {
         return "is duplicate";
     }
 
@@ -606,7 +606,7 @@ char *ngx_conf_set_flag_slot(ngx_conf_t 
         return NGX_CONF_ERROR;
     }
 
-    *(int *) (p + cmd->offset) = flag;
+    *(ngx_flag_t *) (p + cmd->offset) = flag;
 
     return NGX_CONF_OK;
 }
@@ -636,12 +636,12 @@ char *ngx_conf_set_num_slot(ngx_conf_t *
 {
     char  *p = conf;
 
-    int              *np;
+    ngx_int_t        *np;
     ngx_str_t        *value;
     ngx_conf_post_t  *post;
 
 
-    np = (int *) (p + cmd->offset);
+    np = (ngx_int_t *) (p + cmd->offset);
 
     if (*np != NGX_CONF_UNSET) {
         return "is duplicate";
@@ -666,26 +666,26 @@ char *ngx_conf_set_size_slot(ngx_conf_t 
 {
     char  *p = conf;
 
-    int              *np;
+    ssize_t          *sp;
     ngx_str_t        *value;
     ngx_conf_post_t  *post;
 
 
-    np = (int *) (p + cmd->offset);
-    if (*np != NGX_CONF_UNSET) {
+    sp = (ssize_t *) (p + cmd->offset);
+    if (*sp != NGX_CONF_UNSET) {
         return "is duplicate";
     }
 
     value = (ngx_str_t *) cf->args->elts;
 
-    *np = ngx_parse_size(&value[1]);
-    if (*np == NGX_ERROR) {
+    *sp = ngx_parse_size(&value[1]);
+    if (*sp == NGX_ERROR) {
         return "invalid value";
     }
 
     if (cmd->post) {
         post = cmd->post;
-        return post->post_handler(cf, post, np);
+        return post->post_handler(cf, post, sp);
     }
 
     return NGX_CONF_OK;
@@ -696,30 +696,30 @@ char *ngx_conf_set_msec_slot(ngx_conf_t 
 {
     char  *p = conf;
 
-    int              *np;
+    ngx_msec_t       *msp;
     ngx_str_t        *value;
     ngx_conf_post_t  *post;
 
 
-    np = (int *) (p + cmd->offset);
-    if (*np != NGX_CONF_UNSET) {
+    msp = (ngx_msec_t *) (p + cmd->offset);
+    if (*msp != (ngx_msec_t) NGX_CONF_UNSET) {
         return "is duplicate";
     }
 
     value = (ngx_str_t *) cf->args->elts;
 
-    *np = ngx_parse_time(&value[1], 0);
-    if (*np == NGX_ERROR) {
+    *msp = ngx_parse_time(&value[1], 0);
+    if (*msp == (ngx_msec_t) NGX_ERROR) {
         return "invalid value";
     }
 
-    if (*np == NGX_PARSE_LARGE_TIME) {
+    if (*msp == (ngx_msec_t) NGX_PARSE_LARGE_TIME) {
         return "value must be less than 597 hours";
     }
 
     if (cmd->post) {
         post = cmd->post;
-        return post->post_handler(cf, post, np);
+        return post->post_handler(cf, post, msp);
     }
 
     return NGX_CONF_OK;
@@ -730,30 +730,30 @@ char *ngx_conf_set_sec_slot(ngx_conf_t *
 {
     char  *p = conf;
 
-    int              *np;
+    time_t           *sp;
     ngx_str_t        *value;
     ngx_conf_post_t  *post;
 
 
-    np = (int *) (p + cmd->offset);
-    if (*np != NGX_CONF_UNSET) {
+    sp = (time_t *) (p + cmd->offset);
+    if (*sp != NGX_CONF_UNSET) {
         return "is duplicate";
     }
 
     value = (ngx_str_t *) cf->args->elts;
 
-    *np = ngx_parse_time(&value[1], 1);
-    if (*np == NGX_ERROR) {
+    *sp = ngx_parse_time(&value[1], 1);
+    if (*sp == NGX_ERROR) {
         return "invalid value";
     }
 
-    if (*np == NGX_PARSE_LARGE_TIME) {
+    if (*sp == NGX_PARSE_LARGE_TIME) {
         return "value must be less than 68 years";
     }
 
     if (cmd->post) {
         post = cmd->post;
-        return post->post_handler(cf, post, np);
+        return post->post_handler(cf, post, sp);
     }
 
     return NGX_CONF_OK;
@@ -793,12 +793,12 @@ char *ngx_conf_set_bitmask_slot(ngx_conf
 {
     char  *p = conf;
 
-    int                 *np, i, m;
+    ngx_int_t           *np, i, m;
     ngx_str_t           *value;
     ngx_conf_bitmask_t  *mask;
 
 
-    np = (int *) (p + cmd->offset);
+    np = (ngx_int_t *) (p + cmd->offset);
     value = (ngx_str_t *) cf->args->elts;
     mask = cmd->post;
 
@@ -843,7 +843,7 @@ char *ngx_conf_unsupported(ngx_conf_t *c
 char *ngx_conf_check_num_bounds(ngx_conf_t *cf, void *post, void *data)
 {
     ngx_conf_num_bounds_t *bounds = post;
-    int *np = data;
+    ngx_int_t *np = data;
 
     if (bounds->high == -1) {
         if (*np >= bounds->low) {
--- a/src/http/modules/ngx_http_gzip_filter.c
+++ b/src/http/modules/ngx_http_gzip_filter.c
@@ -10,8 +10,8 @@ typedef struct {
     int                  enable;
     ngx_bufs_t           bufs;
     int                  level;
-    int                  wbits;
-    int                  memlevel;
+    ssize_t              wbits;
+    ssize_t              memlevel;
     int                  no_buffer;
 } ngx_http_gzip_conf_t;
 
@@ -667,8 +667,9 @@ static char *ngx_http_gzip_merge_conf(ng
     ngx_conf_merge_bufs_value(conf->bufs, prev->bufs, 4,
                               /* STUB: PAGE_SIZE */ 4096);
     ngx_conf_merge_value(conf->level, prev->level, 1);
-    ngx_conf_merge_value(conf->wbits, prev->wbits, MAX_WBITS);
-    ngx_conf_merge_value(conf->memlevel, prev->memlevel, MAX_MEM_LEVEL - 1);
+    ngx_conf_merge_size_value(conf->wbits, prev->wbits, MAX_WBITS);
+    ngx_conf_merge_size_value(conf->memlevel, prev->memlevel,
+                              MAX_MEM_LEVEL - 1);
     ngx_conf_merge_value(conf->no_buffer, prev->no_buffer, 0);
 
     return NGX_CONF_OK;
--- a/src/http/modules/proxy/ngx_http_proxy_handler.h
+++ b/src/http/modules/proxy/ngx_http_proxy_handler.h
@@ -65,7 +65,7 @@ typedef struct {
 
     int                              ignore_expires;
     int                              lm_factor;
-    int                              default_expires;
+    time_t                           default_expires;
 
     int                              next_upstream;
     int                              use_stale;
--- a/src/http/ngx_http_file_cache.c
+++ b/src/http/ngx_http_file_cache.c
@@ -4,7 +4,11 @@
 #include <ngx_http.h>
 
 
+#if (HAVE_OPENSSL_MD5_H)
+#include <openssl/md5.h>
+#else
 #include <md5.h>
+#endif
 
 #if (HAVE_OPENSSL_MD5)
 #define  MD5Init    MD5_Init
--- a/src/os/unix/ngx_freebsd_sendfile_chain.c
+++ b/src/os/unix/ngx_freebsd_sendfile_chain.c
@@ -28,7 +28,8 @@ ngx_chain_t *ngx_freebsd_sendfile_chain(
     int              rc;
     char            *prev;
     off_t            sent, fprev;
-    size_t           hsize, fsize, size;
+    size_t           hsize, fsize;
+    ssize_t          size;
     ngx_int_t        eintr, eagain;
     struct iovec    *iov;
     struct sf_hdtr   hdtr;