ext/common/ServerKit/FdSourceChannel.h in passenger-5.0.1 vs ext/common/ServerKit/FdSourceChannel.h in passenger-5.0.2

- old
+ new

@@ -1,8 +1,8 @@ /* * Phusion Passenger - https://www.phusionpassenger.com/ - * Copyright (c) 2014 Phusion + * Copyright (c) 2014-2015 Phusion * * "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -31,10 +31,11 @@ #include <unistd.h> #include <ev.h> #include <MemoryKit/mbuf.h> #include <ServerKit/Context.h> #include <ServerKit/Channel.h> +#include <Utils/json.h> namespace Passenger { namespace ServerKit { using namespace oxt; @@ -228,9 +229,16 @@ } OXT_FORCE_INLINE void setHooks(Hooks *hooks) { this->hooks = hooks; + } + + Json::Value inspectAsJson() const { + Json::Value doc = Channel::inspectAsJson(); + doc["initialized"] = watcher.fd != -1; + doc["io_watcher_active"] = (bool) watcher.active; + return doc; } }; } // namespace ServerKit