Skip to content

Commit

Permalink
* avoid unnecessary data retrieval for a trace log. Allow certain
Browse files Browse the repository at this point in the history
    information retrievals on null bucket beams where it makes sense.
  * Fixed configure to check first for libs and then add compiler flags
  • Loading branch information
Stefan Eissing committed Oct 30, 2017
1 parent 61d2aef commit bf52b46
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 58 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
v1.10.13
--------------------------------------------------------------------------------
* avoid unnecessary data retrieval for a trace log. Allow certain
information retrievals on null bucket beams where it makes sense.
* Fixed configure to check first for libs and then add compiler flags

v1.10.12
--------------------------------------------------------------------------------
* Reverting 1.10.11 change since showed no effect on issue #120
Expand Down
81 changes: 40 additions & 41 deletions 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.10.12], [[email protected]])
AC_INIT([mod_http2], [1.10.13], [[email protected]])

LT_PREREQ([2.2.6])
LT_INIT()
Expand Down Expand Up @@ -59,44 +59,6 @@ AC_ARG_WITH([apxs], [AS_HELP_STRING([--with-apxs],
AC_PROG_CC
AC_PROG_CC_STDC

if test "x$werror" != "xno"; then
AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="$CFLAGS -Wall"])
AX_CHECK_COMPILE_FLAG([-Wextra], [CFLAGS="$CFLAGS -Wextra"])
AX_CHECK_COMPILE_FLAG([-Werror], [CFLAGS="$CFLAGS -Werror"])
AX_CHECK_COMPILE_FLAG([-Wmissing-prototypes], [CFLAGS="$CFLAGS -Wmissing-prototypes"])
AX_CHECK_COMPILE_FLAG([-Wstrict-prototypes], [CFLAGS="$CFLAGS -Wstrict-prototypes"])
AX_CHECK_COMPILE_FLAG([-Wmissing-declarations], [CFLAGS="$CFLAGS -Wmissing-declarations"])
AX_CHECK_COMPILE_FLAG([-Wpointer-arith], [CFLAGS="$CFLAGS -Wpointer-arith"])
# we like to use such things...
#AX_CHECK_COMPILE_FLAG([-Wdeclaration-after-statement], [CFLAGS="$CFLAGS -Wdeclaration-after-statement"])
AX_CHECK_COMPILE_FLAG([-Wformat-security], [CFLAGS="$CFLAGS -Wformat-security"])
AX_CHECK_COMPILE_FLAG([-Wwrite-strings], [CFLAGS="$CFLAGS -Wwrite-strings"])
AX_CHECK_COMPILE_FLAG([-Wshadow], [CFLAGS="$CFLAGS -Wshadow"])
AX_CHECK_COMPILE_FLAG([-Winline], [CFLAGS="$CFLAGS -Winline"])
AX_CHECK_COMPILE_FLAG([-Wnested-externs], [CFLAGS="$CFLAGS -Wnested-externs"])
AX_CHECK_COMPILE_FLAG([-Wfloat-equal], [CFLAGS="$CFLAGS -Wfloat-equal"])
AX_CHECK_COMPILE_FLAG([-Wundef], [CFLAGS="$CFLAGS -Wundef"])
AX_CHECK_COMPILE_FLAG([-Wendif-labels], [CFLAGS="$CFLAGS -Wendif-labels"])
AX_CHECK_COMPILE_FLAG([-Wempty-body], [CFLAGS="$CFLAGS -Wempty-body"])
# does not make sense with APR as it prefers char* to void*
# AX_CHECK_COMPILE_FLAG([-Wcast-align], [CFLAGS="$CFLAGS -Wcast-align"])
AX_CHECK_COMPILE_FLAG([-Wvla], [CFLAGS="$CFLAGS -Wvla"])
AX_CHECK_COMPILE_FLAG([-Wpragmas], [CFLAGS="$CFLAGS -Wpragmas"])
AX_CHECK_COMPILE_FLAG([-Wunreachable-code], [CFLAGS="$CFLAGS -Wunreachable-code"])
AX_CHECK_COMPILE_FLAG([-Waddress], [CFLAGS="$CFLAGS -Waddress"])
AX_CHECK_COMPILE_FLAG([-Wattributes], [CFLAGS="$CFLAGS -Wattributes"])
AX_CHECK_COMPILE_FLAG([-Wdiv-by-zero], [CFLAGS="$CFLAGS -Wdiv-by-zero"])
AX_CHECK_COMPILE_FLAG([-Wshorten-64-to-32], [CFLAGS="$CFLAGS -Wshorten-64-to-32"])
AX_CHECK_COMPILE_FLAG([-Wno-sign-compare], [CFLAGS="$CFLAGS -Wno-sign-compare"])
AX_CHECK_COMPILE_FLAG([-Wno-unused-parameter], [CFLAGS="$CFLAGS -Wno-unused-parameter"])
AX_CHECK_COMPILE_FLAG([-Wno-shadow], [CFLAGS="$CFLAGS -Wno-shadow"])
AX_CHECK_COMPILE_FLAG([-Wno-undef], [CFLAGS="$CFLAGS -Wno-undef"])

AX_CHECK_COMPILE_FLAG(["-std=c89"], [CFLAGS="$CFLAGS -std=c89"])
AX_CHECK_COMPILE_FLAG([-Wdeclaration-after-statement], [CFLAGS="$CFLAGS -Wdeclaration-after-statement"])
fi


# extern, we need to find where the apxs is. which then
# can tell us the various directories we need.
#
Expand All @@ -113,8 +75,8 @@ fi
export BUILD_SUBDIRS="mod_http2"

prefix="$($APXS -q prefix)"
LDFLAGS="$LDFLAGS -L$($APXS -q libdir)"
CPPFLAGS="$CPPFLAGS -I$($APXS -q includedir) -I$($APXS -q APR_INCLUDEDIR)"
LDFLAGS="-L$($APXS -q libdir) $LDFLAGS"
CPPFLAGS="-I$($APXS -q includedir) -I$($APXS -q APR_INCLUDEDIR) $CPPFLAGS"
export SYSCONF_DIR="$($APXS -q sysconfdir)"
export LIBEXEC_DIR="$($APXS -q LIBEXECDIR)"

Expand Down Expand Up @@ -151,6 +113,43 @@ AC_CHECK_HEADERS([ \
stddef.h \
])

if test "x$werror" != "xno"; then
AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="$CFLAGS -Wall"])
AX_CHECK_COMPILE_FLAG([-Wextra], [CFLAGS="$CFLAGS -Wextra"])
AX_CHECK_COMPILE_FLAG([-Werror], [CFLAGS="$CFLAGS -Werror"])
AX_CHECK_COMPILE_FLAG([-Wmissing-prototypes], [CFLAGS="$CFLAGS -Wmissing-prototypes"])
AX_CHECK_COMPILE_FLAG([-Wstrict-prototypes], [CFLAGS="$CFLAGS -Wstrict-prototypes"])
AX_CHECK_COMPILE_FLAG([-Wmissing-declarations], [CFLAGS="$CFLAGS -Wmissing-declarations"])
AX_CHECK_COMPILE_FLAG([-Wpointer-arith], [CFLAGS="$CFLAGS -Wpointer-arith"])
# we like to use such things...
#AX_CHECK_COMPILE_FLAG([-Wdeclaration-after-statement], [CFLAGS="$CFLAGS -Wdeclaration-after-statement"])
AX_CHECK_COMPILE_FLAG([-Wformat-security], [CFLAGS="$CFLAGS -Wformat-security"])
AX_CHECK_COMPILE_FLAG([-Wwrite-strings], [CFLAGS="$CFLAGS -Wwrite-strings"])
AX_CHECK_COMPILE_FLAG([-Wshadow], [CFLAGS="$CFLAGS -Wshadow"])
AX_CHECK_COMPILE_FLAG([-Winline], [CFLAGS="$CFLAGS -Winline"])
AX_CHECK_COMPILE_FLAG([-Wnested-externs], [CFLAGS="$CFLAGS -Wnested-externs"])
AX_CHECK_COMPILE_FLAG([-Wfloat-equal], [CFLAGS="$CFLAGS -Wfloat-equal"])
AX_CHECK_COMPILE_FLAG([-Wundef], [CFLAGS="$CFLAGS -Wundef"])
AX_CHECK_COMPILE_FLAG([-Wendif-labels], [CFLAGS="$CFLAGS -Wendif-labels"])
AX_CHECK_COMPILE_FLAG([-Wempty-body], [CFLAGS="$CFLAGS -Wempty-body"])
# does not make sense with APR as it prefers char* to void*
# AX_CHECK_COMPILE_FLAG([-Wcast-align], [CFLAGS="$CFLAGS -Wcast-align"])
AX_CHECK_COMPILE_FLAG([-Wvla], [CFLAGS="$CFLAGS -Wvla"])
AX_CHECK_COMPILE_FLAG([-Wpragmas], [CFLAGS="$CFLAGS -Wpragmas"])
AX_CHECK_COMPILE_FLAG([-Wunreachable-code], [CFLAGS="$CFLAGS -Wunreachable-code"])
AX_CHECK_COMPILE_FLAG([-Waddress], [CFLAGS="$CFLAGS -Waddress"])
AX_CHECK_COMPILE_FLAG([-Wattributes], [CFLAGS="$CFLAGS -Wattributes"])
AX_CHECK_COMPILE_FLAG([-Wdiv-by-zero], [CFLAGS="$CFLAGS -Wdiv-by-zero"])
AX_CHECK_COMPILE_FLAG([-Wshorten-64-to-32], [CFLAGS="$CFLAGS -Wshorten-64-to-32"])
AX_CHECK_COMPILE_FLAG([-Wno-sign-compare], [CFLAGS="$CFLAGS -Wno-sign-compare"])
AX_CHECK_COMPILE_FLAG([-Wno-unused-parameter], [CFLAGS="$CFLAGS -Wno-unused-parameter"])
AX_CHECK_COMPILE_FLAG([-Wno-shadow], [CFLAGS="$CFLAGS -Wno-shadow"])
AX_CHECK_COMPILE_FLAG([-Wno-undef], [CFLAGS="$CFLAGS -Wno-undef"])

