httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ic...@apache.org
Subject svn commit: r1724821 - in /httpd/test/mod_h2/trunk: conf/sites/test.example.org.conf configure.ac mh2fuzz/h2c_conn.c mh2fuzz/h2c_session.c mh2fuzz/h2c_util.c mh2fuzz/h2c_util.h mh2fuzz/mh2f_fuzzer.c test/test_common.sh test/test_fuzz.sh test/test_push.sh
Date Fri, 15 Jan 2016 14:28:37 GMT
Author: icing
Date: Fri Jan 15 14:28:36 2016
New Revision: 1724821

URL: http://svn.apache.org/viewvc?rev=1724821&view=rev
Log:
test cases for push diary and cache digests

Modified:
    httpd/test/mod_h2/trunk/conf/sites/test.example.org.conf
    httpd/test/mod_h2/trunk/configure.ac
    httpd/test/mod_h2/trunk/mh2fuzz/h2c_conn.c
    httpd/test/mod_h2/trunk/mh2fuzz/h2c_session.c
    httpd/test/mod_h2/trunk/mh2fuzz/h2c_util.c
    httpd/test/mod_h2/trunk/mh2fuzz/h2c_util.h
    httpd/test/mod_h2/trunk/mh2fuzz/mh2f_fuzzer.c
    httpd/test/mod_h2/trunk/test/test_common.sh
    httpd/test/mod_h2/trunk/test/test_fuzz.sh
    httpd/test/mod_h2/trunk/test/test_push.sh

Modified: httpd/test/mod_h2/trunk/conf/sites/test.example.org.conf
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/conf/sites/test.example.org.conf?rev=1724821&r1=1724820&r2=1724821&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/conf/sites/test.example.org.conf (original)
+++ httpd/test/mod_h2/trunk/conf/sites/test.example.org.conf Fri Jan 15 14:28:36 2016
@@ -109,6 +109,9 @@
     <Location "/server-status">
         SetHandler server-status
     </Location>
+    <Location "/http2-status">
+        SetHandler http2-status
+    </Location>
 
     <IfModule proxy_fcgi_module>
         <FilesMatch "\.php$">
@@ -166,4 +169,23 @@
         Header add Link "</006/006.css;rel=preload, </006/006.js>; preload"
     </Location>
     
+    <Location /apache.org.html>
+        Header add Link "</apache.org-files/defaulten.js>;rel=preload"
+        Header add Link "</apache.org-files/css.css>;rel=preload"
+        Header add Link "</apache.org-files/min.css>;rel=preload"
+        Header add Link "</apache.org-files/styles.css>;rel=preload"
+        Header add Link "</apache.org-files/jsapi.js>;rel=preload"
+        Header add Link "</apache.org-files/defaulten.css>;rel=preload"
+        Header add Link "</apache.org-files/default.css>;rel=preload"
+        Header add Link "</apache.org-files/jquery-2.js>;rel=preload"
+        Header add Link "</apache.org-files/cse.js>;rel=preload"
+        Header add Link "</apache.org-files/asf_logo.png>;rel=preload"
+        Header add Link "</apache.org-files/mrunit.jpg>;rel=preload"
+        Header add Link "</apache.org-files/synapse.jpg>;rel=preload"
+        Header add Link "</apache.org-files/ant.jpg>;rel=preload"
+    </Location>
+
+    <Location "/http2-status">
+        SetHandler http2-status
+    </Location>
 </VirtualHost>

Modified: httpd/test/mod_h2/trunk/configure.ac
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/configure.ac?rev=1724821&r1=1724820&r2=1724821&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/configure.ac (original)
+++ httpd/test/mod_h2/trunk/configure.ac Fri Jan 15 14:28:36 2016
@@ -52,7 +52,7 @@ AC_ARG_WITH([serverdir], [AS_HELP_STRING
     [Use serverdir directory for setup [default=gen/apache]])],
     [request_serverdir=$withval], [request_serverdir=$PWD/gen/apache])
 
