Permalink
Browse files

Upgrade spdylay to efebc1e1afd1b3b4f1219e098b052c6dcd061cbf

  • Loading branch information...
1 parent e512027 commit c69176ce38f66edd0d86815b0b7573acef334fb6 @pquerna committed Mar 28, 2012
Showing with 713 additions and 386 deletions.
  1. +15 −3 deps/spdylay/README.rst
  2. +10 −3 deps/spdylay/configure.ac
  3. +2 −2 deps/spdylay/examples/Makefile.am
  4. +3 −2 deps/spdylay/lib/Makefile.am
  5. +45 −45 deps/spdylay/lib/includes/spdylay/spdylay.h
  6. +104 −21 deps/spdylay/lib/spdylay_frame.c
  7. +74 −0 deps/spdylay/lib/spdylay_frame.h
  8. +4 −2 deps/spdylay/lib/spdylay_helper.c
  9. +40 −0 deps/spdylay/lib/spdylay_net.h
  10. +1 −1 deps/spdylay/lib/spdylay_npn.c
  11. +1 −1 deps/spdylay/lib/spdylay_pq.c
  12. +7 −6 deps/spdylay/lib/spdylay_queue.c
  13. +27 −35 deps/spdylay/lib/spdylay_session.c
  14. +11 −5 deps/spdylay/lib/spdylay_session.h
  15. +2 −1 deps/spdylay/lib/spdylay_submit.c
  16. +1 −1 deps/spdylay/tests/Makefile.am
  17. +6 −2 deps/spdylay/tests/main.c
  18. +1 −1 deps/spdylay/tests/spdylay_buffer_test.c
  19. +2 −2 deps/spdylay/tests/spdylay_buffer_test.h
  20. +124 −39 deps/spdylay/tests/spdylay_frame_test.c
  21. +23 −21 deps/spdylay/tests/spdylay_frame_test.h
  22. +1 −1 deps/spdylay/tests/spdylay_map_test.c
  23. +1 −1 deps/spdylay/tests/spdylay_map_test.h
  24. +5 −4 deps/spdylay/tests/spdylay_npn_test.c
  25. +2 −2 deps/spdylay/tests/spdylay_npn_test.h
  26. +1 −1 deps/spdylay/tests/spdylay_pq_test.c
  27. +1 −1 deps/spdylay/tests/spdylay_pq_test.h
  28. +1 −1 deps/spdylay/tests/spdylay_queue_test.c
  29. +2 −2 deps/spdylay/tests/spdylay_queue_test.h
  30. +147 −131 deps/spdylay/tests/spdylay_session_test.c
  31. +40 −40 deps/spdylay/tests/spdylay_session_test.h
  32. +2 −2 deps/spdylay/tests/spdylay_stream_test.c
  33. +1 −1 deps/spdylay/tests/spdylay_stream_test.h
  34. +3 −3 deps/spdylay/tests/spdylay_zlib_test.c
  35. +3 −3 deps/spdylay/tests/spdylay_zlib_test.h
