From 39aaad5ad8b235558c28ed7eb1f28f4b4955c9fc Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 11 Feb 2014 23:41:25 +0900 Subject: [PATCH 1/4] Fix out-of-tree build for python --- python/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/Makefile.am b/python/Makefile.am index 53e139fa..56a1328f 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -37,7 +37,7 @@ nghttp2_la_CPPFLAGS = \ $(PYTHON_CPPFLAGS) \ -fno-strict-aliasing \ -I$(top_srcdir)/lib/includes \ - -I$(build_srcdir)/lib/includes \ + -I$(top_builddir)/lib/includes \ -I$(top_srcdir)/lib nghttp2_la_LDFLAGS = \ $(PYTHON_LDFLAGS) \ From 2d8c2031956f227a625f670cee25f9e6924844a5 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 13 Feb 2014 23:26:09 +0900 Subject: [PATCH 2/4] Fix inflater memory leak --- lib/nghttp2_hd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/nghttp2_hd.c b/lib/nghttp2_hd.c index 71b2fe36..2414fdd2 100644 --- a/lib/nghttp2_hd.c +++ b/lib/nghttp2_hd.c @@ -1414,6 +1414,7 @@ ssize_t nghttp2_hd_inflate_hd(nghttp2_hd_inflater *inflater, DEBUGF(fprintf(stderr, "nghtp2_hd_infalte_hd start state=%d\n", inflater->state)); + hd_inflate_keep_free(inflater); *inflate_flags = NGHTTP2_HD_INFLATE_NONE; for(; in != last;) { switch(inflater->state) { From 01ca4373a1e09e686e035fea9f26123f2c83847f Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 12 Feb 2014 22:40:37 +0900 Subject: [PATCH 3/4] Out-of-tree build for sphinx documents The only drawback is that page source only contains include directive. We disabled page source for now. --- configure.ac | 6 ++++++ doc/Makefile.am | 3 ++- doc/conf.py.in | 9 +++++---- doc/index.rst.in | 1 + doc/nghttp2.h.rst | 4 ---- doc/nghttp2.h.rst.in | 4 ++++ doc/nghttp2ver.h.rst | 4 ---- doc/nghttp2ver.h.rst.in | 4 ++++ doc/package_README.rst | 1 - doc/package_README.rst.in | 1 + doc/{ => sources}/index.rst | 0 doc/{ => sources}/tutorial-client.rst | 5 ----- doc/{ => sources}/tutorial-server.rst | 6 ------ doc/tutorial-client.rst.in | 6 ++++++ doc/tutorial-server.rst.in | 6 ++++++ 15 files changed, 35 insertions(+), 25 deletions(-) create mode 100644 doc/index.rst.in delete mode 100644 doc/nghttp2.h.rst create mode 100644 doc/nghttp2.h.rst.in delete mode 100644 doc/nghttp2ver.h.rst create mode 100644 doc/nghttp2ver.h.rst.in delete mode 100644 doc/package_README.rst create mode 100644 doc/package_README.rst.in rename doc/{ => sources}/index.rst (100%) rename doc/{ => sources}/tutorial-client.rst (99%) rename doc/{ => sources}/tutorial-server.rst (99%) create mode 100644 doc/tutorial-client.rst.in create mode 100644 doc/tutorial-server.rst.in diff --git a/configure.ac b/configure.ac index bca01cc3..fffbcd47 100644 --- a/configure.ac +++ b/configure.ac @@ -399,6 +399,12 @@ AC_CONFIG_FILES([ python/Makefile doc/Makefile doc/conf.py + doc/index.rst + doc/package_README.rst + doc/tutorial-client.rst + doc/tutorial-server.rst + doc/nghttp2.h.rst + doc/nghttp2ver.h.rst ]) AC_OUTPUT diff --git a/doc/Makefile.am b/doc/Makefile.am index 8eb26f0f..35b22c51 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -79,7 +79,8 @@ help: apiref.rst: $(top_builddir)/lib/includes/nghttp2/nghttp2ver.h \ $(top_builddir)/lib/includes/nghttp2/nghttp2.h - $(PYTHON) $(builddir)/mkapiref.py --header apiref-header.rst $^ > $@ + $(PYTHON) $(top_srcdir)/doc/mkapiref.py \ + --header $(top_srcdir)/doc/apiref-header.rst $^ > $@ clean: -rm apiref.rst diff --git a/doc/conf.py.in b/doc/conf.py.in index 2424755c..75c1626c 100644 --- a/doc/conf.py.in +++ b/doc/conf.py.in @@ -51,7 +51,7 @@ import sys, os extensions = [] # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ['@top_srcdir@/_templates'] # The suffix of source filenames. source_suffix = '.rst' @@ -87,7 +87,7 @@ release = '@PACKAGE_VERSION@' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = ['manual', 'README.rst', '*-header.rst'] +exclude_patterns = ['manual', 'README.rst', '*-header.rst', 'sources'] # The reST default role (used for this markup: `text`) to use for all documents. default_role = 'c:func' @@ -126,7 +126,7 @@ html_theme = 'sphinx_rtd_theme' #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. -html_theme_path = ['_themes'] +html_theme_path = ['@top_srcdir@/doc/_themes'] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". @@ -177,7 +177,8 @@ html_sidebars = { #html_split_index = False # If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True +html_show_sourcelink = False +html_copy_source = False # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True diff --git a/doc/index.rst.in b/doc/index.rst.in new file mode 100644 index 00000000..2a49369c --- /dev/null +++ b/doc/index.rst.in @@ -0,0 +1 @@ +.. include:: @top_srcdir@/doc/sources/index.rst diff --git a/doc/nghttp2.h.rst b/doc/nghttp2.h.rst deleted file mode 100644 index 86284f2e..00000000 --- a/doc/nghttp2.h.rst +++ /dev/null @@ -1,4 +0,0 @@ -nghttp2.h -========= - -.. literalinclude:: ../lib/includes/nghttp2/nghttp2.h diff --git a/doc/nghttp2.h.rst.in b/doc/nghttp2.h.rst.in new file mode 100644 index 00000000..29e641da --- /dev/null +++ b/doc/nghttp2.h.rst.in @@ -0,0 +1,4 @@ +nghttp2.h +========= + +.. literalinclude:: @top_srcdir@/lib/includes/nghttp2/nghttp2.h diff --git a/doc/nghttp2ver.h.rst b/doc/nghttp2ver.h.rst deleted file mode 100644 index d0cdbcbb..00000000 --- a/doc/nghttp2ver.h.rst +++ /dev/null @@ -1,4 +0,0 @@ -nghttp2ver.h -============ - -.. literalinclude:: ../lib/includes/nghttp2/nghttp2ver.h diff --git a/doc/nghttp2ver.h.rst.in b/doc/nghttp2ver.h.rst.in new file mode 100644 index 00000000..c6aa779d --- /dev/null +++ b/doc/nghttp2ver.h.rst.in @@ -0,0 +1,4 @@ +nghttp2ver.h +============ + +.. literalinclude:: @top_builddir@/lib/includes/nghttp2/nghttp2ver.h diff --git a/doc/package_README.rst b/doc/package_README.rst deleted file mode 100644 index 72a33558..00000000 --- a/doc/package_README.rst +++ /dev/null @@ -1 +0,0 @@ -.. include:: ../README.rst diff --git a/doc/package_README.rst.in b/doc/package_README.rst.in new file mode 100644 index 00000000..dfa6b2d4 --- /dev/null +++ b/doc/package_README.rst.in @@ -0,0 +1 @@ +.. include:: @top_srcdir@/README.rst diff --git a/doc/index.rst b/doc/sources/index.rst similarity index 100% rename from doc/index.rst rename to doc/sources/index.rst diff --git a/doc/tutorial-client.rst b/doc/sources/tutorial-client.rst similarity index 99% rename from doc/tutorial-client.rst rename to doc/sources/tutorial-client.rst index 2c12f943..297773e1 100644 --- a/doc/tutorial-client.rst +++ b/doc/sources/tutorial-client.rst @@ -482,8 +482,3 @@ remote peer), we call `nghttp2_session_terminate_session()` to commencing the closure of the HTTP/2.0 session gracefully. If you have some data associated for the stream to be closed, you may delete it here. - -libevent-client.c ------------------ - -.. literalinclude:: ../examples/libevent-client.c diff --git a/doc/tutorial-server.rst b/doc/sources/tutorial-server.rst similarity index 99% rename from doc/tutorial-server.rst rename to doc/sources/tutorial-server.rst index ff5e0552..529f2c0e 100644 --- a/doc/tutorial-server.rst +++ b/doc/sources/tutorial-server.rst @@ -587,9 +587,3 @@ is about to close:: We destroy ``http2_stream_data`` object in this function since the stream is about to close and we no longer use that object. - - -libevent-server.c ------------------ - -.. literalinclude:: ../examples/libevent-server.c diff --git a/doc/tutorial-client.rst.in b/doc/tutorial-client.rst.in new file mode 100644 index 00000000..4f7fcfc9 --- /dev/null +++ b/doc/tutorial-client.rst.in @@ -0,0 +1,6 @@ +.. include:: @top_srcdir@/doc/sources/tutorial-client.rst + +libevent-client.c +----------------- + +.. literalinclude:: @top_srcdir@/examples/libevent-client.c diff --git a/doc/tutorial-server.rst.in b/doc/tutorial-server.rst.in new file mode 100644 index 00000000..19722661 --- /dev/null +++ b/doc/tutorial-server.rst.in @@ -0,0 +1,6 @@ +.. include:: @top_srcdir@/doc/sources/tutorial-server.rst + +libevent-server.c +----------------- + +.. literalinclude:: @top_srcdir@/examples/libevent-server.c From be5f04f130eedbcd64524905e54774b91743a3f3 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 13 Feb 2014 23:44:47 +0900 Subject: [PATCH 4/4] Update .gitignore --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index 2cd1cea6..e85ccca6 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,9 @@ INSTALL compile test-driver .dirstamp +doc/index.rst +doc/nghttp2.h.rst +doc/nghttp2ver.h.rst +doc/package_README.rst +doc/tutorial-client.rst +doc/tutorial-server.rst