diff -Nru pushpin-1.34.0/debian/changelog pushpin-1.34.0/debian/changelog --- pushpin-1.34.0/debian/changelog 2021-12-08 15:31:12.000000000 +0000 +++ pushpin-1.34.0/debian/changelog 2021-12-10 16:43:13.000000000 +0000 @@ -1,3 +1,10 @@ +pushpin (1.34.0-2) unstable; urgency=medium + + * Actually use new upstream + (1.34.0-1 actually was 1.33.0) + + -- Jan Niehusmann Fri, 10 Dec 2021 17:43:13 +0100 + pushpin (1.34.0-1) unstable; urgency=medium * New upstream release diff -Nru pushpin-1.34.0/debian/patches/debian-changes pushpin-1.34.0/debian/patches/debian-changes --- pushpin-1.34.0/debian/patches/debian-changes 2021-12-08 15:31:12.000000000 +0000 +++ pushpin-1.34.0/debian/patches/debian-changes 2021-12-10 16:43:13.000000000 +0000 @@ -4,34 +4,8 @@ Option single-debian-patch is used as the changes are tracked in git. ---- pushpin-1.34.0.orig/CHANGELOG.md -+++ pushpin-1.34.0/CHANGELOG.md -@@ -1,15 +1,6 @@ - Pushpin Changelog - ================= - --v. 1.34.0 (2021-11-30) -- -- * New config option: message_wait. -- * Publish command for publishing via command socket. -- --v. 1.33.1 (2021-08-09) -- -- * Build system fixes. -- - v. 1.33.0 (2021-08-08) - - * Performance optimizations. --- pushpin-1.34.0.orig/Cargo.toml +++ pushpin-1.34.0/Cargo.toml -@@ -1,6 +1,6 @@ - [package] - name = "pushpin" --version = "1.34.0" -+version = "1.33.0" - authors = ["Justin Karneges "] - edition = "2018" - @@ -11,16 +11,16 @@ panic = "abort" panic = "abort" @@ -53,109 +27,6 @@ zmq = "0.9" [lib] ---- pushpin-1.34.0.orig/README.md -+++ pushpin-1.34.0/README.md -@@ -3,14 +3,14 @@ - Website: https://pushpin.org/ - Chat Room: [![Join the chat at https://gitter.im/fanout/pushpin](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/fanout/pushpin?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - --Pushpin is a reverse proxy server written in C++ and Rust that makes it easy to implement WebSocket, HTTP streaming, and HTTP long-polling services. The project is unique among realtime push solutions in that it is designed to address the needs of API creators. Pushpin is transparent to clients and integrates easily into an API stack. -+Pushpin is a reverse proxy server written in C++ that makes it easy to implement WebSocket, HTTP streaming, and HTTP long-polling services. The project is unique among realtime push solutions in that it is designed to address the needs of API creators. Pushpin is transparent to clients and integrates easily into an API stack. - - ## How it works - - Pushpin is placed in the network path between the backend and any clients: - -

-- pushpin-abstract -+ pushpin-abstract -

