Skip to content

Commit

Permalink
fixed compile error re log2n, fixed cache-digest calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Eissing committed Jan 18, 2016
1 parent a09062f commit 57d429d
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 92 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
v1.2.1
--------------------------------------------------------------------------------
* fixed compilation error because of stupid own log2n function
* fixed cache digest calculation to spit out same values as Kazuho Oku's
reference implementation (https://github.com/kazuho/h2-cache-digest).

v1.2.0
--------------------------------------------------------------------------------
* Each connection now has a push diary where already pushed resources are
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#

AC_PREREQ([2.69])
AC_INIT([mod_http2], [1.2.0], [[email protected]])
AC_INIT([mod_http2], [1.2.1], [[email protected]])

LT_PREREQ([2.2.6])
LT_INIT()
Expand Down
13 changes: 9 additions & 4 deletions mod_http2/h2_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "h2_task.h"
#include "h2_stream.h"
#include "h2_stream_set.h"
#include "h2_request.h"
#include "h2_response.h"
#include "h2_session.h"
#include "h2_util.h"
Expand Down Expand Up @@ -203,6 +204,7 @@ static apr_status_t h2_sos_h2_status_buffer(h2_sos *sos, apr_bucket_brigade *bb)
h2_stream *stream = sos->stream;
h2_session *session = stream->session;
h2_mplx *mplx = session->mplx;
h2_push_diary *diary;
apr_status_t status;

if (!bb) {
Expand All @@ -225,21 +227,24 @@ static apr_status_t h2_sos_h2_status_buffer(h2_sos *sos, apr_bucket_brigade *bb)
bbout(" \"pushes_submitted\": %d,\n", session->pushes_submitted);
bbout(" \"pushes_reset\": %d,\n", session->pushes_reset);

if (session->push_diary) {
diary = session->push_diary;
if (diary) {
const char *data;
const char *base64_digest;
apr_size_t len;

status = h2_push_diary_digest_get(session->push_diary, stream->pool, 1024, &data, &len);
status = h2_push_diary_digest_get(diary, stream->pool, 256,
stream->request->authority, &data, &len);
if (status == APR_SUCCESS) {
base64_digest = h2_util_base64url_encode(data, len, stream->pool);
bbout(" \"cache_digest\": \"%s\",\n", base64_digest);
}

/* try the reverse for testing purposes */
status = h2_push_diary_digest_set(session->push_diary, data, len);
status = h2_push_diary_digest_set(diary, stream->request->authority, data, len);
if (status == APR_SUCCESS) {
status = h2_push_diary_digest_get(session->push_diary, stream->pool, 1024, &data, &len);
status = h2_push_diary_digest_get(diary, stream->pool, 256,
stream->request->authority, &data, &len);
if (status == APR_SUCCESS) {
base64_digest = h2_util_base64url_encode(data, len, stream->pool);
bbout(" \"cache_digest^2\": \"%s\",\n", base64_digest);
Expand Down
Loading

0 comments on commit 57d429d

Please sign in to comment.