aboutsummaryrefslogtreecommitdiff
path: root/src/httpserver.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-08-28 16:46:20 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2015-09-03 10:59:19 +0200
commitbe33f3f50b7358bbad9e16bf730fac2ab3c4886b (patch)
tree534b59ec81e5baf95c85980013304eb31b24d0c8 /src/httpserver.h
parent57d85d9bee20edb6c3070504f23b6a2be2802654 (diff)
Implement RPCTimerHandler for Qt RPC console
Implement RPCTimerHandler for Qt RPC console, so that `walletpassphrase` works with GUI and `-server=0`. Also simplify HTTPEvent-related code by using boost::function directly.
Diffstat (limited to 'src/httpserver.h')
-rw-r--r--src/httpserver.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/httpserver.h b/src/httpserver.h
index c6a7804195..648e8b6f86 100644
--- a/src/httpserver.h
+++ b/src/httpserver.h
@@ -117,8 +117,11 @@ public:
class HTTPEvent
{
public:
- /** Create a new event */
- HTTPEvent(struct event_base* base, bool deleteWhenTriggered, HTTPClosure* handler);
+ /** Create a new event.
+ * deleteWhenTriggered deletes this event object after the event is triggered (and the handler called)
+ * handler is the handler to call when the event is triggered.
+ */
+ HTTPEvent(struct event_base* base, bool deleteWhenTriggered, const boost::function<void(void)>& handler);
~HTTPEvent();
/** Trigger the event. If tv is 0, trigger it immediately. Otherwise trigger it after
@@ -126,13 +129,10 @@ public:
*/
void trigger(struct timeval* tv);
- /** Internal function for handling, do not call directly */
- void _handle();
-
-private:
bool deleteWhenTriggered;
+ boost::function<void(void)> handler;
+private:
struct event* ev;
- boost::scoped_ptr<HTTPClosure> handler;
};
#endif // BITCOIN_HTTPSERVER_H