AX_CHECK_COMPILE_FLAG(["-std=c89"], [CFLAGS="$CFLAGS -std=c89"])
AX_CHECK_COMPILE_FLAG([-Wdeclaration-after-statement], [CFLAGS="$CFLAGS -Wdeclaration-after-statement"])
fi

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_INT32_T
AC_TYPE_SIZE_T
Expand Down
20 changes: 10 additions & 10 deletions mod_http2/h2_bucket_beam.c
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ apr_size_t h2_beam_buffer_size_get(h2_bucket_beam *beam)
h2_beam_lock bl;
apr_size_t buffer_size = 0;

if (enter_yellow(beam, &bl) == APR_SUCCESS) {
if (beam && enter_yellow(beam, &bl) == APR_SUCCESS) {
buffer_size = beam->max_buf_size;
leave_yellow(beam, &bl);
}
Expand Down Expand Up @@ -696,7 +696,7 @@ void h2_beam_abort(h2_bucket_beam *beam)
{
h2_beam_lock bl;

if (enter_yellow(beam, &bl) == APR_SUCCESS) {
if (beam && enter_yellow(beam, &bl) == APR_SUCCESS) {
if (!beam->aborted) {
beam->aborted = 1;
r_purge_sent(beam);
Expand All @@ -712,7 +712,7 @@ apr_status_t h2_beam_close(h2_bucket_beam *beam)
{
h2_beam_lock bl;

if (enter_yellow(beam, &bl) == APR_SUCCESS) {
if (beam && enter_yellow(beam, &bl) == APR_SUCCESS) {
r_purge_sent(beam);
beam_close(beam);
report_consumption(beam, &bl);
Expand All @@ -725,7 +725,7 @@ apr_status_t h2_beam_leave(h2_bucket_beam *beam)
{
h2_beam_lock bl;

if (enter_yellow(beam, &bl) == APR_SUCCESS) {
if (beam && enter_yellow(beam, &bl) == APR_SUCCESS) {
recv_buffer_cleanup(beam, &bl);
beam->aborted = 1;
beam_close(beam);
Expand Down Expand Up @@ -1165,7 +1165,7 @@ apr_off_t h2_beam_get_buffered(h2_bucket_beam *beam)
apr_off_t l = 0;
h2_beam_lock bl;

if (enter_yellow(beam, &bl) == APR_SUCCESS) {
if (beam && enter_yellow(beam, &bl) == APR_SUCCESS) {
for (b = H2_BLIST_FIRST(&beam->send_list);
b != H2_BLIST_SENTINEL(&beam->send_list);
b = APR_BUCKET_NEXT(b)) {
Expand All @@ -1183,7 +1183,7 @@ apr_off_t h2_beam_get_mem_used(h2_bucket_beam *beam)
apr_off_t l = 0;
h2_beam_lock bl;

if (enter_yellow(beam, &bl) == APR_SUCCESS) {
if (beam && enter_yellow(beam, &bl) == APR_SUCCESS) {
for (b = H2_BLIST_FIRST(&beam->send_list);
b != H2_BLIST_SENTINEL(&beam->send_list);
b = APR_BUCKET_NEXT(b)) {
Expand All @@ -1199,7 +1199,7 @@ int h2_beam_empty(h2_bucket_beam *beam)
int empty = 1;
h2_beam_lock bl;

if (enter_yellow(beam, &bl) == APR_SUCCESS) {
if (beam && enter_yellow(beam, &bl) == APR_SUCCESS) {
empty = (H2_BLIST_EMPTY(&beam->send_list)
&& (!beam->recv_buffer || APR_BRIGADE_EMPTY(beam->recv_buffer)));
leave_yellow(beam, &bl);
Expand All @@ -1212,7 +1212,7 @@ int h2_beam_holds_proxies(h2_bucket_beam *beam)
int has_proxies = 1;
h2_beam_lock bl;

if (enter_yellow(beam, &bl) == APR_SUCCESS) {
if (beam && enter_yellow(beam, &bl) == APR_SUCCESS) {
has_proxies = !H2_BPROXY_LIST_EMPTY(&beam->proxies);
leave_yellow(beam, &bl);
}
Expand All @@ -1224,7 +1224,7 @@ int h2_beam_was_received(h2_bucket_beam *beam)
int happend = 0;
h2_beam_lock bl;

if (enter_yellow(beam, &bl) == APR_SUCCESS) {
if (beam && enter_yellow(beam, &bl) == APR_SUCCESS) {
happend = (beam->received_bytes > 0);
leave_yellow(beam, &bl);
}
Expand All @@ -1236,7 +1236,7 @@ apr_size_t h2_beam_get_files_beamed(h2_bucket_beam *beam)
apr_size_t n = 0;
h2_beam_lock bl;

if (enter_yellow(beam, &bl) == APR_SUCCESS) {
if (beam && enter_yellow(beam, &bl) == APR_SUCCESS) {
n = beam->files_beamed;
leave_yellow(beam, &bl);
}
Expand Down
11 changes: 6 additions & 5 deletions mod_http2/h2_mplx.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,12 @@ static int report_stream_iter(void *ctx, void *val) {
h2_mplx *m = ctx;
h2_stream *stream = val;
h2_task *task = stream->task;
ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c,
H2_STRM_MSG(stream, "started=%d, scheduled=%d, ready=%d, "
"out_buffer=%ld"),
!!stream->task, stream->scheduled, h2_stream_is_ready(stream),
(long)h2_beam_get_buffered(stream->output));
if (APLOGctrace1(m->c)) {
ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c,
H2_STRM_MSG(stream, "started=%d, scheduled=%d, ready=%d, out_buffer=%ld"),
!!stream->task, stream->scheduled, h2_stream_is_ready(stream),
(long)h2_beam_get_buffered(stream->output));
}
if (task) {
ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, m->c, /* NO APLOGNO */
H2_STRM_MSG(stream, "->03198: %s %s %s"
Expand Down
4 changes: 2 additions & 2 deletions mod_http2/h2_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
* @macro
* Version number of the http2 module as c string
*/
#define MOD_HTTP2_VERSION "1.10.12-git"
#define MOD_HTTP2_VERSION "1.10.13-git"

/**
* @macro
* Numerical representation of the version number of the http2 module
* release. This is a 24 bit number with 8 bits for major number, 8 bits
* for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
*/
#define MOD_HTTP2_VERSION_NUM 0x010a0c
#define MOD_HTTP2_VERSION_NUM 0x010a0d


#endif /* mod_h2_h2_version_h */

0 comments on commit bf52b46

Please sign in to comment.