-NGHTTP2_VERSION=1.5.0
+NGHTTP2_VERSION=1.6.0
 
 AC_ARG_WITH([nghttp2-version], [AS_HELP_STRING([--with-nghttp2-version],
     [Use nghttp2 of specified version [default=<ignore>]])],

Modified: httpd/test/mod_h2/trunk/mh2fuzz/h2c_conn.c
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/mh2fuzz/h2c_conn.c?rev=1724821&r1=1724820&r2=1724821&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/mh2fuzz/h2c_conn.c (original)
+++ httpd/test/mod_h2/trunk/mh2fuzz/h2c_conn.c Fri Jan 15 14:28:36 2016
@@ -146,7 +146,9 @@ static apr_status_t tls_shutdown_read(h2
     apr_status_t status;
     
     status = tls_read(c);
-    
+    if (!c->socket) {
+        return APR_EOF;
+    }
     if (c->verbose > 1) {
         fprintf(stderr, "h2c_conn(%ld): tls shutdown\n", c->id);
     }

Modified: httpd/test/mod_h2/trunk/mh2fuzz/h2c_session.c
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/mh2fuzz/h2c_session.c?rev=1724821&r1=1724820&r2=1724821&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/mh2fuzz/h2c_session.c (original)
+++ httpd/test/mod_h2/trunk/mh2fuzz/h2c_session.c Fri Jan 15 14:28:36 2016
@@ -91,11 +91,62 @@ static ssize_t raw_send(nghttp2_session
                         size_t length, int flags, void *user_data)
 {
     h2c_session *s = user_data;
+    apr_size_t len, written = 0;
+    apr_status_t status;
+    
+    while (length > 0) {
+        if (h2c_conn_wbuf_left(s->c) == 0) {
+            status = h2c_conn_write(s->c);
+            if (APR_STATUS_IS_EAGAIN(status)) {
+                return written;
+            }
+        }
+        len = h2c_conn_wbuf_append(s->c, (const char*)data, length);
+        length -= len;
+        data += len;
+        written += len;
+    }
+    return written;
+}
+
+static uint32_t myhtonl(uint32_t hl) {
+  uint32_t nl;
+  unsigned char *p = (unsigned char *)&nl;
+  *p++ = hl >> 24;
+  *p++ = (hl >> 16) & 0xffu;
+  *p++ = (hl >> 8) & 0xffu;
+  *p = hl & 0xffu;
+  return nl;
+}
+
+void put_htonl(uint8_t *buffer, uint32_t hl) {
+  uint32_t nl = htonl(hl);
+  memcpy(buffer, &nl, sizeof(uint32_t));
+}
 
-    if (h2c_conn_wbuf_left(s->c) == 0) {
-        return NGHTTP2_ERR_WOULDBLOCK;
+static apr_status_t send_frame(h2c_session *s, uint8_t type, uint8_t flags, 
+                               int stream_id, void *payload, apr_size_t paylen)
+{
+    apr_status_t status;
+    uint8_t buffer[9];
+    
+    while (h2c_conn_wbuf_left(s->c) < (9+paylen)) {
+        status = h2c_conn_write(s->c);
+        if (!status == APR_SUCCESS) {
+            return status;
+        }
     }
-    return h2c_conn_wbuf_append(s->c, (const char*)data, length);
+    /* enough room, write frame into connection buffer */
+    
+    put_htonl(&buffer[0], paylen << 8);
+    buffer[3] = type;
+    buffer[4] = flags;
+    put_htonl(&buffer[5], stream_id);
+    
+    h2c_conn_wbuf_append(s->c, (const char*)buffer, 9);
+    h2c_conn_wbuf_append(s->c, payload, paylen);
+    
+    return APR_SUCCESS;
 }
 
 static void log_frame(h2c_session *s, const char *msg, const nghttp2_frame *frame, FILE *f)
@@ -403,6 +454,7 @@ static apr_status_t on_conn_connect(h2c_
     }
 
     h2c_conn_want_io(c, H2C_CONN_READ|H2C_CONN_WRITE);
+    
     return rv? APR_EGENERAL : APR_SUCCESS;
 }
 

Modified: httpd/test/mod_h2/trunk/mh2fuzz/h2c_util.c
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/mh2fuzz/h2c_util.c?rev=1724821&r1=1724820&r2=1724821&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/mh2fuzz/h2c_util.c (original)
+++ httpd/test/mod_h2/trunk/mh2fuzz/h2c_util.c Fri Jan 15 14:28:36 2016
@@ -109,3 +109,103 @@ h2c_ngheader *h2c_util_ngheader_make_req
     return ngh;
 }
 
+/*******************************************************************************
+ * base53 url encode/decode
+ ******************************************************************************/
+
+static const int BASE64URL_UINT6[] = {
+    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+    -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57,
+    58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0,  1,  2,  3,  4,  5,  6,
+    7,  8,  9,  10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+    25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
+    37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1,
+    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+    -1, -1, -1, -1
+};
+static const char BASE64URL_CHARS[] = {
+    'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', /*  0 -  9 */
+    'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', /* 10 - 19 */
+    'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', /* 20 - 29 */
+    'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', /* 30 - 39 */
+    'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', /* 40 - 49 */
+    'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', /* 50 - 59 */
+    '8', '9', '-', '_', ' ', ' ', ' ', ' ', ' ', ' ', /* 60 - 69 */
+};
+
+apr_size_t h2c_base64url_decode(const char **decoded, const char *encoded, 
+                                apr_pool_t *pool)
+{
+    const unsigned char *e = (const unsigned char *)encoded;
+    const unsigned char *p = e;
+    unsigned char *d;
+    int n;
+    apr_size_t len, mlen, remain, i;
+    
+    while (*p && BASE64URL_UINT6[ *p ] == -1) {
+        ++p;
+    }
+    len = p - e;
+    mlen = (len/4)*4;
+    *decoded = apr_pcalloc(pool, len+1);
+    
+    i = 0;
+    d = (unsigned char*)*decoded;
+    for (; i < mlen; i += 4) {
+        n = ((BASE64URL_UINT6[ e[i+0] ] << 18) +
+             (BASE64URL_UINT6[ e[i+1] ] << 12) +
+             (BASE64URL_UINT6[ e[i+2] ] << 6) +
+             (BASE64URL_UINT6[ e[i+3] ]));
+        *d++ = n >> 16;
+        *d++ = n >> 8 & 0xffu;
+        *d++ = n & 0xffu;
+    }
+    remain = len - mlen;
+    switch (remain) {
+        case 2:
+            n = ((BASE64URL_UINT6[ e[mlen+0] ] << 18) +
+                 (BASE64URL_UINT6[ e[mlen+1] ] << 12));
+            *d++ = n >> 16;
+            break;
+        case 3:
+            n = ((BASE64URL_UINT6[ e[mlen+0] ] << 18) +
+                 (BASE64URL_UINT6[ e[mlen+1] ] << 12) +
+                 (BASE64URL_UINT6[ e[mlen+2] ] << 6));
+            *d++ = n >> 16;
+            *d++ = n >> 8 & 0xffu;
+            break;
+        default: /* do nothing */
+            break;
+    }
+    return len;
+}
+
+const char *h2c_base64url_encode(const char *data, 
+                                 apr_size_t len, apr_pool_t *pool)
+{
+    apr_size_t mlen = ((len+2)/3)*3;
+    apr_size_t slen = (mlen/3)*4;
+    apr_size_t i;
+    const unsigned char *udata = (const unsigned char*)data;
+    char *enc, *p = apr_pcalloc(pool, slen+1); /* 0 terminated */
+    
+    enc = p;
+    for (i = 0; i < mlen; i+= 3) {
+        *p++ = BASE64URL_CHARS[ (udata[i] >> 2) & 0x3fu ];
+        *p++ = BASE64URL_CHARS[ (udata[i] << 4) + 
+                               ((i+1 < len)? (udata[i+1] >> 4) : 0) & 0x3fu
];
+        *p++ = BASE64URL_CHARS[ (udata[i+1] << 2) + 
+                               ((i+2 < len)? (udata[i+2] >> 6) : 0) & 0x3fu
];
+        *p++ = (i+2 < len)? BASE64URL_CHARS[ udata[i+2] & 0x3fu ] : '=';
+    }
+    
+    return enc;
+}
+

Modified: httpd/test/mod_h2/trunk/mh2fuzz/h2c_util.h
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/mh2fuzz/h2c_util.h?rev=1724821&r1=1724820&r2=1724821&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/mh2fuzz/h2c_util.h (original)
+++ httpd/test/mod_h2/trunk/mh2fuzz/h2c_util.h Fri Jan 15 14:28:36 2016
@@ -32,4 +32,14 @@ h2c_ngheader *h2c_util_ngheader_make_req
                                          const char *authority, const char *path);
 
 
