Fix indent trouble
This commit is contained in:
@@ -34,61 +34,57 @@ extern "C" {
|
||||
#include "notification/notification-controller.h"
|
||||
#include "notification/notification-connection.h"
|
||||
|
||||
#define kdefaultTimeout 20000
|
||||
|
||||
#define kdefaultTimeout 20000
|
||||
|
||||
/*! ----------------------------------------------------------------------------
|
||||
* @fn NotificationConnection
|
||||
*
|
||||
* @brief constructor of the notification connection object.
|
||||
*/
|
||||
NotificationConnection::NotificationConnection (struct uhttpd_ops *an_ops, struct client *a_client, NotificationController *a_controller) :
|
||||
WebConnection(an_ops, a_client),
|
||||
m_controller(a_controller),
|
||||
m_ctx(NULL)
|
||||
NotificationConnection::NotificationConnection(struct uhttpd_ops *an_ops, struct client *a_client, NotificationController *a_controller) : WebConnection(an_ops, a_client),
|
||||
m_controller(a_controller),
|
||||
m_ctx(NULL)
|
||||
{
|
||||
// printf("constructor NotificationConnection : %p\n", this);
|
||||
}
|
||||
|
||||
|
||||
/*! ----------------------------------------------------------------------------
|
||||
* @fn ~NotificationConnection
|
||||
*
|
||||
* @brief destructor of the notification controller object.
|
||||
*/
|
||||
NotificationConnection::~NotificationConnection (void)
|
||||
NotificationConnection::~NotificationConnection(void)
|
||||
{
|
||||
//printf("destructor NotificationConnection : %p\n", this);
|
||||
stop();
|
||||
if (m_ctx != NULL) {
|
||||
if (m_ctx != NULL)
|
||||
{
|
||||
unregister_event(m_ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*! ----------------------------------------------------------------------------
|
||||
* @fn invoke
|
||||
*
|
||||
* @brief invoke an async connection.
|
||||
*/
|
||||
void NotificationConnection::invoke (struct ubus_context *a_ctx)
|
||||
void NotificationConnection::invoke(struct ubus_context *a_ctx)
|
||||
{
|
||||
m_ctx = a_ctx;
|
||||
|
||||
|
||||
register_event(m_ctx, m_controller->get_path());
|
||||
|
||||
|
||||
m_ops->http_header(m_client, 200, HttpReason::get(200).c_str());
|
||||
ustream_printf(m_client->us, "Content-Type: application/json\r\n");
|
||||
start(kdefaultTimeout, true);
|
||||
}
|
||||
|
||||
|
||||
/*! ----------------------------------------------------------------------------
|
||||
* @fn handle_event
|
||||
*
|
||||
* @brief method called when a registered event is arrived for this connection.
|
||||
*/
|
||||
void NotificationConnection::handle_event (const char *a_type, const char *a_json_msg)
|
||||
void NotificationConnection::handle_event(const char *a_type, const char *a_json_msg)
|
||||
{
|
||||
// printf("NotificationConnection::handle_event\n");
|
||||
stop();
|
||||
@@ -96,13 +92,12 @@ void NotificationConnection::handle_event (const char *a_type, const char *a_jso
|
||||
start(kdefaultTimeout, true);
|
||||
}
|
||||
|
||||
|
||||
/*! ----------------------------------------------------------------------------
|
||||
* @fn expire
|
||||
*
|
||||
* @brief method called when no data is arrived to the notification canal.
|
||||
*/
|
||||
int NotificationConnection::expire (void)
|
||||
int NotificationConnection::expire(void)
|
||||
{
|
||||
// printf ("NotificationConnection::expire\n");
|
||||
m_ops->chunk_printf(m_client, "{}");
|
||||
|
||||
Reference in New Issue
Block a user