From 95ec3f4db59d6733d95efc2153fb3de50ad00a25 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Sat, 10 Aug 2013 03:24:32 -0700 Subject: [PATCH] Import ProxyHandshake into beast --- Builds/VisualStudio2012/RippleD.vcxproj | 7 ------- .../VisualStudio2012/RippleD.vcxproj.filters | 6 ------ .../Builds/VisualStudio2012/beast.vcxproj | 7 +++++++ .../VisualStudio2012/beast.vcxproj.filters | 9 +++++++++ .../beast/modules/beast_asio/beast_asio.cpp | 2 ++ .../beast/modules/beast_asio/beast_asio.h | 2 ++ .../protocol/beast_ProxyHandshake.cpp | 17 +++++++++++++++-- .../protocol/beast_ProxyHandshake.h | 19 ++++++++++++++++--- modules/ripple_app/ripple_app.cpp | 3 --- 9 files changed, 51 insertions(+), 21 deletions(-) rename modules/ripple_app/network/ripple_ProxyHandshake.cpp => Subtrees/beast/modules/beast_asio/protocol/beast_ProxyHandshake.cpp (90%) rename modules/ripple_app/network/ripple_ProxyHandshake.h => Subtrees/beast/modules/beast_asio/protocol/beast_ProxyHandshake.h (77%) diff --git a/Builds/VisualStudio2012/RippleD.vcxproj b/Builds/VisualStudio2012/RippleD.vcxproj index 8165e34b5..d436dc276 100644 --- a/Builds/VisualStudio2012/RippleD.vcxproj +++ b/Builds/VisualStudio2012/RippleD.vcxproj @@ -301,12 +301,6 @@ true true - - true - true - true - true - true true @@ -1431,7 +1425,6 @@ - diff --git a/Builds/VisualStudio2012/RippleD.vcxproj.filters b/Builds/VisualStudio2012/RippleD.vcxproj.filters index 106315f1a..94e9ddf1d 100644 --- a/Builds/VisualStudio2012/RippleD.vcxproj.filters +++ b/Builds/VisualStudio2012/RippleD.vcxproj.filters @@ -873,9 +873,6 @@ [1] Ripple\ripple_app\main - - [1] Ripple\ripple_app\network - [1] Ripple\ripple_app\main @@ -1667,9 +1664,6 @@ [2] Build - - [1] Ripple\ripple_app\network - [1] Ripple\ripple_app\main diff --git a/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj b/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj index 3894c35e8..c4b9f5ae4 100644 --- a/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj +++ b/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj @@ -70,6 +70,7 @@ + @@ -291,6 +292,12 @@ + + true + true + true + true + true true diff --git a/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj.filters b/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj.filters index c85fd8174..33811bf7c 100644 --- a/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj.filters +++ b/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj.filters @@ -152,6 +152,9 @@ {422da6a1-e57e-4a96-9fce-e5958c16026e} + + {c4a7b6bb-88ec-4ff1-bc56-7c432a467500} + @@ -809,6 +812,9 @@ beast_asio\tests + + beast_asio\protocol + @@ -1261,6 +1267,9 @@ beast_asio\tests + + beast_asio\protocol + diff --git a/Subtrees/beast/modules/beast_asio/beast_asio.cpp b/Subtrees/beast/modules/beast_asio/beast_asio.cpp index b74854aa5..39fcf7d10 100644 --- a/Subtrees/beast/modules/beast_asio/beast_asio.cpp +++ b/Subtrees/beast/modules/beast_asio/beast_asio.cpp @@ -28,6 +28,8 @@ namespace beast #include "sockets/beast_Socket.cpp" #include "sockets/beast_SslContext.cpp" +#include "protocol/beast_ProxyHandshake.cpp" + #include "tests/beast_TestPeerBasics.cpp" #include "tests/beast_TestPeerLogic.cpp" #include "tests/beast_TestPeerLogicSyncServer.cpp" diff --git a/Subtrees/beast/modules/beast_asio/beast_asio.h b/Subtrees/beast/modules/beast_asio/beast_asio.h index f4a42d6e1..077268e00 100644 --- a/Subtrees/beast/modules/beast_asio/beast_asio.h +++ b/Subtrees/beast/modules/beast_asio/beast_asio.h @@ -56,6 +56,8 @@ namespace beast #include "sockets/beast_SharedSocket.h" #include "sockets/beast_SslContext.h" +#include "protocol/beast_ProxyHandshake.h" + #include "tests/beast_TestPeerBasics.h" #include "tests/beast_TestPeer.h" #include "tests/beast_TestPeerDetails.h" diff --git a/modules/ripple_app/network/ripple_ProxyHandshake.cpp b/Subtrees/beast/modules/beast_asio/protocol/beast_ProxyHandshake.cpp similarity index 90% rename from modules/ripple_app/network/ripple_ProxyHandshake.cpp rename to Subtrees/beast/modules/beast_asio/protocol/beast_ProxyHandshake.cpp index 2cd92a659..99dc22beb 100644 --- a/modules/ripple_app/network/ripple_ProxyHandshake.cpp +++ b/Subtrees/beast/modules/beast_asio/protocol/beast_ProxyHandshake.cpp @@ -1,6 +1,19 @@ //------------------------------------------------------------------------------ /* - Copyright (c) 2011-2013, OpenCoin, Inc. + This file is part of Beast: https://github.com/vinniefalco/Beast + Copyright 2013, Vinnie Falco + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ //============================================================================== @@ -269,7 +282,7 @@ bool ProxyHandshake::Version1::parse (void const* headerData, size_t headerBytes class ProxyHandshakeTests : public UnitTest { public: - ProxyHandshakeTests () : UnitTest ("ProxyHandshake", "ripple") + ProxyHandshakeTests () : UnitTest ("ProxyHandshake", "beast") { } diff --git a/modules/ripple_app/network/ripple_ProxyHandshake.h b/Subtrees/beast/modules/beast_asio/protocol/beast_ProxyHandshake.h similarity index 77% rename from modules/ripple_app/network/ripple_ProxyHandshake.h rename to Subtrees/beast/modules/beast_asio/protocol/beast_ProxyHandshake.h index d9bd6efa3..eea2e480d 100644 --- a/modules/ripple_app/network/ripple_ProxyHandshake.h +++ b/Subtrees/beast/modules/beast_asio/protocol/beast_ProxyHandshake.h @@ -1,11 +1,24 @@ //------------------------------------------------------------------------------ /* - Copyright (c) 2011-2013, OpenCoin, Inc. + This file is part of Beast: https://github.com/vinniefalco/Beast + Copyright 2013, Vinnie Falco + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ //============================================================================== -#ifndef RIPPLE_PROXYYHANDSHAKE_H_INCLUDED -#define RIPPLE_PROXYYHANDSHAKE_H_INCLUDED +#ifndef BEAST_PROXYYHANDSHAKE_H_INCLUDED +#define BEAST_PROXYYHANDSHAKE_H_INCLUDED /** PROXY protocol handshake state machine. diff --git a/modules/ripple_app/ripple_app.cpp b/modules/ripple_app/ripple_app.cpp index ab1bb88cc..3f656e706 100644 --- a/modules/ripple_app/ripple_app.cpp +++ b/modules/ripple_app/ripple_app.cpp @@ -239,8 +239,6 @@ static const uint64 tenTo17m1 = tenTo17 - 1; //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ -#include "network/ripple_ProxyHandshake.h" // private? - //------------------------------------------------------------------------------ #if ! defined (RIPPLE_MAIN_PART) || RIPPLE_MAIN_PART == 1 @@ -328,7 +326,6 @@ static DH* handleTmpDh (SSL* ssl, int is_export, int iKeyLength) #include "tx/Transactor.cpp" #include "network/WSConnection.cpp" #include "network/WSDoor.cpp" -#include "network/ripple_ProxyHandshake.cpp" #endif