fix build compatibility issues, add travis build test
This commit is contained in:
parent
a097b3c377
commit
9766e41dee
4 changed files with 29 additions and 26 deletions
22
.travis.yml
Normal file
22
.travis.yml
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
language: c
|
||||||
|
sudo: false
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- ~/arduino_ide
|
||||||
|
- ~/.arduino15/packages/
|
||||||
|
git:
|
||||||
|
depth: false
|
||||||
|
quiet: true
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
# You can uncomment this to explicitly choose an (old) version of the Arduino IDE
|
||||||
|
#- ARDUINO_IDE_VERSION="1.8.7"
|
||||||
|
- INSTALL_PLATFORMS=samd
|
||||||
|
before_install:
|
||||||
|
- source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/install.sh)
|
||||||
|
install:
|
||||||
|
# Note that every library should be installed in a seperate command
|
||||||
|
- if [! -d "$HOME/arduino_ide/libraries/EthernetLarge" ]; then git clone https://github.com/OPEnSLab-OSU/EthernetLarge.git $HOME/arduino_ide/libraries/EthernetLarge; fi
|
||||||
|
|
||||||
|
script:
|
||||||
|
- build_platform zero
|
|
@ -18,7 +18,6 @@
|
||||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <type_traits>
|
|
||||||
#include "Client.h"
|
#include "Client.h"
|
||||||
#include "SSLClientImpl.h"
|
#include "SSLClientImpl.h"
|
||||||
#include "SSLSession.h"
|
#include "SSLSession.h"
|
||||||
|
@ -48,7 +47,6 @@ class SSLClient : public SSLClientImpl {
|
||||||
* amount past that will require special modification of this library, and
|
* amount past that will require special modification of this library, and
|
||||||
* assumes you know what you are doing.
|
* assumes you know what you are doing.
|
||||||
*/
|
*/
|
||||||
static_assert(std::is_base_of<Client, C>::value, "SSLClient can only accept a type with base class Client!");
|
|
||||||
static_assert(SessionCache > 0 && SessionCache < 255, "There can be no less than one and no more than 255 sessions in the cache!");
|
static_assert(SessionCache > 0 && SessionCache < 255, "There can be no less than one and no more than 255 sessions in the cache!");
|
||||||
static_assert(SessionCache <= 3, "You need to decrease the size of m_iobuf in order to have more than 3 sessions at once, otherwise memory issues will occur.");
|
static_assert(SessionCache <= 3, "You need to decrease the size of m_iobuf in order to have more than 3 sessions at once, otherwise memory issues will occur.");
|
||||||
|
|
||||||
|
@ -356,30 +354,12 @@ public:
|
||||||
bool operator==(const C& rhs) { return m_client == rhs; }
|
bool operator==(const C& rhs) { return m_client == rhs; }
|
||||||
/** @brief Returns whether or not two SSLClient objects do not have the same underlying client object */
|
/** @brief Returns whether or not two SSLClient objects do not have the same underlying client object */
|
||||||
bool operator!=(const C& rhs) { return m_client != rhs; }
|
bool operator!=(const C& rhs) { return m_client != rhs; }
|
||||||
/** @brief Returns the local port, C::localPort exists. Else return 0. */
|
/** @brief Returns the local port, if C::localPort exists */
|
||||||
uint16_t localPort() override {
|
uint16_t localPort() override { return m_client.localPort(); }
|
||||||
if (std::is_member_function_pointer<decltype(&C::localPort)>::value) return m_client.localPort();
|
/** @brief Returns the remote IP, if C::remoteIP exists. */
|
||||||
else {
|
IPAddress remoteIP() override { return m_client.remoteIP(); }
|
||||||
m_warn("Client class has no localPort function, so localPort() will always return 0", __func__);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/** @brief Returns the remote IP, if C::remoteIP exists. Else return INADDR_NONE. */
|
|
||||||
IPAddress remoteIP() override {
|
|
||||||
if (std::is_member_function_pointer<decltype(&C::remoteIP)>::value) return m_client.remoteIP();
|
|
||||||
else {
|
|
||||||
m_warn("Client class has no remoteIP function, so remoteIP() will always return INADDR_NONE. This means that sessions caching will always be disabled.", __func__);
|
|
||||||
return INADDR_NONE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/** @brief Returns the remote port, if C::remotePort exists. Else return 0. */
|
/** @brief Returns the remote port, if C::remotePort exists. Else return 0. */
|
||||||
uint16_t remotePort() override {
|
uint16_t remotePort() override { return m_client.remotePort(); }
|
||||||
if (std::is_member_function_pointer<decltype(&C::remotePort)>::value) return m_client.remotePort();
|
|
||||||
else {
|
|
||||||
m_warn("Client class has no remotePort function, so remotePort() will always return 0", __func__);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @brief Returns a reference to the client object stored in this class. Take care not to break it. */
|
/** @brief Returns a reference to the client object stored in this class. Take care not to break it. */
|
||||||
C& getClient() { return m_client; }
|
C& getClient() { return m_client; }
|
||||||
|
|
|
@ -203,7 +203,6 @@ private:
|
||||||
* connection.
|
* connection.
|
||||||
*/
|
*/
|
||||||
unsigned char m_iobuf[2048];
|
unsigned char m_iobuf[2048];
|
||||||
static_assert(sizeof m_iobuf <= BR_SSL_BUFSIZE_BIDI, "m_iobuf must be below maximum buffer size");
|
|
||||||
// store the index of where we are writing in the buffer
|
// store the index of where we are writing in the buffer
|
||||||
// so we can send our records all at once to prevent
|
// so we can send our records all at once to prevent
|
||||||
// weird timing issues
|
// weird timing issues
|
||||||
|
|
|
@ -159,7 +159,9 @@
|
||||||
* Note: if BR_LOMUL is not explicitly enabled or disabled, then
|
* Note: if BR_LOMUL is not explicitly enabled or disabled, then
|
||||||
* enabling BR_ARMEL_CORTEXM_GCC also enables BR_LOMUL.
|
* enabling BR_ARMEL_CORTEXM_GCC also enables BR_LOMUL.
|
||||||
*/
|
*/
|
||||||
|
#ifdef ARDUINO_ARCH_SAMD
|
||||||
#define BR_ARMEL_CORTEXM_GCC 1
|
#define BR_ARMEL_CORTEXM_GCC 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When BR_AES_X86NI is enabled, the AES implementation using the x86 "NI"
|
* When BR_AES_X86NI is enabled, the AES implementation using the x86 "NI"
|
||||||
|
|
Loading…
Reference in a new issue