@@ -12,9 +12,21 @@ choose the way of handling events. This library code does not depend
on any particular SSL library (except for example programs which
depend on OpenSSL 1.0.1 or later).
-The current status of development is in a beta stage now. As described
-below, we can create SPDY client and server with the current Spdylay
-API.
+STATUS
+------
+
+SPDY/2
+ Most of the SPDY/2 functionality has been implemented.
+
+SPDY/3
+ CREDENTIALS frame has not been implemented yet.
+
+In both versions, the direct support of server-push has not been
+available yet. The application can achieve server-push using
+primitive APIs though.
+
+As described below, we can create SPDY client and server with the
+current Spdylay API.
Build from git
--------------
@@ -21,14 +21,19 @@ dnl LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
dnl OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
dnl WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
AC_PREREQ(2.61)
-LT_PREREQ([2.2.6])
AC_INIT([spdylay], [0.1.0], [t-tujikawa@users.sourceforge.net])
+LT_PREREQ([2.2.6])
+LT_INIT()
dnl See versioning rule:
dnl http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
AC_SUBST(LT_CURRENT, 0)
AC_SUBST(LT_REVISION, 0)
AC_SUBST(LT_AGE, 0)
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
+
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE()
@@ -37,7 +42,6 @@ AC_CONFIG_HEADERS([config.h])
dnl Checks for programs
AC_PROG_CC
AC_PROG_CXX
-AM_PROG_LIBTOOL
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
@@ -89,6 +93,7 @@ PKG_CHECK_MODULES([OPENSSL], [openssl >= 1.0.1])
# Checks for header files.
AC_CHECK_HEADERS([ \
arpa/inet.h \
+ netinet/in.h \
stddef.h \
stdint.h \
stdlib.h \
@@ -108,7 +113,9 @@ AC_CHECK_TYPES([ptrdiff_t])
AC_C_BIGENDIAN
# Checks for library functions.
-AC_FUNC_MALLOC
+if test "x$cross_compiling" != "xyes"; then
+ AC_FUNC_MALLOC
+fi
AC_CHECK_FUNCS([ \
memmove \
memset \
@@ -23,7 +23,7 @@
AM_CFLAGS = -Wall
AM_CPPFLAGS = -Wall -I$(srcdir)/../lib/includes -I$(builddir)/../lib/includes \
- @OPENSSL_CFLAGS@
+ @OPENSSL_CFLAGS@ @DEFS@
AM_LDFLAGS = @OPENSSL_LIBS@
LDADD = $(top_builddir)/lib/libspdylay.la
@@ -56,7 +56,7 @@ spdyd_SOURCES = ${HELPER_OBJECTS} ${HELPER_HFILES} \
spdyd.cc
if HAVE_STDCXX_11
-bin_PROGRAMS += spdynative
+noinst_PROGRAMS = spdynative
spdynative_CXXFLAGS = -std=c++0x
spdynative_SOURCES = ${HELPER_OBJECTS} ${HELPER_HFILES} \
${EVENT_OBJECTS} ${EVENT_HFILES} \
@@ -23,7 +23,7 @@
SUBDIRS = includes
AM_CFLAGS = -Wall
-AM_CPPFLAGS = -I$(srcdir)/includes -I$(builddir)/includes
+AM_CPPFLAGS = -I$(srcdir)/includes -I$(builddir)/includes @DEFS@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libspdylay.pc
@@ -40,7 +40,8 @@ HFILES = spdylay_pq.h spdylay_int.h spdylay_map.h spdylay_queue.h \
spdylay_buffer.h spdylay_frame.h spdylay_zlib.h \
spdylay_session.h spdylay_helper.h spdylay_stream.h spdylay_int.h \
spdylay_npn.h \
- spdylay_submit.h spdylay_outbound_item.h
+ spdylay_submit.h spdylay_outbound_item.h \
+ spdylay_net.h
libspdylay_la_SOURCES = $(HFILES) $(OBJECTS)
libspdylay_la_LDFLAGS = -no-undefined \
@@ -46,17 +46,20 @@ struct spdylay_session;
typedef struct spdylay_session spdylay_session;
/**
- * @macro
- *
- * SPDY protocol version 2
- */
-#define SPDYLAY_PROTO_SPDY2 2
-/**
- * @macro
+ * @enum
*
- * SPDY protocol version 3
+ * The SPDY protocol version.
*/
-#define SPDYLAY_PROTO_SPDY3 3
+typedef enum {
+ /**
+ * SPDY protocol version 2
+ */
+ SPDYLAY_PROTO_SPDY2 = 2,
+ /**
+ * SPDY protocol version 3
+ */
+ SPDYLAY_PROTO_SPDY3 = 3
+} spdylay_proto_version;
/**
* @enum
@@ -144,6 +147,14 @@ typedef enum {
*/
SPDYLAY_ERR_GOAWAY_ALREADY_SENT = -517,
/**
+ * The received frame contains the invalid header block. (e.g.,
+ * There are duplicate header names; or the header names are not
+ * encoded in US-ASCII character set and not lower cased; or the
+ * header name is zero-length string; or the header value contains
+ * multiple in-sequence NUL bytes).
+ */
+ SPDYLAY_ERR_INVALID_HEADER_BLOCK = -518,
+ /**
* The errors < :enum:`SPDYLAY_ERR_FATAL` mean that the library is
* under unexpected condition and cannot process any further data
* reliably (e.g., out of memory).
@@ -156,7 +167,7 @@ typedef enum {
/**
* The user callback function failed. This is a fatal error.
*/
- SPDYLAY_ERR_CALLBACK_FAILURE = -902,
+ SPDYLAY_ERR_CALLBACK_FAILURE = -902
} spdylay_error;
typedef enum {
@@ -207,7 +218,7 @@ typedef enum {
/**
* The DATA frame.
*/
- SPDYLAY_DATA = 100,
+ SPDYLAY_DATA = 100
} spdylay_frame_type;
/**
@@ -408,17 +419,6 @@ typedef enum {
} spdylay_goaway_status_code;
/**
- * @macro
- * Lowest priority value in SPDY/2, which is 3.
- */
-#define SPDYLAY_SPDY2_PRI_LOWEST 3
-/**
- * @macro
- * Lowest priority value in SPDY/3, which is 7.
- */
-#define SPDYLAY_SPDY3_PRI_LOWEST 7
-
-/**
* @struct
* The control frame header.
*/
@@ -460,10 +460,9 @@ typedef struct {
*/
int32_t assoc_stream_id;
/**
- * The priority of this frame. 0 (Highest) to
- * :macro:`SPDYLAY_SPDY2_PRI_LOWEST` or
- * :macro:`SPDYLAY_SPDY3_PRI_LOWEST` (lowest), depending on the
- * protocol version.
+ * The priority of this frame. 0 is the highest priority value. Use
+ * `spdylay_session_get_pri_lowest()` to know the lowest priority
+ * value.
*/
uint8_t pri;
/**
@@ -983,10 +982,10 @@ typedef struct {
* |callbacks|. |user_data| is an arbitrary user supplied data, which
* will be passed to the callback functions.
*
- * Some of the members of |callbacks| can be ``NULL``, but
- * :member:`spdylay_session_callbacks.send_callback` and
- * :member:`spdylay_session_callbacks.recv_callback` must be
- * specified.
+ * The :member:`spdylay_session_callbacks.send_callback` must be
+ * specified. If the application code uses `spdylay_session_recv()`,
+ * the :member:`spdylay_session_callbacks.recv_callback` must be
+ * specified. The other members of |callbacks| can be ``NULL``.
*
* This function returns 0 if it succeeds, or one of the following
* negative error codes:
@@ -1012,10 +1011,10 @@ int spdylay_session_client_new(spdylay_session **session_ptr,
* |callbacks|. |user_data| is an arbitrary user supplied data, which
* will be passed to the callback functions.
*
- * Some of the members of |callbacks| can be ``NULL``, but
- * :member:`spdylay_session_callbacks.send_callback` and
- * :member:`spdylay_session_callbacks.recv_callback` must be
- * specified.
+ * The :member:`spdylay_session_callbacks.send_callback` must be
+ * specified. If the application code uses `spdylay_session_recv()`,
+ * the :member:`spdylay_session_callbacks.recv_callback` must be
+ * specified. The other members of |callbacks| can be ``NULL``.
*
* This function returns 0 if it succeeds, or one of the following
* negative error codes:
@@ -1235,15 +1234,19 @@ size_t spdylay_session_get_outbound_queue_size(spdylay_session *session);
/**
* @function
*
+ * Returns lowest priority value for the |session|.
+ */
+uint8_t spdylay_session_get_pri_lowest(spdylay_session *session);
+
+/**
+ * @function
+ *
* Submits SYN_STREAM frame and optionally one or more DATA
* frames.
*
* The |pri| is priority of this request. 0 is the highest priority
- * value. If the |session| is initialized with the version
- * :macro:`SPDYLAY_PROTO_SPDY2`, the lowest priority value is
- * :macro:`SPDYLAY_SPDY2_PRI_LOWEST`. If the |session| is initialized
- * with the version :macro:`SPDYLAY_PROTO_SPDY3`, the lowest priority
- * value is :macro:`SPDYLAY_SPDY3_PRI_LOWEST`.
+ * value. Use `spdylay_session_get_pri_lowest()` to know the lowest
+ * priority value for this |session|.
*
* The |nv| contains the name/value pairs. For i > 0, ``nv[2*i]``
* contains a pointer to the name string and ``nv[2*i+1]`` contains a
@@ -1364,13 +1367,10 @@ int spdylay_submit_response(spdylay_session *session,
*
* The |assoc_stream_id| is used for server-push. If |session| is
* initialized for client use, |assoc_stream_id| is ignored.
-
+ *
* The |pri| is priority of this request. 0 is the highest priority
- * value. If the |session| is initialized with the version
- * :macro:`SPDYLAY_PROTO_SPDY2`, the lowest priority value is
- * :macro:`SPDYLAY_SPDY2_PRI_LOWEST`. If the |session| is initialized
- * with the version :macro:`SPDYLAY_PROTO_SPDY3`, the lowest priority
- * value is :macro:`SPDYLAY_SPDY3_PRI_LOWEST`.
+ * value. Use `spdylay_session_get_pri_lowest()` to know the lowest
+ * priority value for this |session|.
*
* The |nv| contains the name/value pairs. For i > 0, ``nv[2*i]``
* contains a pointer to the name string and ``nv[2*i+1]`` contains a
Oops, something went wrong.

0 comments on commit c69176c

Please sign in to comment.