[arch-commits] Commit in restbed/repos (4 files)
Baptiste Jonglez
zorun at archlinux.org
Fri Feb 2 07:48:57 UTC 2018
Date: Friday, February 2, 2018 @ 07:48:56
Author: zorun
Revision: 288540
archrelease: copy trunk to community-testing-x86_64
Added:
restbed/repos/community-testing-x86_64/
restbed/repos/community-testing-x86_64/PKGBUILD
(from rev 288539, restbed/trunk/PKGBUILD)
restbed/repos/community-testing-x86_64/async_read_until.patch
(from rev 288539, restbed/trunk/async_read_until.patch)
restbed/repos/community-testing-x86_64/strand.patch
(from rev 288539, restbed/trunk/strand.patch)
------------------------+
PKGBUILD | 48 ++++++++++++++++++
async_read_until.patch | 123 +++++++++++++++++++++++++++++++++++++++++++++++
strand.patch | 24 +++++++++
3 files changed, 195 insertions(+)
Copied: restbed/repos/community-testing-x86_64/PKGBUILD (from rev 288539, restbed/trunk/PKGBUILD)
===================================================================
--- community-testing-x86_64/PKGBUILD (rev 0)
+++ community-testing-x86_64/PKGBUILD 2018-02-02 07:48:56 UTC (rev 288540)
@@ -0,0 +1,48 @@
+# Maintainer: Baptiste Jonglez <baptiste--aur at jonglez dot org>
+# Contributor: Justin Wilcox <nat1192 at gmail dot com>
+pkgname=restbed
+pkgver=4.6+17+gdf867a8
+pkgrel=1
+pkgdesc="A framework for asynchronous RESTful functionality in C++11 applications"
+arch=('x86_64')
+url="https://github.com/Corvusoft/restbed"
+license=('AGPL3')
+depends=('openssl')
+replaces=('restbed-latest')
+conflicts=('restbed-latest')
+makedepends=('cmake' 'asio' 'kashmir')
+_commit=df867a858dddc4cf6ca8642da02720bd65ba239a
+source=("https://github.com/Corvusoft/restbed/archive/${_commit}/$pkgname-$pkgver.tar.gz"
+ "strand.patch"
+ "async_read_until.patch")
+sha256sums=('0b752078d75e4d7f1e896bb208186bb65e2e558ea531c6a05a086c7e7504e060'
+ 'a67baa5ffce44a851ba6bd47cbd04089665e52abc154b73063f51515e2094a51'
+ '9ba679d22448bb567766dccf58f98744cc90e0a851a5ccd37596bb4790396049')
+
+prepare() {
+ cd "$srcdir/$pkgname-$_commit"
+
+ # Necessary to build against asio 1.10.X
+ patch -p1 < "$srcdir"/strand.patch
+ # https://github.com/Corvusoft/restbed/pull/273
+ patch -p1 < "$srcdir"/async_read_until.patch
+}
+
+build() {
+ cd "$srcdir/$pkgname-$_commit"
+
+ mkdir -p build
+ cd build
+ cmake .. \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=lib \
+ -DBUILD_SHARED=on
+ make
+}
+
+package() {
+ cd "$srcdir/$pkgname-$_commit"
+
+ cd build/
+ make DESTDIR="$pkgdir" install
+}
Copied: restbed/repos/community-testing-x86_64/async_read_until.patch (from rev 288539, restbed/trunk/async_read_until.patch)
===================================================================
--- community-testing-x86_64/async_read_until.patch (rev 0)
+++ community-testing-x86_64/async_read_until.patch 2018-02-02 07:48:56 UTC (rev 288540)
@@ -0,0 +1,123 @@
+From 09b542eea3fb3038d02ff056d41dea16bfe889bd Mon Sep 17 00:00:00 2001
+From: AmarOk <contact at enconn.fr>
+Date: Tue, 5 Dec 2017 10:45:53 -0600
+Subject: [PATCH]socket_impl: replace read_until by async_read_until
+
+---
+ source/corvusoft/restbed/detail/socket_impl.cpp | 62 +++++++++++++++++++------
+ 1 file changed, 49 insertions(+), 13 deletions(-)
+
+diff --git a/source/corvusoft/restbed/detail/socket_impl.cpp b/source/corvusoft/restbed/detail/socket_impl.cpp
+index 90e8b04..379f1c7 100644
+--- a/source/corvusoft/restbed/detail/socket_impl.cpp
++++ b/source/corvusoft/restbed/detail/socket_impl.cpp
+@@ -417,28 +417,47 @@ namespace restbed
+ m_timer->expires_from_now( m_timeout );
+ m_timer->async_wait( bind( &SocketImpl::connection_timeout_handler, this, shared_from_this( ), _1 ) );
+
++
+ size_t size = 0;
++ auto finished = std::make_shared<bool>(false);
++ auto sharedError = std::make_shared<error_code>();
++ auto sharedSize = std::make_shared<size_t>(0);
++
+ #ifdef BUILD_SSL
+-
++
+ if ( m_socket not_eq nullptr )
+ {
+ #endif
+- size = asio::read( *m_socket, *data, asio::transfer_at_least( length ), error );
++ asio::async_read( *m_socket, *data, asio::transfer_at_least( length ),
++ [ this, finished, sharedSize, sharedError ]( const error_code & error, size_t size ) {
++ *sharedError = error;
++ *sharedSize = size;
++ *finished = true;
++ });
+ #ifdef BUILD_SSL
+ }
+ else
+ {
+- size = asio::read( *m_ssl_socket, *data, asio::transfer_at_least( length ), error );
++ asio::async_read( *m_ssl_socket, *data, asio::transfer_at_least( length ),
++ [ this, finished, sharedSize, sharedError ]( const error_code & error, size_t size ) {
++ *sharedError = error;
++ *sharedSize = size;
++ *finished = true;
++ });
+ }
+-
+ #endif
++ auto& io_service = m_socket->get_io_service( );
++ while (!*finished)
++ io_service.run_one();
++ error = *sharedError;
++ size = *sharedSize;
+ m_timer->cancel( );
+-
++
+ if ( error )
+ {
+ m_is_open = false;
+ }
+-
++
+ return size;
+ }
+
+@@ -549,28 +568,45 @@ namespace restbed
+ m_timer->async_wait( bind( &SocketImpl::connection_timeout_handler, this, shared_from_this( ), _1 ) );
+
+ size_t length = 0;
+-
++ auto finished = std::make_shared<bool>(false);
++ auto sharedError = std::make_shared<error_code>();
++ auto sharedLength = std::make_shared<size_t>(0);
++
+ #ifdef BUILD_SSL
+-
++
+ if ( m_socket not_eq nullptr )
+ {
+ #endif
+- length = asio::read_until( *m_socket, *data, delimiter, error );
++ asio::async_read_until( *m_socket, *data, delimiter,
++ [ this, finished, sharedLength, sharedError ]( const error_code & error, size_t length ) {
++ *sharedError = error;
++ *sharedLength = length;
++ *finished = true;
++ });
+ #ifdef BUILD_SSL
+ }
+ else
+ {
+- length = asio::read_until( *m_ssl_socket, *data, delimiter, error );
++ asio::async_read_until( *m_ssl_socket, *data, delimiter,
++ [ this, finished, sharedLength, sharedError ]( const error_code & error, size_t length ) {
++ *sharedError = error;
++ *sharedLength = length;
++ *finished = true;
++ });
+ }
+-
+ #endif
++ auto& io_service = m_socket->get_io_service( );
++ while (!*finished)
++ io_service.run_one();
++ error = *sharedError;
++ length = *sharedLength;
+ m_timer->cancel( );
+-
++
+ if ( error )
+ {
+ m_is_open = false;
+ }
+-
++
+ return length;
+ }
+
+--
+2.14.3
+
Copied: restbed/repos/community-testing-x86_64/strand.patch (from rev 288539, restbed/trunk/strand.patch)
===================================================================
--- community-testing-x86_64/strand.patch (rev 0)
+++ community-testing-x86_64/strand.patch 2018-02-02 07:48:56 UTC (rev 288540)
@@ -0,0 +1,24 @@
+From a330edb28151830aeaf08a71e42cb6618c25ef2f Mon Sep 17 00:00:00 2001
+From: Sébastien Blin <sebastiem.blin at savoirfairelinux.fr>
+Date: Tue, 5 Dec 2017 10:31:21 -0600
+Subject: [PATCH]update strand header for asio
+
+---
+ source/corvusoft/restbed/detail/socket_impl.hpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/source/corvusoft/restbed/detail/socket_impl.hpp b/source/corvusoft/restbed/detail/socket_impl.hpp
+index b10c3f7..02df572 100644
+--- a/source/corvusoft/restbed/detail/socket_impl.hpp
++++ b/source/corvusoft/restbed/detail/socket_impl.hpp
+@@ -23,7 +23,7 @@
+ #include <asio/streambuf.hpp>
+ #include <asio/steady_timer.hpp>
+ #include <asio/io_service.hpp>
+-#include <asio/io_service_strand.hpp>
++#include <asio/strand.hpp>
+
+ #ifdef BUILD_SSL
+ #include <asio/ssl.hpp>
+--
+2.14.3
More information about the arch-commits
mailing list