hrev47049 adds 3 changesets to branch 'master' old head: d7f7bf2d890f652e20b8cf34e9b4c6ae1d3e20eb new head: 7f0d550a7c96c4a8b74326f37ea9427a6edb48f5 overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=7f0d550+%5Ed7f7bf2 ---------------------------------------------------------------------------- b25fb3d: Add a few extensions to transport stream MIME type f9ed97e: HaikuDepot: Test app for haiku-depot-web connection * Just a playground for getting my feet wet with communicating with the web-app. For now only connects over HTTP. 7f0d550: HaikuDepot: Forgot to add the new files. [ Stephan Aßmus <superstippi@xxxxxx> ] ---------------------------------------------------------------------------- 4 files changed, 140 insertions(+) src/apps/haikudepot/ConnectionTest.cpp | 109 +++++++++++++++++++++++++++++ src/apps/haikudepot/ConnectionTest.h | 21 ++++++ src/apps/haikudepot/Jamfile | 6 ++ src/data/mime_db/video/mp2t | 4 ++ ############################################################################ Commit: b25fb3d559af017b3a11df8ce088a35f422000a3 URL: http://cgit.haiku-os.org/haiku/commit/?id=b25fb3d Author: Stephan Aßmus <superstippi@xxxxxx> Date: Mon Mar 24 21:01:33 2014 UTC Add a few extensions to transport stream MIME type ---------------------------------------------------------------------------- diff --git a/src/data/mime_db/video/mp2t b/src/data/mime_db/video/mp2t index 370da3a..f20143d 100644 --- a/src/data/mime_db/video/mp2t +++ b/src/data/mime_db/video/mp2t @@ -7,5 +7,9 @@ resource(3, "META:S:DESC") #'MSDC' "MPEG-2 transport stream"; resource(4, "META:EXTENS") message(234) { "extensions" = "ts", + "extensions" = "TS", + "extensions" = "mts", + "extensions" = "MTS", + "extensions" = "m2ts", "type" = "video/mp2t" }; ############################################################################ Commit: f9ed97eaee3450409be23eb4d9d8468221b66b00 URL: http://cgit.haiku-os.org/haiku/commit/?id=f9ed97e Author: Stephan Aßmus <superstippi@xxxxxx> Date: Mon Mar 24 22:34:07 2014 UTC HaikuDepot: Test app for haiku-depot-web connection * Just a playground for getting my feet wet with communicating with the web-app. For now only connects over HTTP. ---------------------------------------------------------------------------- diff --git a/src/apps/haikudepot/Jamfile b/src/apps/haikudepot/Jamfile index 36b2dee..9ac8a9d 100644 --- a/src/apps/haikudepot/Jamfile +++ b/src/apps/haikudepot/Jamfile @@ -85,3 +85,9 @@ Application TextDocumentTest : : be translation libshared.a $(TARGET_LIBSUPC++) ; + +Application ConnectionTest : + ConnectionTest.cpp + + : be netapi translation libshared.a $(TARGET_LIBSUPC++) +; ############################################################################ Revision: hrev47049 Commit: 7f0d550a7c96c4a8b74326f37ea9427a6edb48f5 URL: http://cgit.haiku-os.org/haiku/commit/?id=7f0d550 Author: Stephan Aßmus <superstippi@xxxxxx> Date: Mon Mar 24 22:37:40 2014 UTC HaikuDepot: Forgot to add the new files. ---------------------------------------------------------------------------- diff --git a/src/apps/haikudepot/ConnectionTest.cpp b/src/apps/haikudepot/ConnectionTest.cpp new file mode 100644 index 0000000..9c95fa8 --- /dev/null +++ b/src/apps/haikudepot/ConnectionTest.cpp @@ -0,0 +1,109 @@ +/* + * Copyright 2014, Stephan Aßmus <superstippi@xxxxxx>. + * All rights reserved. Distributed under the terms of the MIT License. + */ + +#include "ConnectionTest.h" + +#include <stdio.h> + +#include <HttpRequest.h> +#include <Url.h> +#include <UrlContext.h> +#include <UrlProtocolListener.h> +#include <UrlProtocolRoster.h> + + +class ProtocolListener : public BUrlProtocolListener { + virtual void ConnectionOpened(BUrlRequest* caller) + { + printf("ConnectionOpened(%p)\n", caller); + } + + virtual void HostnameResolved(BUrlRequest* caller, const char* ip) + { + printf("HostnameResolved(%p): %s\n", caller, ip); + } + + virtual void ResponseStarted(BUrlRequest* caller) + { + printf("ResponseStarted(%p)\n", caller); + } + + virtual void HeadersReceived(BUrlRequest* caller) + { + printf("HeadersReceived(%p)\n", caller); + } + + virtual void DataReceived(BUrlRequest* caller, const char* data, + ssize_t size) + { + printf("DataReceived(%p): %ld bytes\n", caller, size); + } + + virtual void DownloadProgress(BUrlRequest* caller, ssize_t bytesReceived, + ssize_t bytesTotal) + { + printf("DownloadProgress(%p): %ld/%ld\n", caller, bytesReceived, + bytesTotal); + } + + virtual void UploadProgress(BUrlRequest* caller, ssize_t bytesSent, + ssize_t bytesTotal) + { + printf("UploadProgress(%p): %ld/%ld\n", caller, bytesSent, bytesTotal); + } + + virtual void RequestCompleted(BUrlRequest* caller, bool success) + { + printf("RequestCompleted(%p): %d\n", caller, success); + } + + virtual void DebugMessage(BUrlRequest* caller, + BUrlProtocolDebugMessage type, const char* text) + { + printf("DebugMessage(%p): %s\n", caller, text); + } +}; + + +ConnectionTest::ConnectionTest() + : + BApplication("application/x-vnd.Haiku-HaikuDepot-ConnectionTest") +{ +} + + +ConnectionTest::~ConnectionTest() +{ +} + + +void +ConnectionTest::ReadyToRun() +{ + printf("Connecting...\n"); + + BUrl url("https://depot.haiku-os.org";); + + ProtocolListener listener; + BUrlContext context; + + BHttpRequest request(url, true, "HTTP", &listener, &context); + + + thread_id thread = request.Run(); + wait_for_thread(thread, NULL); + + PostMessage(B_QUIT_REQUESTED, this); +} + + +int +main(int argc, char* argv[]) +{ + ConnectionTest().Run(); + return 0; +} + + diff --git a/src/apps/haikudepot/ConnectionTest.h b/src/apps/haikudepot/ConnectionTest.h new file mode 100644 index 0000000..e07f6d8 --- /dev/null +++ b/src/apps/haikudepot/ConnectionTest.h @@ -0,0 +1,21 @@ +/* + * Copyright 2014, Stephan Aßmus <superstippi@xxxxxx>. + * All rights reserved. Distributed under the terms of the MIT License. + */ +#ifndef CONNECTION_TEST_H +#define CONNECTION_TEST_H + + +#include <Application.h> + + +class ConnectionTest : public BApplication { +public: + ConnectionTest(); + virtual ~ConnectionTest(); + + virtual void ReadyToRun(); +}; + + +#endif // CONNECTION_TEST_H