+/**
+ * I always wanted to write my own base64url decoder...not. See 
+ * https://tools.ietf.org/html/rfc4648#section-5 for description.
+ */
+apr_size_t h2c_base64url_decode(const char **decoded, 
+                                const char *encoded, 
+                                apr_pool_t *pool);
+const char *h2c_base64url_encode(const char *data, 
+                                 apr_size_t len, apr_pool_t *pool);
+
 #endif /* h2c_util_h */

Modified: httpd/test/mod_h2/trunk/mh2fuzz/mh2f_fuzzer.c
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/mh2fuzz/mh2f_fuzzer.c?rev=1724821&r1=1724820&r2=1724821&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/mh2fuzz/mh2f_fuzzer.c (original)
+++ httpd/test/mod_h2/trunk/mh2fuzz/mh2f_fuzzer.c Fri Jan 15 14:28:36 2016
@@ -93,7 +93,7 @@ static apr_status_t rc_on_write(h2c_conn
 static apr_status_t rc_before_shutdown(h2c_conn *c, void *ctx)
 {
     fuzzer_rc *f = ctx;
-    return rc_pipe(c, f, (f->prev && f->prev->before_shutdown)? 
+    return ((f->prev && f->prev->before_shutdown)? 
             f->prev->before_shutdown(c, f->prev->ctx) : APR_SUCCESS);
 }
 

Modified: httpd/test/mod_h2/trunk/test/test_common.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test_common.sh?rev=1724821&r1=1724820&r2=1724821&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_common.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_common.sh Fri Jan 15 14:28:36 2016
@@ -120,11 +120,10 @@ curl_check_alpn() {
 nghttp_check_doc() {
     DOC="$1"; shift;
     MSG="$1"; shift;
-    ARGS="$@"$ARG_UPGRADE
     echo -n " * nghttp /$DOC: $MSG..."
     rm -rf $TMP &&
     mkdir -p "$TMP" &&
-    ${NGHTTP} $ARGS $URL_PREFIX/$DOC > $TMP/$DOC 2>&1 || fail
+    ${NGHTTP} "$@" $ARG_UPGRADE $URL_PREFIX/$DOC > $TMP/$DOC 2>&1 || fail
     diff  $DOC_ROOT/$DOC $TMP/$DOC || fail
     echo ok.
 }
@@ -132,14 +131,46 @@ nghttp_check_doc() {
 nghttp_check_assets() {
     DOC="$1"; shift;
     MSG="$1"; shift;
-    ARGS="$@"$ARG_UPGRADE
     echo -n " * nghttp /$DOC: $MSG..."
     rm -rf $TMP &&
     mkdir -p "$TMP"
     sort > $TMP/reference
-    ${NGHTTP} -ans $ARGS $URL_PREFIX/$DOC > $TMP/out 2>&1 || fail
-    fgrep " /" $TMP/out | while read id begin end dur stat size path; do
-        echo "$path $size $stat"
+    ${NGHTTP} -ans "$@" $ARG_UPGRADE $URL_PREFIX/$DOC > $TMP/out 2>&1 || fail
+    fgrep " /" $TMP/out | while read id begin end dur stat size path xxx; do
+        if test "$end" = '*'; then
+            end="$dur"
+            dur="$stat"
+            stat="$size"
+            size="$path"
+            path="$xxx"
+            echo "$path $size $stat pushed"
+        else 
+            echo "$path $size $stat"
+        fi
+    done | sort > $TMP/output || fail
+    diff $TMP/reference $TMP/output  || fail
+    echo ok.
+}
+
+nghttp_check_pushed() {
+    DOC="$1"; shift;
+    MSG="$1"; shift;
+    echo -n " * nghttp /$DOC: $MSG..."
+    rm -rf $TMP &&
+    mkdir -p "$TMP"
+    sort > $TMP/reference
+    ${NGHTTP} -ns "$@" $ARG_UPGRADE $URL_PREFIX/$DOC > $TMP/out 2>&1 || fail
+    fgrep " /" $TMP/out | while read id begin end dur stat size path xxx; do
+        if test "$end" = '*'; then
+            end="$dur"
+            dur="$stat"
+            stat="$size"
+            size="$path"
+            path="$xxx"
+            echo "$path $size $stat pushed"
+        else 
+            echo "$path $size $stat"
+        fi
     done | sort > $TMP/output || fail
     diff $TMP/reference $TMP/output  || fail
     echo ok.
@@ -200,6 +231,18 @@ nghttp_check_promises() {
     echo ok.
 }
 
+nghttp_check_cache_digest() {
+    DOC="$1"; shift;
+    MSG="$1"; shift;
+    rm -rf $TMP
+    mkdir -p "$(dirname $TMP/$DOC)"
+    cat > $TMP/expected
+    echo -n " * nghttp /$DOC: $MSG..."
+    ${NGHTTP} "$@" $ARG_UPGRADE $URL_PREFIX/$DOC $URL_PREFIX/http2-status 2>&1 | fgrep
'cache_digest' > $TMP/$DOC
+    diff  $TMP/expected $TMP/$DOC || fail
+    echo ok.
+}
+
 curl_check_status() {
     DOC="$1"; shift;
     STATUS="$1"; shift;

Modified: httpd/test/mod_h2/trunk/test/test_fuzz.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test_fuzz.sh?rev=1724821&r1=1724820&r2=1724821&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_fuzz.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_fuzz.sh Fri Jan 15 14:28:36 2016
@@ -44,8 +44,10 @@ fuzz-close() {
             case "$numbers" in
               */0/0/0/0)
                 ;;
+              *"tls error"*)
+                ;;
               *)
-                echo "unexpected result: $numbers"
+                echo "unexpected result: $numbers $xxx"
                 exit 1;
                 ;;
             esac
@@ -65,7 +67,7 @@ fuzz-delay() {
               50/0/0/0/0)
                 ;;
               *)
-                echo "unexpected result: $numbers"
+                echo "unexpected result: $numbers $xxx"
                 exit 1;
                 ;;
             esac
@@ -76,11 +78,17 @@ fuzz-delay() {
 
 echo "test frames sent/recv on GETs"
 $SHELL "$TEST_DIR"/test_frames.sh      $HTTP_AUTH  $HTTPS_AUTH      &&
-echo "test frames sent/recv on keepalive timeouts"                  &&
-$SHELL "$TEST_DIR"/test_keepalive.sh   $HTTP_AUTH_2 $HTTPS_AUTH_2   &&
 echo "test unexp. connection close with likelihood xx%"             &&
 fuzz-close $HTTP_AUTH  1 2 5 10 25                                  &&
 fuzz-close $HTTPS_AUTH 1 2 5 10 25                                  &&
+fuzz-close $HTTP_AUTH  1 2 5 10 25                                  &&
+fuzz-close $HTTPS_AUTH 1 2 5 10 25                                  &&
+fuzz-close $HTTP_AUTH  1 2 5 10 25                                  &&
+fuzz-close $HTTPS_AUTH 1 2 5 10 25                                  &&
+fuzz-close $HTTP_AUTH  1 2 5 10 25                                  &&
+fuzz-close $HTTPS_AUTH 1 2 5 10 25                                  &&
+echo "test frames sent/recv on keepalive timeouts"                  &&
+$SHELL "$TEST_DIR"/test_keepalive.sh   $HTTP_AUTH_2 $HTTPS_AUTH_2   &&
 echo "test random write delays for 0-n seconds"                     &&
 fuzz-delay $HTTP_AUTH  1 2 4                                        &&
 fuzz-delay $HTTPS_AUTH 1 4 8                                        &&

Modified: httpd/test/mod_h2/trunk/test/test_push.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test_push.sh?rev=1724821&r1=1724820&r2=1724821&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_push.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_push.sh Fri Jan 15 14:28:36 2016
@@ -80,6 +80,69 @@ nghttp_check_promises "duplicate push" $
 PUSH_PROMISE frame <length=64, flags=0x04...>
 EOF
 
+# check a longer list of resources that are pushed in our config
+#
+nghttp_check_pushed apache.org.html "pushes of apache.org.html" <<EOF
+/apache.org-files/ant.jpg 6K 200 pushed
+/apache.org-files/asf_logo.png 29K 200 pushed
+/apache.org-files/cse.js 0 200 pushed
+/apache.org-files/css.css 0 200 pushed
+/apache.org-files/default.css 13K 200 pushed
+/apache.org-files/defaulten.css 44K 200 pushed
+/apache.org-files/defaulten.js 289K 200 pushed
+/apache.org-files/jquery-2.js 82K 200 pushed
+/apache.org-files/jsapi.js 0 200 pushed
+/apache.org-files/min.css 74K 200 pushed
+/apache.org-files/mrunit.jpg 4K 200 pushed
+/apache.org-files/styles.css 1K 200 pushed
+/apache.org-files/synapse.jpg 4K 200 pushed
+/apache.org.html 58K 200
+EOF
+
+# cache digests hash the complete URL, we need different values for
+# http: and https: URLs...
+#
+case "$URL_PREFIX" in
+    http:*)
+        DIGEST1="AAonnwA="
+        DIGEST2="AAo-3wA="
+        DIGEST3="BApfWHN02ghQVi86QmgXSyUYwiqn"
+        ;;
+    *)
+        DIGEST1="AAoW_wA="
+        DIGEST2="AApSvwA="
+        DIGEST3="BAqbuEx20N-JQDERYEeacOaLNC6x_wA="
+        ;;
+esac
+
+nghttp_check_cache_digest index.html "digest after index.html" <<EOF
+  "cache_digest": "AAo=",
+  "cache_digest^2": "AAo=",
+EOF
+
+nghttp_check_cache_digest 006-push.html "digest after 006-push.html" <<EOF
+  "cache_digest": "$DIGEST1",
+  "cache_digest^2": "$DIGEST1",
+EOF
+
+nghttp_check_cache_digest 006-push2.html "digest after 006-push2.html" <<EOF
+  "cache_digest": "$DIGEST2",
+  "cache_digest^2": "$DIGEST2",
+EOF
+
+nghttp_check_cache_digest apache.org.html "digest after apache.org" <<EOF
+  "cache_digest": "$DIGEST3",
+  "cache_digest^2": "$DIGEST3",
+EOF
+
+# Check that our long list of resources is no longer pushed if
+# we pass in a matching cache digest
+#
+nghttp_check_pushed apache.org.html "cache-digest header sent" -H "Cache-Digest: $DIGEST3"
<<EOF
+/apache.org.html 58K 200
+EOF
+
+
     else
         echo "push diary require httpd >= 2.4.19"
     fi



Mime
View raw message