- - Pushpin communicates with backend web applications using regular, short-lived HTTP requests. This allows backend applications to be written in any language and use any webserver. There are two main integration points: -@@ -18,7 +18,7 @@ Pushpin communicates with backend web ap - 1. The backend must handle proxied requests. For HTTP, each incoming request is proxied to the backend. For WebSockets, the activity of each connection is translated into a series of HTTP requests[1](#proxy-modes) sent to the backend. Pushpin's behavior is determined by how the backend responds to these requests. - 2. The backend must tell Pushpin to push data. Regardless of how clients are connected, data may be pushed to them by making an HTTP POST request to Pushpin's private control API (`http://localhost:5561/publish/` by default). Pushpin will inject this data into any client connections as necessary. - --To assist with integration, there are [libraries](https://pushpin.org/docs/usage/#libraries) for many backend languages and frameworks. Pushpin has no libraries on the client side because it is transparent to clients. -+To assist with integration, there are [libraries](http://pushpin.org/docs/usage/#libraries) for many backend languages and frameworks. Pushpin has no libraries on the client side because it is transparent to clients. - - ## Example - -@@ -57,11 +57,11 @@ curl -d '{ "items": [ { "channel": "test - - The client would then see the line "hello there" appended to the response stream. Ta-da, transparent realtime push! - --For more details, see the [HTTP streaming](https://pushpin.org/docs/usage/#http-streaming) section of the documentation. Pushpin also supports [HTTP long-polling](https://pushpin.org/docs/usage/#http-long-polling) and [WebSockets](https://pushpin.org/docs/usage/#websockets). -+For more details, see the [HTTP streaming](http://pushpin.org/docs/usage/#http-streaming) section of the documentation. Pushpin also supports [HTTP long-polling](http://pushpin.org/docs/usage/#http-long-polling) and [WebSockets](http://pushpin.org/docs/usage/#websockets). - - ## Example using a library - --Using a library on the backend makes integration is even easier. Here's another HTTP streaming example, similar to the one shown above, except using Pushpin's [Django library](https://github.com/fanout/django-grip). Please note that Pushpin is not Python/Django-specific and there are backend libraries for [other languages/frameworks, too](https://pushpin.org/docs/usage/#libraries). -+Using a library on the backend makes integration is even easier. Here's another HTTP streaming example, similar to the one shown above, except using Pushpin's [Django library](https://github.com/fanout/django-grip). Please note that Pushpin is not Python/Django-specific and there are backend libraries for [other languages/frameworks, too](http://pushpin.org/docs/usage/#libraries). - - The Django library requires configuration in `settings.py`: - ```python -@@ -98,7 +98,7 @@ publish('test', HttpStreamFormat('hello - - ## Example using WebSockets - --Pushpin supports WebSockets by converting connection activity/messages into HTTP requests and sending them to the backend. For this example, we'll use Pushpin's [Express library](https://github.com/fanout/express-grip). As before, please note that Pushpin is not Node/Express-specific and there are backend libraries for [other languages/frameworks, too](https://pushpin.org/docs/usage/#libraries). -+Pushpin supports WebSockets by converting connection activity/messages into HTTP requests and sending them to the backend. For this example, we'll use Pushpin's [Express library](https://github.com/fanout/express-grip). As before, please note that Pushpin is not Node/Express-specific and there are backend libraries for [other languages/frameworks, too](http://pushpin.org/docs/usage/#libraries). - - The Express library requires configuration and setting up middleware handlers before and after any endpoints: - ```javascript -@@ -164,7 +164,7 @@ What's particularly noteworthy is that t - - The `while` loop is deceptive. It looks like it's looping for the lifetime of the WebSocket connection, but what it's really doing is looping through a batch of WebSocket messages that was just received via HTTP. Often this will be one message, and so the loop performs one iteration and then exits. Similarly, the `ws` object only exists for the duration of the handler invocation, rather than for the lifetime of the connection as you might expect. It may look like socket code, but it's all an illusion. :tophat: - --For details on the underlying protocol conversion, see the [WebSocket-Over-HTTP Protocol spec](https://pushpin.org/docs/protocols/websocket-over-http/). -+For details on the underlying protocol conversion, see the [WebSocket-Over-HTTP Protocol spec](http://pushpin.org/docs/protocols/websocket-over-http/). - - ## Example without a webserver - -@@ -223,9 +223,25 @@ On a practical level, there are many ben - - ## Install - --Check out the [the Install guide](https://pushpin.org/docs/install/), which covers how to install and run. There are packages available for Linux (Debian, Ubuntu, CentOS, Red Hat), Mac (Homebrew), or you can build from source. -+Check out the [the Install guide](http://pushpin.org/docs/install/), which covers how to install and run. There are packages available for Debian/Ubuntu and Homebrew (Mac), or you can build from source. - --By default, Pushpin listens on port 7999 and requests are handled by its internal test handler. You can confirm the server is working by browsing to `http://localhost:7999/`. Next, you should modify the `routes` config file to route requests to your backend webserver. See [Configuration](https://pushpin.org/docs/configuration/). -+If you want to build the git version and have the dependencies installed already, then below are brief build instructions: -+ -+``` -+# pull submodules -+git submodule init && git submodule update -+ -+# build -+./configure --qtselect=5 && make -+ -+# copy default config -+cp -r examples/config . -+ -+# run! -+./pushpin -+``` -+ -+By default, Pushpin listens on port 7999 and requests are handled by its internal test handler. You can confirm the server is working by browsing to `http://localhost:7999/`. Next, you should modify the `routes` config file to route requests to your backend webserver. See [Configuration](http://pushpin.org/docs/configuration/). - - ## Scalability - -@@ -233,7 +249,7 @@ Pushpin is horizontally scalable. Instan - - Optionally, ZeroMQ PUB/SUB can be used to send data to Pushpin instead of using HTTP POST. When this method is used, subscription information is forwarded to each publisher, such that data will only be published to instances that have listeners. - --As for vertical scalability, Pushpin has been tested with up to [1 million concurrent connections](https://github.com/fanout/pushpin-c1m) running on a single DigitalOcean droplet with 8 CPU cores. In practice, you may want to plan for fewer connections per instance, depending on your throughput. The new connection accept rate is about 800/sec (though this also depends on the speed of your backend), and the message throughput is about 8,000/sec. The important thing is that Pushpin is horizontally scalable which is effectively limitless. -+As for vertical scalability, Pushpin has been tested reliably with 10,000 concurrent connections running on a single Amazon EC2 m3.xlarge instance. 20,000 connections and beyond are possible with some latency degradation. We definitely want to increase this number, but the important thing is that Pushpin is horizontally scalable which is effectively limitless. - - ## What does the name mean? - -@@ -247,4 +263,4 @@ Pushpin is offered under the GNU AGPL. S - - 1: Pushpin can communicate WebSocket activity to the backend using either HTTP or WebSockets. Conversion to HTTP is generally recommended as it makes the backend easier to reason about. - --2: GRIP (Generic Realtime Intermediary Protocol) is the name of Pushpin's backend protocol. More about that [here](https://pushpin.org/docs/protocols/grip/). -+2: GRIP (Generic Realtime Intermediary Protocol) is the name of Pushpin's backend protocol. More about that [here](http://pushpin.org/docs/protocols/grip/). --- pushpin-1.34.0.orig/examples/config/pushpin.conf +++ pushpin-1.34.0/examples/config/pushpin.conf @@ -16,7 +16,7 @@ stats_connection_ttl=120 @@ -180,16 +51,6 @@ # use this field to identify your organization in updates requests. if left # blank, updates requests will be anonymous -@@ -137,9 +141,6 @@ message_hwm=25000 - # set to report blocks counts in stats (content size / block size) - #message_block_size= - --# max time (milliseconds) for out-of-order messages to wait --message_wait=5000 -- - # time (seconds) to cache message ids - id_cache_ttl=60 - --- /dev/null +++ pushpin-1.34.0/header.AGPL @@ -0,0 +1,19 @@ @@ -212,328 +73,6 @@ + * contained in a written agreement between you and Fanout. For further + * information use the contact form at . + * ---- pushpin-1.34.0.orig/src/corelib/packet/zrpcresponsepacket.cpp -+++ pushpin-1.34.0/src/corelib/packet/zrpcresponsepacket.cpp -@@ -39,22 +39,13 @@ QVariant ZrpcResponsePacket::toVariant() - - if(success) - { -- if(value.type() == QVariant::String) -- obj["value"] = value.toString().toUtf8(); -- else -- obj["value"] = value; -+ obj["value"] = value; - } - else - { - obj["condition"] = condition; -- - if(value.isValid()) -- { -- if(value.type() == QVariant::String) -- obj["value"] = value.toString().toUtf8(); -- else -- obj["value"] = value; -- } -+ obj["value"] = value; - } - - return obj; ---- pushpin-1.34.0.orig/src/corelib/zhttpmanager.cpp -+++ pushpin-1.34.0/src/corelib/zhttpmanager.cpp -@@ -557,7 +557,17 @@ public slots: - continue; - } - -- log_debug("zhttp/zws client: received message for unknown request id, skipping"); -+ log_debug("zhttp/zws client: received message for unknown request id, canceling"); -+ -+ // if this was not an error packet, send cancel -+ if(p.type != ZhttpResponsePacket::Error && p.type != ZhttpResponsePacket::Cancel && !p.from.isEmpty()) -+ { -+ ZhttpRequestPacket out; -+ out.from = instanceId; -+ out.ids += ZhttpRequestPacket::Id(id.id); -+ out.type = ZhttpRequestPacket::Cancel; -+ write(UnknownSession, out, p.from); -+ } - } - } - -@@ -786,7 +796,17 @@ public slots: - continue; - } - -- log_debug("zhttp/zws server: received message for unknown request id, skipping"); -+ log_debug("zhttp/zws server: received message for unknown request id, canceling"); -+ -+ // if this was not an error packet, send cancel -+ if(p.type != ZhttpRequestPacket::Error && p.type != ZhttpRequestPacket::Cancel && !p.from.isEmpty()) -+ { -+ ZhttpResponsePacket out; -+ out.from = instanceId; -+ out.ids += ZhttpResponsePacket::Id(id.id); -+ out.type = ZhttpResponsePacket::Cancel; -+ write(UnknownSession, out, p.from); -+ } - } - } - ---- pushpin-1.34.0.orig/src/corelib/zhttprequest.cpp -+++ pushpin-1.34.0/src/corelib/zhttprequest.cpp -@@ -1106,6 +1106,8 @@ public slots: - - void expire_timeout() - { -+ tryCancel(); -+ - state = Stopped; - errored = true; - errorCondition = ErrorTimeout; ---- pushpin-1.34.0.orig/src/corelib/zwebsocket.cpp -+++ pushpin-1.34.0/src/corelib/zwebsocket.cpp -@@ -1054,6 +1054,8 @@ public slots: - - void expire_timeout() - { -+ tryCancel(); -+ - state = Idle; - errorCondition = ErrorTimeout; - cleanup(); ---- pushpin-1.34.0.orig/src/handler/app.cpp -+++ pushpin-1.34.0/src/handler/app.cpp -@@ -278,7 +278,6 @@ public: - int messageRate = settings.value("handler/message_rate", -1).toInt(); - int messageHwm = settings.value("handler/message_hwm", -1).toInt(); - int messageBlockSize = settings.value("handler/message_block_size", -1).toInt(); -- int messageWait = settings.value("handler/message_wait", 5000).toInt(); - int idCacheTtl = settings.value("handler/id_cache_ttl", 0).toInt(); - int clientMaxconn = settings.value("runner/client_maxconn", 50000).toInt(); - int connectionSubscriptionMax = settings.value("handler/connection_subscription_max", 20).toInt(); -@@ -340,7 +339,6 @@ public: - config.messageRate = messageRate; - config.messageHwm = messageHwm; - config.messageBlockSize = messageBlockSize; -- config.messageWait = messageWait; - config.idCacheTtl = idCacheTtl; - config.connectionsMax = clientMaxconn; - config.connectionSubscriptionMax = connectionSubscriptionMax; ---- pushpin-1.34.0.orig/src/handler/engine.cpp -+++ pushpin-1.34.0/src/handler/engine.cpp -@@ -92,7 +92,7 @@ - - using namespace VariantUtil; - --static QList parseItems(const QVariantList &vitems, bool *ok = 0, QString *errorMessage = 0) -+static QList parseHttpItems(const QVariantList &vitems, bool *ok = 0, QString *errorMessage = 0) - { - QList out; - -@@ -1257,7 +1257,6 @@ public: - updateLimiter->setRate(10); - updateLimiter->setBatchWaitEnabled(true); - -- sequencer->setWaitMax(config.messageWait); - sequencer->setIdCacheTtl(config.idCacheTtl); - - zhttpIn = new ZhttpManager(this); -@@ -2122,42 +2121,6 @@ private slots: - connect(w, &RefreshWorker::finished, this, &Private::deferred_finished); - deferreds += w; - } -- else if(req->method() == "publish") -- { -- QVariantHash args = req->args(); -- -- if(!args.contains("items")) -- { -- req->respondError("bad-request", "Invalid format: object does not contain 'items'"); -- delete req; -- return; -- } -- -- if(args["items"].type() != QVariant::List) -- { -- req->respondError("bad-request", "Invalid format: object contains 'items' with wrong type"); -- delete req; -- return; -- } -- -- QVariantList vitems = args["items"].toList(); -- -- bool ok; -- QString errorMessage; -- QList items = parseItems(vitems, &ok, &errorMessage); -- if(!ok) -- { -- req->respondError("bad-request", QString("Invalid format: %1").arg(errorMessage)); -- delete req; -- return; -- } -- -- req->respond(); -- delete req; -- -- foreach(const PublishItem &item, items) -- handlePublishItem(item); -- } - else - { - req->respondError("method-not-found"); -@@ -2724,7 +2687,7 @@ private slots: - - bool ok; - QString errorMessage; -- QList items = parseItems(vitems, &ok, &errorMessage); -+ QList items = parseHttpItems(vitems, &ok, &errorMessage); - if(!ok) - { - httpControlRespond(req, 400, "Bad Request", QString("Invalid format: %1\n").arg(errorMessage)); ---- pushpin-1.34.0.orig/src/handler/engine.h -+++ pushpin-1.34.0/src/handler/engine.h -@@ -70,7 +70,6 @@ public: - int messageRate; - int messageHwm; - int messageBlockSize; -- int messageWait; - int idCacheTtl; - int connectionsMax; - int connectionSubscriptionMax; -@@ -90,7 +89,6 @@ public: - messageRate(-1), - messageHwm(-1), - messageBlockSize(-1), -- messageWait(-1), - idCacheTtl(-1), - connectionsMax(-1), - connectionSubscriptionMax(-1), ---- pushpin-1.34.0.orig/src/handler/libpushpin-handler/libpushpin-handler.pro -+++ pushpin-1.34.0/src/handler/libpushpin-handler/libpushpin-handler.pro -@@ -13,5 +13,13 @@ LIBS += -L$$PWD/../../corelib -lpushpin- - PRE_TARGETDEPS += $$PWD/../../corelib/libpushpin-core.a - - include($$OUT_PWD/../../../conf.pri) --include($$OUT_PWD/../../rust/lib.pri) -+ -+CONFIG(debug) { -+ LIBS += -L$$PWD/../../../target/debug -lpushpin -ldl -+ PRE_TARGETDEPS += $$PWD/../../../target/debug/libpushpin.a -+} else { -+ LIBS += -L$$PWD/../../../target/release -lpushpin -ldl -+ PRE_TARGETDEPS += $$PWD/../../../target/release/libpushpin.a -+} -+ - include(libpushpin-handler.pri) ---- pushpin-1.34.0.orig/src/handler/pushpin-handler/pushpin-handler.pro -+++ pushpin-1.34.0/src/handler/pushpin-handler/pushpin-handler.pro -@@ -14,7 +14,15 @@ LIBS += -L$$PWD/../../corelib -lpushpin- - PRE_TARGETDEPS += $$PWD/../../corelib/libpushpin-core.a - - include($$OUT_PWD/../../../conf.pri) --include($$OUT_PWD/../../rust/lib.pri) -+ -+CONFIG(debug) { -+ LIBS += -L$$PWD/../../../target/debug -lpushpin -ldl -+ PRE_TARGETDEPS += $$PWD/../../../target/debug/libpushpin.a -+} else { -+ LIBS += -L$$PWD/../../../target/release -lpushpin -ldl -+ PRE_TARGETDEPS += $$PWD/../../../target/release/libpushpin.a -+} -+ - include(pushpin-handler.pri) - - unix:!isEmpty(BINDIR) { ---- pushpin-1.34.0.orig/src/handler/sequencer.cpp -+++ pushpin-1.34.0/src/handler/sequencer.cpp -@@ -1,5 +1,5 @@ - /* -- * Copyright (C) 2016-2021 Fanout, Inc. -+ * Copyright (C) 2016-2017 Fanout, Inc. - * - * This file is part of Pushpin. - * -@@ -35,7 +35,7 @@ - #include "publishlastids.h" - - #define CHANNEL_PENDING_MAX 100 --#define DEFAULT_PENDING_EXPIRE 5000 -+#define PENDING_EXPIRE 5000 - #define EXPIRE_INTERVAL 1000 - - class Sequencer::Private : public QObject -@@ -74,7 +74,6 @@ public: - QHash pendingItemsByChannel; - QMap, PendingItem*> pendingItemsByTime; - QTimer *expireTimer; -- int pendingExpireMSecs; - int idCacheTtl; - QHash, CachedId*> idCacheById; - QMap, CachedId*> idCacheByExpireTime; -@@ -83,7 +82,6 @@ public: - QObject(_q), - q(_q), - lastIds(_publishLastIds), -- pendingExpireMSecs(DEFAULT_PENDING_EXPIRE), - idCacheTtl(-1) - { - expireTimer = new QTimer(this); -@@ -239,7 +237,7 @@ private slots: - void expireTimer_timeout() - { - qint64 now = QDateTime::currentMSecsSinceEpoch(); -- qint64 threshold = now - pendingExpireMSecs; -+ qint64 threshold = now - PENDING_EXPIRE; - - while(!pendingItemsByTime.isEmpty()) - { -@@ -281,11 +279,6 @@ Sequencer::~Sequencer() - delete d; - } - --void Sequencer::setWaitMax(int msecs) --{ -- d->pendingExpireMSecs = msecs; --} -- - void Sequencer::setIdCacheTtl(int secs) - { - d->idCacheTtl = secs; ---- pushpin-1.34.0.orig/src/handler/sequencer.h -+++ pushpin-1.34.0/src/handler/sequencer.h -@@ -1,5 +1,5 @@ - /* -- * Copyright (C) 2016-2021 Fanout, Inc. -+ * Copyright (C) 2016-2017 Fanout, Inc. - * - * This file is part of Pushpin. - * -@@ -42,7 +42,6 @@ public: - Sequencer(PublishLastIds *publishLastIds, QObject *parent = 0); - ~Sequencer(); - -- void setWaitMax(int msecs); - void setIdCacheTtl(int secs); - - // seq = false means ID cache handling only ---- pushpin-1.34.0.orig/src/handler/tests/tests.pri -+++ pushpin-1.34.0/src/handler/tests/tests.pri -@@ -16,7 +16,14 @@ LIBS += -L$$PWD/../../corelib -lpushpin- - PRE_TARGETDEPS += $$PWD/../../corelib/libpushpin-core.a - - include($$PWD/../../../conf.pri) --include($$PWD/../../rust/lib.pri) -+ -+CONFIG(debug) { -+ LIBS += -L$$PWD/../../../target/debug -lpushpin -ldl -+ PRE_TARGETDEPS += $$PWD/../../../target/debug/libpushpin.a -+} else { -+ LIBS += -L$$PWD/../../../target/release -lpushpin -ldl -+ PRE_TARGETDEPS += $$PWD/../../../target/release/libpushpin.a -+} - - INCLUDEPATH += $$SRC_DIR - INCLUDEPATH += $$CORE_DIR --- pushpin-1.34.0.orig/src/proxy/app.cpp +++ pushpin-1.34.0/src/proxy/app.cpp @@ -310,7 +310,7 @@ public: @@ -545,60 +84,6 @@ QString organizationName = settings.value("proxy/organization_name").toString(); int clientMaxconn = settings.value("runner/client_maxconn", 50000).toInt(); int statsConnectionTtl = settings.value("global/stats_connection_ttl", 120).toInt(); ---- pushpin-1.34.0.orig/src/proxy/libpushpin-proxy/libpushpin-proxy.pro -+++ pushpin-1.34.0/src/proxy/libpushpin-proxy/libpushpin-proxy.pro -@@ -13,5 +13,13 @@ LIBS += -L$$PWD/../../corelib -lpushpin- - PRE_TARGETDEPS += $$PWD/../../corelib/libpushpin-core.a - - include($$OUT_PWD/../../../conf.pri) --include($$OUT_PWD/../../rust/lib.pri) -+ -+CONFIG(debug) { -+ LIBS += -L$$PWD/../../../target/debug -lpushpin -ldl -+ PRE_TARGETDEPS += $$PWD/../../../target/debug/libpushpin.a -+} else { -+ LIBS += -L$$PWD/../../../target/release -lpushpin -ldl -+ PRE_TARGETDEPS += $$PWD/../../../target/release/libpushpin.a -+} -+ - include(libpushpin-proxy.pri) ---- pushpin-1.34.0.orig/src/proxy/pushpin-proxy/pushpin-proxy.pro -+++ pushpin-1.34.0/src/proxy/pushpin-proxy/pushpin-proxy.pro -@@ -15,7 +15,15 @@ LIBS += -L$$PWD/../../corelib -lpushpin- - PRE_TARGETDEPS += $$PWD/../../corelib/libpushpin-core.a - - include($$OUT_PWD/../../../conf.pri) --include($$OUT_PWD/../../rust/lib.pri) -+ -+CONFIG(debug) { -+ LIBS += -L$$PWD/../../../target/debug -lpushpin -ldl -+ PRE_TARGETDEPS += $$PWD/../../../target/debug/libpushpin.a -+} else { -+ LIBS += -L$$PWD/../../../target/release -lpushpin -ldl -+ PRE_TARGETDEPS += $$PWD/../../../target/release/libpushpin.a -+} -+ - include(pushpin-proxy.pri) - - unix:!isEmpty(BINDIR) { ---- pushpin-1.34.0.orig/src/proxy/tests/tests.pri -+++ pushpin-1.34.0/src/proxy/tests/tests.pri -@@ -16,7 +16,14 @@ LIBS += -L$$PWD/../../corelib -lpushpin- - PRE_TARGETDEPS += $$PWD/../../corelib/libpushpin-core.a - - include($$PWD/../../../conf.pri) --include($$PWD/../../rust/lib.pri) -+ -+CONFIG(debug) { -+ LIBS += -L$$PWD/../../../target/debug -lpushpin -ldl -+ PRE_TARGETDEPS += $$PWD/../../../target/debug/libpushpin.a -+} else { -+ LIBS += -L$$PWD/../../../target/release -lpushpin -ldl -+ PRE_TARGETDEPS += $$PWD/../../../target/release/libpushpin.a -+} - - INCLUDEPATH += $$SRC_DIR - INCLUDEPATH += $$CORE_DIR --- pushpin-1.34.0.orig/src/publish_cli.rs +++ pushpin-1.34.0/src/publish_cli.rs @@ -34,7 +34,7 @@ use std::io; @@ -658,149 +143,3 @@ # bind DEALER for requesting inspection info (internal, used with handler) handler_inspect_spec=ipc://{rundir}/{ipc_prefix}inspect ---- pushpin-1.34.0.orig/src/rust/rust.pro -+++ pushpin-1.34.0/src/rust/rust.pro -@@ -8,7 +8,7 @@ include($$OUT_PWD/../../conf.pri) - bin_dir = $$PWD/../../bin - root_dir = $$PWD/../.. - --CONFIG(debug, debug|release) { -+CONFIG(debug) { - cargo_flags = - target_dir = $$PWD/../../target/debug - } else { ---- pushpin-1.34.0.orig/tools/command.py -+++ pushpin-1.34.0/tools/command.py -@@ -5,49 +5,39 @@ import tnetstring - import zmq - - def make_tnet_compat(obj): -- if isinstance(obj, dict): -- out = {} -- for k, v in obj.items(): -- out[make_tnet_compat(k)] = make_tnet_compat(v) -- return out -- elif isinstance(obj, list): -- out = list() -- for v in obj: -- out.append(make_tnet_compat(v)) -- return out -- elif isinstance(obj, str): -- return obj.encode('utf-8') -- else: -- return obj -+ if isinstance(obj, dict): -+ out = dict() -+ for k, v in obj.iteritems(): -+ out[make_tnet_compat(k)] = make_tnet_compat(v) -+ return out -+ elif isinstance(obj, list): -+ out = list() -+ for v in obj: -+ out.append(make_tnet_compat(v)) -+ return out -+ elif isinstance(obj, unicode): -+ return obj.encode('utf-8') -+ else: -+ return obj - - ctx = zmq.Context() - sock = ctx.socket(zmq.REQ) - sock.connect(sys.argv[1]) - --method = sys.argv[2] -- -+req = dict() -+req['id'] = str(uuid.uuid4()) -+req['method'] = sys.argv[2] - if len(sys.argv) > 3: -- args = json.loads(sys.argv[3]) -- assert(isinstance(args, dict)) -+ args = json.loads(sys.argv[3]) -+ assert(isinstance(args, dict)) -+ req['args'] = make_tnet_compat(args) - else: -- args = {} -- --print('calling {}: args={}'.format(method, repr(args))) -- --req = { -- b'id': str(uuid.uuid4()).encode('utf-8'), -- b'method': method.encode('utf-8'), -- b'args': make_tnet_compat(args) --} -- -+ req['args'] = dict() -+print 'calling %s: args=%s' % (req['method'], req['args']) - sock.send(tnetstring.dumps(req)) - - resp = tnetstring.loads(sock.recv()) -- --if resp[b'success']: -- value = resp[b'value'] -- print('success: {}'.format(repr(value))) -+if resp['success']: -+ print 'success: %s' % resp['value'] - else: -- condition = resp[b'condition'].decode('utf-8') -- value = resp.get(b'value') -- print('error: {} {}'.format(condition, repr(value))) -+ print 'error: %s' % resp['condition'] ---- pushpin-1.34.0.orig/tools/monitorstats.py -+++ pushpin-1.34.0/tools/monitorstats.py -@@ -3,41 +3,25 @@ import json - import tnetstring - import zmq - --def ensure_str(i): -- if isinstance(i, dict): -- out = {} -- for k, v in i.items(): -- out[ensure_str(k)] = ensure_str(v) -- return out -- elif isinstance(i, list): -- out = [] -- for v in i: -- out.append(ensure_str(v)) -- return out -- elif isinstance(i, bytes): -- return i.decode('utf-8') -- else: -- return i -- - ctx = zmq.Context() - sock = ctx.socket(zmq.SUB) - sock.connect(sys.argv[1]) - - if len(sys.argv) >= 3: -- for mtype in sys.argv[2].split(','): -- sock.setsockopt(zmq.SUBSCRIBE, '{} '.format(mtype).encode('utf-8')) -+ for mtype in sys.argv[2].split(','): -+ sock.setsockopt(zmq.SUBSCRIBE, '{} '.format(mtype)) - else: -- sock.setsockopt(zmq.SUBSCRIBE, b'') -+ sock.setsockopt(zmq.SUBSCRIBE, '') - - while True: -- m_raw = sock.recv() -- at = m_raw.find(b' ') -- mtype = ensure_str(m_raw[:at]) -- mdata = m_raw[at + 1:] -- if mdata[0] == ord(b'T'): -- m = ensure_str(tnetstring.loads(mdata[1:])) -- elif mdata[0] == ord(b'J'): -- m = json.loads(mdata[1:]) -- else: -- m = mdata -- print('{} {}'.format(mtype, m)) -+ m_raw = sock.recv() -+ at = m_raw.find(' ') -+ mtype = m_raw[:at] -+ mdata = m_raw[at + 1:] -+ if mdata[0] == 'T': -+ m = tnetstring.loads(mdata[1:]) -+ elif mdata[0] == 'J': -+ m = json.loads(mdata[1:]) -+ else: -+ m = mdata -+ print '%s %s' % (mtype, m)