Commit f77e61b4 authored by Kartik Mistry's avatar Kartik Mistry 🇮🇳

New upstream version 1.29.0

parent 2c1bb0bd
......@@ -20,6 +20,7 @@ Fredrik Fornwall
ITriskTI
Igor Khomyakov
Jarda Snajdr
Juan Francisco Cantero Hurtado
Kcchouette
Kurt Kartaltepe
Mingye Wang
......
commit 561d49d6e530eb4ea4499f5bd7ce80416ff79738 (HEAD, tag: release-1.27.1, origin/master, origin/HEAD, master)
commit e12693c02787c9ec26175909a080f420be4ca85b (HEAD, tag: release-1.29.0, origin/master, origin/HEAD, master)
Author: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
AuthorDate: 2016-09-17
AuthorDate: 2016-11-15
Commit: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
CommitDate: 2016-09-17
CommitDate: 2016-11-15
Bump up version number to 1.27.1
Update NEWS
commit 812136dd8b568bfe797744bcfcd496aaa2e1b714
commit 10e7830050abf8b104a30ff3c6c323bf02a0c0f2
Author: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
AuthorDate: 2016-09-17
AuthorDate: 2016-11-15
Commit: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
CommitDate: 2016-09-17
CommitDate: 2016-11-15
Update NEWS
Update third-party libraries
commit dd5a3b672c45b07bfb864acb2314f1dcc70b2421
Author: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
AuthorDate: 2016-11-15
Commit: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
CommitDate: 2016-11-15
Bump up version number to 1.29.0
commit d289dc1108324ff5589ab103ef0863faaa3c5de1
Author: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
AuthorDate: 2016-11-09
Commit: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
CommitDate: 2016-11-09
WinTLS: Fix busy loop on write error
commit b4010a52c8249fe46771004013e3d6a700c0d4f0
Merge: a9a60ce 2df30b1
Author: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
AuthorDate: 2016-11-03
Commit: GitHub <noreply@github.com>
CommitDate: 2016-11-03
Merge pull request #766 from aria2/support-1xx
Support 1xx non-final response
commit 2df30b144748dda434aa0002d636220e1f3aa87b
Author: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
AuthorDate: 2016-11-03
Commit: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
CommitDate: 2016-11-03
Support 1xx non-final response
commit a9a60cef1bac42512940d77fd031c3b301629498
Merge: 90452ae fb380d4
Author: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
AuthorDate: 2016-11-02
Commit: GitHub <noreply@github.com>
CommitDate: 2016-11-02
Merge pull request #765 from aria2/update-wslay
Update wslay
commit fb380d40166a2c8cc2c04cf060104bc983e2984b
Author: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
AuthorDate: 2016-11-02
Commit: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
CommitDate: 2016-11-02
Update wslay
commit cfaec39be1ae9ac2c9b6a02470791b46ef15d934
commit 90452ae11b51cb7c7e411a939f81f2d455bac59a
Author: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
AuthorDate: 2016-09-17
AuthorDate: 2016-10-26
Commit: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
CommitDate: 2016-09-17
CommitDate: 2016-10-26
Add missing libssl_compat.h to SRCS
Don't download piece which is filtered out (e.g., --select-file)
This commit fixes the bug that piece which is not requested by
--select-file is downloaded in multi-file WebSeeding.
......@@ -30,10 +30,10 @@ RUN apt-get update && \
RUN curl -L -O https://gmplib.org/download/gmp/gmp-6.1.1.tar.lz && \
curl -L -O http://downloads.sourceforge.net/project/expat/expat/2.2.0/expat-2.2.0.tar.bz2 && \
curl -L -O https://sqlite.org/2016/sqlite-autoconf-3140200.tar.gz && \
curl -L -O https://www.sqlite.org/2016/sqlite-autoconf-3150100.tar.gz && \
curl -L -O http://zlib.net/zlib-1.2.8.tar.xz && \
curl -L -O http://c-ares.haxx.se/download/c-ares-1.11.0.tar.gz && \
curl -L -O http://libssh2.org/download/libssh2-1.7.0.tar.gz
curl -L -O https://c-ares.haxx.se/download/c-ares-1.12.0.tar.gz && \
curl -L -O http://libssh2.org/download/libssh2-1.8.0.tar.gz
RUN tar xf gmp-6.1.1.tar.lz && \
cd gmp-6.1.1 && \
......@@ -57,8 +57,8 @@ RUN tar xf expat-2.2.0.tar.bz2 && \
--build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` && \
make install
RUN tar xf sqlite-autoconf-3140200.tar.gz && \
cd sqlite-autoconf-3140200 && \
RUN tar xf sqlite-autoconf-3150100.tar.gz && \
cd sqlite-autoconf-3150100 && \
./configure \
--disable-shared \
--enable-static \
......@@ -81,8 +81,8 @@ RUN tar xf zlib-1.2.8.tar.xz && \
--static && \
make install
RUN tar xf c-ares-1.11.0.tar.gz && \
cd c-ares-1.11.0 && \
RUN tar xf c-ares-1.12.0.tar.gz && \
cd c-ares-1.12.0 && \
./configure \
--disable-shared \
--enable-static \
......@@ -93,8 +93,8 @@ RUN tar xf c-ares-1.11.0.tar.gz && \
LIBS="-lws2_32" && \
make install
RUN tar xf libssh2-1.7.0.tar.gz && \
cd libssh2-1.7.0 && \
RUN tar xf libssh2-1.8.0.tar.gz && \
cd libssh2-1.8.0 && \
./configure \
--disable-shared \
--enable-static \
......
aria2 1.27.1
aria2 1.29.0
============
Release Note
------------
This release fixes the packaging bug that libssl_compat.h is missing
in the tar balls.
This release fixes several bugs. See Changes below for detailed bug
fixes. This release adds 1xx non-final response support. Wslay
library is updated to the latest revision.
Changes
-------
* Add missing libssl_compat.h to SRCS
* WinTLS: Fix busy loop on write error
GH-744
GH-767
* Support 1xx non-final response
aria2 1.27.0
============
Release Note
------------
This release fixes bug which may cause crash if UDP tracker is used.
It adds new option --save-not-found which prevents downloads failed by
"not found" error from being saved in session file.
Changes
-------
* Hard-disable openssl in osx build
Closes #739
* Fix possible cause of crash if UDP tracker is used
* Remove custom ftruncate64 for Android
The latest NDK versions support ftruncate64, so building a local
copy of ftruncate64 is no longer needed.
Also, the arm and x86 builds of ftruncate64 failed when targeting
API level 21 or higher, as they include <linux/err.h> which are not
present starting from API level 21.
Patch from Fredrik Fornwall
* Fix typo found by Debian's Lintian
GH-763
* Add --save-not-found option
* Update wslay
* Update comment to match code
GH-764
Patch from Torbjörn Lönnemark
* Don't download piece which is filtered out (e.g., --select-file)
* WinTLS: Better errors (from WSA)
This commit fixes the bug that piece which is not requested by
--select-file is downloaded in multi-file Web-Seeding.
* Compile with openssl 1.1.0
GH-769
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for aria2 1.27.1.
# Generated by GNU Autoconf 2.69 for aria2 1.29.0.
#
# Report bugs to <https://github.com/aria2/aria2/issues>.
#
......@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='aria2'
PACKAGE_TARNAME='aria2'
PACKAGE_VERSION='1.27.1'
PACKAGE_STRING='aria2 1.27.1'
PACKAGE_VERSION='1.29.0'
PACKAGE_STRING='aria2 1.29.0'
PACKAGE_BUGREPORT='https://github.com/aria2/aria2/issues'
PACKAGE_URL='https://aria2.github.io/'
......@@ -1591,7 +1591,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures aria2 1.27.1 to adapt to many kinds of systems.
\`configure' configures aria2 1.29.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1663,7 +1663,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of aria2 1.27.1:";;
short | recursive ) echo "Configuration of aria2 1.29.0:";;
esac
cat <<\_ACEOF
......@@ -1866,7 +1866,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
aria2 configure 1.27.1
aria2 configure 1.29.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -2874,7 +2874,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by aria2 $as_me 1.27.1, which was
It was created by aria2 $as_me 1.29.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -3853,7 +3853,7 @@ fi
# Define the identity of the package.
PACKAGE='aria2'
VERSION='1.27.1'
VERSION='1.29.0'
cat >>confdefs.h <<_ACEOF
......@@ -27405,7 +27405,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by aria2 $as_me 1.27.1, which was
This file was extended by aria2 $as_me 1.29.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -27472,7 +27472,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
aria2 config.status 1.27.1
aria2 config.status 1.29.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......@@ -28712,7 +28712,6 @@ $as_echo X"$file" |
cat <<_LT_EOF >> "$cfgfile"
#! $SHELL
# Generated automatically by $as_me ($PACKAGE) $VERSION
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
# Provide generalized library-building support services.
......
......@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
#
AC_PREREQ([2.67])
AC_INIT([aria2],[1.27.1],[https://github.com/aria2/aria2/issues],[aria2],[https://aria2.github.io/])
AC_INIT([aria2],[1.29.0],[https://github.com/aria2/aria2/issues],[aria2],[https://aria2.github.io/])
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
......
......@@ -19108,7 +19108,6 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
cat <<_LT_EOF >> "$cfgfile"
#! $SHELL
# Generated automatically by $as_me ($PACKAGE) $VERSION
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
# Provide generalized library-building support services.
......
......@@ -145,10 +145,15 @@ enum wslay_opcode {
#define wslay_is_ctrl_frame(opcode) ((opcode >> 3) & 1)
/*
* Macros that returns reserved bits: RSV1, RSV2, RSV3. These macros
* assumes that rsv is constructed by ((RSV1 << 2) | (RSV2 << 1) |
* RSV3)
* Macros that represent and return reserved bits: RSV1, RSV2, RSV3.
* These macros assume that rsv is constructed by ((RSV1 << 2) |
* (RSV2 << 1) | RSV3)
*/
#define WSLAY_RSV_NONE ((uint8_t) 0)
#define WSLAY_RSV1_BIT (((uint8_t) 1) << 2)
#define WSLAY_RSV2_BIT (((uint8_t) 1) << 1)
#define WSLAY_RSV3_BIT (((uint8_t) 1) << 0)
#define wslay_get_rsv1(rsv) ((rsv >> 2) & 1)
#define wslay_get_rsv2(rsv) ((rsv >> 1) & 1)
#define wslay_get_rsv3(rsv) (rsv & 1)
......@@ -201,7 +206,7 @@ void wslay_frame_context_free(wslay_frame_context_ptr ctx);
* 1 if this is masked frame, otherwise 0. iocb->payload_length is
* the payload_length of this frame. iocb->data must point to the
* payload data to be sent. iocb->data_length must be the length of
* the data. This function calls recv_callback function if it needs
* the data. This function calls send_callback function if it needs
* to send bytes. This function calls gen_mask_callback function if
* it needs new mask key. This function returns the number of payload
* bytes sent. Please note that it does not include any number of
......@@ -407,6 +412,16 @@ int wslay_event_context_client_init
*/
void wslay_event_context_free(wslay_event_context_ptr ctx);
/*
* Sets a bit mask of allowed reserved bits.
* Currently only permitted values are WSLAY_RSV1_BIT to allow PMCE
* extension (see RFC-7692) or WSLAY_RSV_NONE to disable.
*
* Default: WSLAY_RSV_NONE
*/
void wslay_event_config_set_allowed_rsv_bits(wslay_event_context_ptr ctx,
uint8_t rsv);
/*
* Enables or disables buffering of an entire message for non-control
* frames. If val is 0, buffering is enabled. Otherwise, buffering is
......@@ -550,6 +565,12 @@ struct wslay_event_msg {
int wslay_event_queue_msg(wslay_event_context_ptr ctx,
const struct wslay_event_msg *arg);
/*
* Extended version of wslay_event_queue_msg which allows to set reserved bits.
*/
int wslay_event_queue_msg_ex(wslay_event_context_ptr ctx,
const struct wslay_event_msg *arg, uint8_t rsv);
/*
* Specify "source" to generate message.
*/
......@@ -607,6 +628,13 @@ struct wslay_event_fragmented_msg {
int wslay_event_queue_fragmented_msg
(wslay_event_context_ptr ctx, const struct wslay_event_fragmented_msg *arg);
/*
* Extended version of wslay_event_queue_fragmented_msg which allows to set
* reserved bits.
*/
int wslay_event_queue_fragmented_msg_ex(wslay_event_context_ptr ctx,
const struct wslay_event_fragmented_msg *arg, uint8_t rsv);
/*
* Queues close control frame. This function is provided just for
* convenience. wslay_event_queue_msg() can queue a close control
......
......@@ -206,7 +206,7 @@ static int wslay_event_imsg_append_chunk(struct wslay_event_imsg *m, size_t len)
}
static int wslay_event_omsg_non_fragmented_init
(struct wslay_event_omsg **m, uint8_t opcode,
(struct wslay_event_omsg **m, uint8_t opcode, uint8_t rsv,
const uint8_t *msg, size_t msg_length)
{
*m = (struct wslay_event_omsg*)malloc(sizeof(struct wslay_event_omsg));
......@@ -216,6 +216,7 @@ static int wslay_event_omsg_non_fragmented_init
memset(*m, 0, sizeof(struct wslay_event_omsg));
(*m)->fin = 1;
(*m)->opcode = opcode;
(*m)->rsv = rsv;
(*m)->type = WSLAY_NON_FRAGMENTED;
if(msg_length) {
(*m)->data = (uint8_t*)malloc(msg_length);
......@@ -230,7 +231,7 @@ static int wslay_event_omsg_non_fragmented_init
}
static int wslay_event_omsg_fragmented_init
(struct wslay_event_omsg **m, uint8_t opcode,
(struct wslay_event_omsg **m, uint8_t opcode, uint8_t rsv,
const union wslay_event_msg_source source,
wslay_event_fragmented_msg_callback read_callback)
{
......@@ -240,6 +241,7 @@ static int wslay_event_omsg_fragmented_init
}
memset(*m, 0, sizeof(struct wslay_event_omsg));
(*m)->opcode = opcode;
(*m)->rsv = rsv;
(*m)->type = WSLAY_FRAGMENTED;
(*m)->source = source;
(*m)->read_callback = read_callback;
......@@ -301,7 +303,9 @@ int wslay_event_queue_close(wslay_event_context_ptr ctx, uint16_t status_code,
} else {
ncode = htons(status_code);
memcpy(msg, &ncode, 2);
memcpy(msg+2, reason, reason_length);
if(reason_length) {
memcpy(msg+2, reason, reason_length);
}
msg_length = reason_length+2;
}
arg.opcode = WSLAY_CONNECTION_CLOSE;
......@@ -328,19 +332,33 @@ static int wslay_event_queue_close_wrapper
return 0;
}
static int wslay_event_verify_rsv_bits(wslay_event_context_ptr ctx, uint8_t rsv)
{
return ((rsv & ~ctx->allowed_rsv_bits) == 0);
}
int wslay_event_queue_msg(wslay_event_context_ptr ctx,
const struct wslay_event_msg *arg)
{
return wslay_event_queue_msg_ex(ctx, arg, WSLAY_RSV_NONE);
}
int wslay_event_queue_msg_ex(wslay_event_context_ptr ctx,
const struct wslay_event_msg *arg, uint8_t rsv)
{
int r;
struct wslay_event_omsg *omsg;
if(!wslay_event_is_msg_queueable(ctx)) {
return WSLAY_ERR_NO_MORE_MSG;
}
if(wslay_is_ctrl_frame(arg->opcode) && arg->msg_length > 125) {
/* RSV1 is not allowed for control frames */
if((wslay_is_ctrl_frame(arg->opcode) &&
(arg->msg_length > 125 || wslay_get_rsv1(rsv)))
|| !wslay_event_verify_rsv_bits(ctx, rsv)) {
return WSLAY_ERR_INVALID_ARGUMENT;
}
if((r = wslay_event_omsg_non_fragmented_init
(&omsg, arg->opcode, arg->msg, arg->msg_length)) != 0) {
(&omsg, arg->opcode, rsv, arg->msg, arg->msg_length)) != 0) {
return r;
}
if(wslay_is_ctrl_frame(arg->opcode)) {
......@@ -359,17 +377,24 @@ int wslay_event_queue_msg(wslay_event_context_ptr ctx,
int wslay_event_queue_fragmented_msg
(wslay_event_context_ptr ctx, const struct wslay_event_fragmented_msg *arg)
{
return wslay_event_queue_fragmented_msg_ex(ctx, arg, WSLAY_RSV_NONE);
}
int wslay_event_queue_fragmented_msg_ex(wslay_event_context_ptr ctx,
const struct wslay_event_fragmented_msg *arg, uint8_t rsv)
{
int r;
struct wslay_event_omsg *omsg;
if(!wslay_event_is_msg_queueable(ctx)) {
return WSLAY_ERR_NO_MORE_MSG;
}
if(wslay_is_ctrl_frame(arg->opcode)) {
if(wslay_is_ctrl_frame(arg->opcode) ||
!wslay_event_verify_rsv_bits(ctx, rsv)) {
return WSLAY_ERR_INVALID_ARGUMENT;
}
if((r = wslay_event_omsg_fragmented_init
(&omsg, arg->opcode, arg->source, arg->read_callback)) != 0) {
(&omsg, arg->opcode, rsv, arg->source, arg->read_callback)) != 0) {
return r;
}
if((r = wslay_queue_push(ctx->send_queue, omsg)) != 0) {
......@@ -547,9 +572,11 @@ int wslay_event_recv(wslay_event_context_ptr ctx)
r = wslay_frame_recv(ctx->frame_ctx, &iocb);
if(r >= 0) {
int new_frame = 0;
/* We only allow rsv == 0 ATM. */
if(iocb.rsv != 0 ||
((ctx->server && !iocb.mask) || (!ctx->server && iocb.mask))) {
/* RSV1 is not allowed on control and continuation frames */
if((!wslay_event_verify_rsv_bits(ctx, iocb.rsv)) ||
(wslay_get_rsv1(iocb.rsv) && (wslay_is_ctrl_frame(iocb.opcode) ||
iocb.opcode == WSLAY_CONTINUATION_FRAME)) ||
(ctx->server && !iocb.mask) || (!ctx->server && iocb.mask)) {
if((r = wslay_event_queue_close_wrapper
(ctx, WSLAY_CODE_PROTOCOL_ERROR, NULL, 0)) != 0) {
return r;
......@@ -608,8 +635,10 @@ int wslay_event_recv(wslay_event_context_ptr ctx)
}
}
}
if(ctx->imsg->opcode == WSLAY_TEXT_FRAME ||
ctx->imsg->opcode == WSLAY_CONNECTION_CLOSE) {
/* If RSV1 bit is set then it is too early for utf-8 validation */
if((!wslay_get_rsv1(ctx->imsg->rsv) &&
ctx->imsg->opcode == WSLAY_TEXT_FRAME) ||
ctx->imsg->opcode == WSLAY_CONNECTION_CLOSE) {
size_t i;
if(ctx->imsg->opcode == WSLAY_CONNECTION_CLOSE) {
i = 2;
......@@ -815,6 +844,7 @@ int wslay_event_send(wslay_event_context_ptr ctx)
memset(&iocb, 0, sizeof(iocb));
iocb.fin = 1;
iocb.opcode = ctx->omsg->opcode;
iocb.rsv = ctx->omsg->rsv;
iocb.mask = ctx->server^1;
iocb.data = ctx->omsg->data+ctx->opayloadoff;
iocb.data_length = ctx->opayloadlen-ctx->opayloadoff;
......@@ -871,6 +901,7 @@ int wslay_event_send(wslay_event_context_ptr ctx)
memset(&iocb, 0, sizeof(iocb));
iocb.fin = ctx->omsg->fin;
iocb.opcode = ctx->omsg->opcode;
iocb.rsv = ctx->omsg->rsv;
iocb.mask = ctx->server ? 0 : 1;
iocb.data = ctx->obufmark;
iocb.data_length = ctx->obuflimit-ctx->obufmark;
......@@ -886,6 +917,8 @@ int wslay_event_send(wslay_event_context_ptr ctx)
ctx->omsg = NULL;
} else {
ctx->omsg->opcode = WSLAY_CONTINUATION_FRAME;
/* RSV1 is not set on continuation frames */
ctx->omsg->rsv = ctx->omsg->rsv & ~WSLAY_RSV1_BIT;
}
} else {
break;
......@@ -951,6 +984,13 @@ int wslay_event_get_close_sent(wslay_event_context_ptr ctx)
return (ctx->close_status & WSLAY_CLOSE_SENT) > 0;
}
void wslay_event_config_set_allowed_rsv_bits(wslay_event_context_ptr ctx,
uint8_t rsv)
{
/* We currently only allow WSLAY_RSV1_BIT or WSLAY_RSV_NONE */
ctx->allowed_rsv_bits = rsv & WSLAY_RSV1_BIT;
}
void wslay_event_config_set_no_buffering(wslay_event_context_ptr ctx, int val)
{
if(val) {
......
......@@ -56,6 +56,7 @@ enum wslay_event_msg_type {
struct wslay_event_omsg {
uint8_t fin;
uint8_t opcode;
uint8_t rsv;
enum wslay_event_msg_type type;
uint8_t *data;
......@@ -135,6 +136,7 @@ struct wslay_event_context {
struct wslay_event_callbacks callbacks;
struct wslay_event_frame_user_data frame_user_data;
void *user_data;
uint8_t allowed_rsv_bits;
};
#endif /* WSLAY_EVENT_H */
......@@ -31,7 +31,7 @@
PROGRAM=libtool
PACKAGE=libtool
VERSION="2.4.6 Debian-2.4.6-0.1"
VERSION="2.4.6 Debian-2.4.6-2"
package_revision=2.4.6
......@@ -2068,7 +2068,7 @@ include the following information:
compiler: $LTCC
compiler flags: $LTCFLAGS
linker: $LD (gnu? $with_gnu_ld)
version: $progname (GNU libtool) 2.4.6
version: $progname $scriptversion Debian-2.4.6-2
automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
......
......@@ -728,7 +728,6 @@ _LT_CONFIG_SAVE_COMMANDS([
cat <<_LT_EOF >> "$cfgfile"
#! $SHELL
# Generated automatically by $as_me ($PACKAGE) $VERSION
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
# Provide generalized library-building support services.
......
......@@ -44,6 +44,7 @@ static int clean_suite1(void)
int main(void)
{
CU_pSuite pSuite = NULL;
unsigned int num_tests_failed;
/* initialize the CUnit test registry */
if (CUE_SUCCESS != CU_initialize_registry())
......@@ -93,8 +94,14 @@ int main(void)
test_wslay_event_send_fragmented_msg) ||
!CU_add_test(pSuite, "wslay_event_send_fragmented_msg_with_ctrl",
test_wslay_event_send_fragmented_msg_with_ctrl) ||
!CU_add_test(pSuite, "wslay_event_send_fragmented_msg_with_rsv1",
test_wslay_event_send_fragmented_msg_with_rsv1) ||
!CU_add_test(pSuite, "wslay_event_send_msg_with_rsv1",
test_wslay_event_send_msg_with_rsv1) ||
!CU_add_test(pSuite, "wslay_event_send_ctrl_msg_first",
test_wslay_event_send_ctrl_msg_first) ||
!CU_add_test(pSuite, "wslay_event_send_ctrl_msg_with_rsv1",
test_wslay_event_send_ctrl_msg_with_rsv1) ||
!CU_add_test(pSuite, "wslay_event_queue_close",
test_wslay_event_queue_close) ||
!CU_add_test(pSuite, "wslay_event_queue_close_without_code",
......@@ -109,10 +116,14 @@ int main(void)
test_wslay_event_callback_failure) ||
!CU_add_test(pSuite, "wslay_event_no_buffering",
test_wslay_event_no_buffering) ||
!CU_add_test(pSuite, "wslay_event_recv_text_frame_with_rsv1",
test_wslay_event_recv_text_frame_with_rsv1) ||
!CU_add_test(pSuite, "wslay_event_frame_too_big",
test_wslay_event_frame_too_big) ||
!CU_add_test(pSuite, "wslay_event_message_too_big",
test_wslay_event_message_too_big) ||
!CU_add_test(pSuite, "wslay_event_config_set_allowed_rsv_bits",
test_wslay_event_config_set_allowed_rsv_bits) ||
!CU_add_test(pSuite, "wslay_queue", test_wslay_queue)) {
CU_cleanup_registry();
return CU_get_error();
......@@ -121,6 +132,12 @@ int main(void)
/* Run all tests using the CUnit Basic interface */
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
num_tests_failed = CU_get_number_of_tests_failed();
CU_cleanup_registry();
return CU_get_error();
if (CU_get_error() == CUE_SUCCESS) {
return (int)num_tests_failed;
} else {
printf("CUnit Error: %s\n", CU_get_error_msg());
return CU_get_error();
}
}
......@@ -214,6 +214,71 @@ void test_wslay_event_send_fragmented_msg_with_ctrl(void)
wslay_event_context_free(ctx);
}
void test_wslay_event_send_fragmented_msg_with_rsv1(void)
{
wslay_event_context_ptr ctx;
struct wslay_event_callbacks callbacks;
struct my_user_data ud;
struct accumulator acc;
const char msg[] = "Hello";
struct scripted_data_feed df;
struct wslay_event_fragmented_msg arg;
const uint8_t ans[] = {
0x41, 0x03, 0x48, 0x65, 0x6c,
0x80, 0x02, 0x6c, 0x6f
};
scripted_data_feed_init(&df, (const uint8_t*)msg, sizeof(msg)-1);
df.feedseq[0] = 3;
df.feedseq[1] = 2;
memset(&callbacks, 0, sizeof(callbacks));
callbacks.send_callback = accumulator_send_callback;
memset(&acc, 0, sizeof(acc));
ud.acc = &acc;
wslay_event_context_server_init(&ctx, &callbacks, &ud);
wslay_event_config_set_allowed_rsv_bits(ctx, WSLAY_RSV1_BIT);
memset(&arg, 0, sizeof(arg));
arg.opcode = WSLAY_TEXT_FRAME;
arg.source.data = &df;
arg.read_callback = scripted_read_callback;
CU_ASSERT(0 ==