diff --git a/BESSafeTcp/.settings/com.rim.tad.tools.qml.core.prefs b/BESSafeTcp/.settings/com.rim.tad.tools.qml.core.prefs index 049bcc5..ea2b167 100644 --- a/BESSafeTcp/.settings/com.rim.tad.tools.qml.core.prefs +++ b/BESSafeTcp/.settings/com.rim.tad.tools.qml.core.prefs @@ -1,2 +1,2 @@ -config-pri.hash=38DD7D74F1178ED2E0D2BB7F189451FA +config-pri.hash=17D809CBACB7093946391FEB11215EE2 eclipse.preferences.version=1 diff --git a/BESSafeTcp/assets/main.qml b/BESSafeTcp/assets/main.qml index a148b7f..4c7428c 100644 --- a/BESSafeTcp/assets/main.qml +++ b/BESSafeTcp/assets/main.qml @@ -1,4 +1,19 @@ -// Default empty project template +/* + * Copyright (c) 2012-2014 BlackBerry Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import bb.cascades 1.0 import bb.besutil 1.0 @@ -86,23 +101,7 @@ Page { besConnect.testBSDTcpSockets(); } } -/* - // test Curl OpenSSL button. - Button { - id: curlOpensslButton - text: "Test SSL Sockets with CURL HTTP tunnel" - topMargin: 20 - rightMargin: 200 - preferredWidth: 250 - horizontalAlignment: HorizontalAlignment.Center - verticalAlignment: VerticalAlignment.Center - - // Change the button text on click and hide the fruit button. - onClicked: { - besConnect.testCurlProxyOpenSSLSockets(); - } - } -*/ + // test BSD Tcp button. Button { id: curlButton @@ -121,7 +120,7 @@ Page { TextArea { objectName: "console" text: qsTr("") - textStyle.base: SystemDefaults.TextStyles.SmallText + textStyle.base: SystemDefaults.TextStyles.NormalText verticalAlignment: VerticalAlignment.Bottom horizontalAlignment: HorizontalAlignment.Fill } diff --git a/BESSafeTcp/bar-descriptor.xml b/BESSafeTcp/bar-descriptor.xml index 74952e4..a615b29 100644 --- a/BESSafeTcp/bar-descriptor.xml +++ b/BESSafeTcp/bar-descriptor.xml @@ -39,7 +39,7 @@ - 43 + 45 diff --git a/BESSafeTcp/config.pri b/BESSafeTcp/config.pri index 8496a6b..94ed7d7 100644 --- a/BESSafeTcp/config.pri +++ b/BESSafeTcp/config.pri @@ -42,7 +42,7 @@ config_pri_source_group1 { SOURCES += \ $$quote($$BASEDIR/src/BESConnect.cpp) \ $$quote($$BASEDIR/src/BESSafeTcp.cpp) \ - $$quote($$BASEDIR/src/curllConnectThread.cpp) \ + $$quote($$BASEDIR/src/curlConnectThread.cpp) \ $$quote($$BASEDIR/src/main.cpp) \ $$quote($$BASEDIR/src/sslSocketThread.cpp) \ $$quote($$BASEDIR/src/tcpSocketThread.cpp) diff --git a/BESSafeTcp/src/BESConnect.cpp b/BESSafeTcp/src/BESConnect.cpp index 3d45592..cff994f 100644 --- a/BESSafeTcp/src/BESConnect.cpp +++ b/BESSafeTcp/src/BESConnect.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 Research In Motion Limited. + * Copyright (c) 2012-2014 BlackBerry Limited. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,12 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* - * BESSafeTcp.cpp - * - * Created on: Nov 28, 2012 - * Author: rsperanza - */ #include "BESConnect.hpp" #include "BESSafeTcp.hpp" @@ -227,14 +221,7 @@ void BESConnect::testQtSslSockets() const char *hostName = "ca.yahoo.com"; // The host that you're connecting to const int port = 443; -/* - QNetworkProxy proxy = m_testSocket.proxy(); - if (proxy != QNetworkProxy::NoProxy) { - qDebug() << (QString("default proxy type: ") + proxy.type() + "\n"); - qDebug() << (QString("default proxy host: ") + proxy.hostName() + "\n"); - qDebug() << (QString("default proxy port: ") + proxy.port() + "\n"); - } -*/ + safeConnectQTcp(m_testSslSocket, QString(hostName), port); } diff --git a/BESSafeTcp/src/BESConnect.hpp b/BESSafeTcp/src/BESConnect.hpp index a01f366..1274b5c 100644 --- a/BESSafeTcp/src/BESConnect.hpp +++ b/BESSafeTcp/src/BESConnect.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 Research In Motion Limited. + * Copyright (c) 2012-2014 BlackBerry Limited. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,12 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* - * BESSafeTcp.h - * - * Created on: Nov 28, 2012 - * Author: rsperanza - */ #ifndef BESCONNECT_H_ #define BESCONNECT_H_ diff --git a/BESSafeTcp/src/BESSafeTcp.cpp b/BESSafeTcp/src/BESSafeTcp.cpp index bfa3943..67a121e 100644 --- a/BESSafeTcp/src/BESSafeTcp.cpp +++ b/BESSafeTcp/src/BESSafeTcp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 Research In Motion Limited. + * Copyright (c) 2012-2014 BlackBerry Limited. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/BESSafeTcp/src/BESSafeTcp.hpp b/BESSafeTcp/src/BESSafeTcp.hpp index 96072ab..3358cce 100644 --- a/BESSafeTcp/src/BESSafeTcp.hpp +++ b/BESSafeTcp/src/BESSafeTcp.hpp @@ -1,13 +1,5 @@ -// Default empty project template -#ifndef BESSafeTcp_HPP_ -#define BESSafeTcp_HPP_ - -#include - -#include - /* - * Copyright (c) 2012-2014 Research In Motion Limited. + * Copyright (c) 2012-2014 BlackBerry Limited. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +14,13 @@ * limitations under the License. */ +#ifndef BESSafeTcp_HPP_ +#define BESSafeTcp_HPP_ + +#include + +#include + namespace bb { namespace cascades { class Application; }} using namespace bb::cascades; diff --git a/BESSafeTcp/src/curllConnectThread.cpp b/BESSafeTcp/src/curlConnectThread.cpp similarity index 81% rename from BESSafeTcp/src/curllConnectThread.cpp rename to BESSafeTcp/src/curlConnectThread.cpp index 711d82b..2ede4e1 100644 --- a/BESSafeTcp/src/curllConnectThread.cpp +++ b/BESSafeTcp/src/curlConnectThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2012 Research In Motion Limited. + * Copyright (c) 2012-2014 BlackBerry Limited. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,22 +24,6 @@ #include #include -/* - * Copyright (c) 2012-2014 Research In Motion Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream) { qDebug() << (QString(QByteArray((char *)ptr, size*nmemb)).append("\n")); diff --git a/BESSafeTcp/src/curlConnectThread.hpp b/BESSafeTcp/src/curlConnectThread.hpp index a3c5c1e..06773cd 100644 --- a/BESSafeTcp/src/curlConnectThread.hpp +++ b/BESSafeTcp/src/curlConnectThread.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 Research In Motion Limited. + * Copyright (c) 2012-2014 BlackBerry Limited. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/BESSafeTcp/src/main.cpp b/BESSafeTcp/src/main.cpp index ee6cf73..21c9f87 100644 --- a/BESSafeTcp/src/main.cpp +++ b/BESSafeTcp/src/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 Research In Motion Limited. + * Copyright (c) 2012-2014 BlackBerry Limited. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/BESSafeTcp/src/sslSocketThread.cpp b/BESSafeTcp/src/sslSocketThread.cpp index fecf926..618674d 100644 --- a/BESSafeTcp/src/sslSocketThread.cpp +++ b/BESSafeTcp/src/sslSocketThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 Research In Motion Limited. + * Copyright (c) 2012-2014 BlackBerry Limited. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/BESSafeTcp/src/sslSocketThread.hpp b/BESSafeTcp/src/sslSocketThread.hpp index 0bbe02d..e71d1a6 100644 --- a/BESSafeTcp/src/sslSocketThread.hpp +++ b/BESSafeTcp/src/sslSocketThread.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 Research In Motion Limited. + * Copyright (c) 2012-2014 BlackBerry Limited. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/BESSafeTcp/src/tcpSocketThread.cpp b/BESSafeTcp/src/tcpSocketThread.cpp index 713499a..f62ec46 100644 --- a/BESSafeTcp/src/tcpSocketThread.cpp +++ b/BESSafeTcp/src/tcpSocketThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 Research In Motion Limited. + * Copyright (c) 2012-2014 BlackBerry Limited. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,9 +51,10 @@ TCPSocketThread::~TCPSocketThread() { void TCPSocketThread::run() { - const char* hostName = "developer.blackberry.com"; // The host that you're connecting to + const char* hostName = "developer.blackberry.com"; // The host that you're connecting to + const int port = 80; - const char *httpRequest = "GET / HTTP/1.1\r\nHost: developer.blackberry.com\r\n\r\n"; + const char *httpRequest = "GET / HTTP/1.1\r\nHost: developer.blackberry.com\r\n\r\n"; unsigned int bytesRead = 0, bytesWritten = 0; int error, responseCount = 0; static fd_set write_handles; diff --git a/BESSafeTcp/src/tcpSocketThread.hpp b/BESSafeTcp/src/tcpSocketThread.hpp index 9d30358..32cba69 100644 --- a/BESSafeTcp/src/tcpSocketThread.hpp +++ b/BESSafeTcp/src/tcpSocketThread.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 Research In Motion Limited. + * Copyright (c) 2012-2014 BlackBerry Limited. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/BESSafeTcp/translations/BESSafeTcp.ts b/BESSafeTcp/translations/BESSafeTcp.ts index fd108aa..8166f7f 100644 --- a/BESSafeTcp/translations/BESSafeTcp.ts +++ b/BESSafeTcp/translations/BESSafeTcp.ts @@ -9,7 +9,7 @@ - + Hello BESSafeTcp