fixed hang issue when registration. 14/56014/1
authorpolu.sandeep <polu.sandeep@samsung.com>
Thu, 31 Dec 2015 06:56:33 +0000 (15:56 +0900)
committerpolu.sandeep <polu.sandeep@samsung.com>
Thu, 31 Dec 2015 06:56:33 +0000 (15:56 +0900)
Change-Id: Id6cb0411020a172f0408cd74181821fdf09d3ac5

tg-engine-service/inc/logger.h
tg-engine-service/src/server_response.c

index d937055..d9b4464 100644 (file)
@@ -5,8 +5,8 @@
  *      Author: sandeep
  */
 
-#ifndef LOGGER_H_
-#define LOGGER_H_
+#ifndef __LOGGER_H__
+#define __LOGGER_H__
 
 #include <dlog.h>
 
         LOG_TAG, "%s: %s(%d) > " fmt, MODULE_INFO, \
         __func__, __LINE__, ##arg)
 
+#define LOGI(fmt, arg...) dlog_print(DLOG_INFO, \
+        LOG_TAG, "%s: %s(%d) > " fmt, MODULE_INFO, \
+        __func__, __LINE__, ##arg)
+
 #define DBG(fmt, arg...) dlog_print(DLOG_DEBUG, \
         LOG_TAG, "%s: %s(%d) > " fmt, MODULE_INFO, \
         __func__, __LINE__, ##arg)
 
+#define LOGD(fmt, arg...) dlog_print(DLOG_DEBUG, \
+        LOG_TAG, "%s: %s(%d) > " fmt, MODULE_INFO, \
+        __func__, __LINE__, ##arg)
+
 #define WARN(fmt, arg...) dlog_print(DLOG_WARN, \
         LOG_TAG, "%s: %s(%d) > " fmt, MODULE_INFO, \
         __func__, __LINE__, ##arg)
         LOG_TAG, "%s: %s(%d) > " fmt, MODULE_INFO, \
         __func__, __LINE__, ##arg)
 
+#define LOGE(fmt, arg...) dlog_print(DLOG_ERROR, \
+        LOG_TAG, "%s: %s(%d) > " fmt, MODULE_INFO, \
+        __func__, __LINE__, ##arg)
+
 #define RETM_IF(expr, fmt, arg...) \
 { \
     if (expr) { \
     } \
 }
 
-#endif /* LOGGER_H_ */
+#define retv_if(expr, val) do { \
+       if (expr) { \
+               ERR("(%s) -> %s() return", #expr, __FUNCTION__); \
+               return (val); \
+       } \
+} while (0)
+
+#define ret_if(expr) do { \
+       if (expr) { \
+               ERR("(%s) -> %s() return", #expr, __FUNCTION__); \
+               return; \
+       } \
+} while (0)
+
+#define goto_if(expr, val) do { \
+       if (expr) { \
+               ERR("(%s) -> goto", #expr); \
+               goto val; \
+       } \
+} while (0)
+
+#define break_if(expr) { \
+       if (expr) { \
+               ERR("(%s) -> break", #expr); \
+               break; \
+       } \
+}
+
+#define continue_if(expr) { \
+       if (expr) { \
+               ERR("(%s) -> continue", #expr); \
+               continue; \
+       } \
+}
+
+
+
+#endif /* __LOGGER_H__ */
index 5dcd77b..037e115 100644 (file)
 
 void process_registration_command(tg_engine_data_s *tg_data, char* phone_no, Eina_Bool trough_sms)
 {
+#if 0
        if (trough_sms && (tg_data->tg_state != TG_ENGINE_STATE_REGISTRATION || !phone_no)) {
                return;
        }
-
+#endif
        if (!tg_data || !tgl_engine_get_TLS()) {
                // service not running. error handling
                return;