From 0f1dea4f42e85bf7a0e918fd068fc15c60bd5c9e Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 10 Jan 2014 21:53:48 +0900 Subject: [PATCH] Move HPACK tools from hdtest to src --- Makefile.am | 2 +- README.rst | 17 +++++++------- configure.ac | 9 ++++---- hdtest/Makefile.am | 42 ----------------------------------- hdtest/README.rst | 1 - src/Makefile.am | 20 ++++++++++++++++- {hdtest => src}/comp_helper.c | 0 {hdtest => src}/comp_helper.h | 0 {hdtest => src}/deflatehd.c | 0 {hdtest => src}/inflatehd.c | 0 10 files changed, 32 insertions(+), 59 deletions(-) delete mode 100644 hdtest/Makefile.am delete mode 100644 hdtest/README.rst rename {hdtest => src}/comp_helper.c (100%) rename {hdtest => src}/comp_helper.h (100%) rename {hdtest => src}/deflatehd.c (100%) rename {hdtest => src}/inflatehd.c (100%) diff --git a/Makefile.am b/Makefile.am index cf783bf9..301be748 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,7 +20,7 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -SUBDIRS = lib src examples hdtest python tests doc +SUBDIRS = lib src examples python tests doc ACLOCAL_AMFLAGS = -I m4 diff --git a/README.rst b/README.rst index ba55845b..4a58a81f 100644 --- a/README.rst +++ b/README.rst @@ -79,8 +79,7 @@ resource) in ``nghttp``, the following packages are needed: * libxml2 >= 2.7.7 -The header compression test tools in hdtest directory require the -following package: +The HPACK tools require the following package: * jansson >= 2.5 @@ -418,14 +417,14 @@ the outside HTTP/2.0 proxy through HTTP proxy:: --===================---> HTTP/2.0 Proxy (HTTP proxy tunnel) (e.g., nghttpx -s) -Header compression test tools ------------------------------ +HPACK tools +----------- -The ``hdtest`` directory contains header compression test tools. The -``deflatehd`` is command-line header compression tool. The -``inflatehd`` is command-line header decompression tool. Both tools -read input from stdin and write output to stdout. The errors are -written to stderr. They take JSON as input and output. +The ``src`` directory contains HPACK tools. The ``deflatehd`` is +command-line header compression tool. The ``inflatehd`` is +command-line header decompression tool. Both tools read input from +stdin and write output to stdout. The errors are written to +stderr. They take JSON as input and output. deflatehd - header compressor +++++++++++++++++++++++++++++ diff --git a/configure.ac b/configure.ac index 29ed9dcc..f8486439 100644 --- a/configure.ac +++ b/configure.ac @@ -244,12 +244,12 @@ fi AM_CONDITIONAL([ENABLE_EXAMPLES], [ test "x${enable_examples}" = "xyes" ]) -# hdtest requires jansson +# HPACK tools requires jansson if test "x${have_jansson}" = "xyes"; then - enable_hdtest=yes + enable_hpack_tools=yes fi -AM_CONDITIONAL([ENABLE_HDTEST], [ test "x${enable_hdtest}" = "xyes" ]) +AM_CONDITIONAL([ENABLE_HPACK_TOOLS], [ test "x${enable_hpack_tools}" = "xyes" ]) # failmalloc tests AM_CONDITIONAL([ENABLE_FAILMALLOC], [ test "x${enable_failmalloc}" = "xyes" ]) @@ -328,7 +328,6 @@ AC_CONFIG_FILES([ tests/testdata/Makefile src/Makefile examples/Makefile - hdtest/Makefile python/Makefile doc/Makefile doc/conf.py @@ -358,7 +357,7 @@ AC_MSG_NOTICE([summary of build options: Jansson: ${have_jansson} Src: ${enable_src} Examples: ${enable_examples} - Hdtest: ${enable_hdtest} + HPACK tools: ${enable_hpack_tools} Failmalloc: ${request_failmalloc} Python: ${PYTHON} ${PYTHON_VERSION} Cython: ${CYTHON} diff --git a/hdtest/Makefile.am b/hdtest/Makefile.am deleted file mode 100644 index 855bfc0f..00000000 --- a/hdtest/Makefile.am +++ /dev/null @@ -1,42 +0,0 @@ -# nghttp2 - HTTP/2.0 C Library - -# Copyright (c) 2013 Tatsuhiro Tsujikawa - -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: - -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -if ENABLE_HDTEST - -AM_CFLAGS = -Wall -AM_CPPFLAGS = -Wall -I$(srcdir)/../lib/includes -I$(builddir)/../lib/includes \ - -I$(srcdir)/../lib @JANSSON_CFLAGS@ @DEFS@ -AM_LDFLAGS = @JANSSON_LIBS@ -LDADD = $(top_builddir)/lib/libnghttp2.la - -bin_PROGRAMS = inflatehd deflatehd - -COMMON_SRCS = comp_helper.c comp_helper.h - -inflatehd_SOURCES = inflatehd.c $(COMMON_SRCS) - -deflatehd_SOURCES = deflatehd.c $(COMMON_SRCS) - -endif # ENABLE_HDTEST - -EXTRA_DIST = README.rst diff --git a/hdtest/README.rst b/hdtest/README.rst deleted file mode 100644 index 56a35132..00000000 --- a/hdtest/README.rst +++ /dev/null @@ -1 +0,0 @@ -Tools for header compression diff --git a/src/Makefile.am b/src/Makefile.am index f5187fb5..042d8eec 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -27,17 +27,23 @@ TESTS = if ENABLE_SRC -AM_CPPFLAGS = -Wall -I$(srcdir)/../lib/includes -I$(builddir)/../lib/includes \ +AM_CPPFLAGS = \ + -Wall \ + -I$(top_srcdir)/lib/includes \ + -I$(top_builddir)/lib/includes \ + -I$(top_srcdir)/lib \ @LIBSPDYLAY_CFLAGS@ \ @XML_CPPFLAGS@ \ @LIBEVENT_OPENSSL_CFLAGS@ \ @OPENSSL_CFLAGS@ \ + @JANSSON_CFLAGS@ \ @DEFS@ AM_LDFLAGS = \ @LIBSPDYLAY_LIBS@ \ @XML_LIBS@ \ @LIBEVENT_OPENSSL_LIBS@ \ @OPENSSL_LIBS@ \ + @JANSSON_LIBS@ \ @SRC_LIBS@ LDADD = $(top_builddir)/lib/libnghttp2.la @@ -113,4 +119,16 @@ nghttpx_unittest_LDADD = libnghttpx.a ${LDADD} ${AM_LDFLAGS} \ TESTS += nghttpx-unittest endif # HAVE_CUNIT +if ENABLE_HPACK_TOOLS + +bin_PROGRAMS += inflatehd deflatehd + +HPACK_TOOLS_COMMON_SRCS = comp_helper.c comp_helper.h + +inflatehd_SOURCES = inflatehd.c $(HPACK_TOOLS_COMMON_SRCS) + +deflatehd_SOURCES = deflatehd.c $(HPACK_TOOLS_COMMON_SRCS) + +endif # ENABLE_HPACK_TOOLS + endif # ENABLE_SRC diff --git a/hdtest/comp_helper.c b/src/comp_helper.c similarity index 100% rename from hdtest/comp_helper.c rename to src/comp_helper.c diff --git a/hdtest/comp_helper.h b/src/comp_helper.h similarity index 100% rename from hdtest/comp_helper.h rename to src/comp_helper.h diff --git a/hdtest/deflatehd.c b/src/deflatehd.c similarity index 100% rename from hdtest/deflatehd.c rename to src/deflatehd.c diff --git a/hdtest/inflatehd.c b/src/inflatehd.c similarity index 100% rename from hdtest/inflatehd.c rename to src/inflatehd.c