Diff for /mqtt/src/pubmqtt.c between versions 1.2.2.13 and 1.3

version 1.2.2.13, 2012/06/29 14:26:39 version 1.3, 2012/07/03 09:02:50
Line 421  mqtt_rtlm_delete_topic(cfg_root_t *cfg, sqlite3 *sql,  Line 421  mqtt_rtlm_delete_topic(cfg_root_t *cfg, sqlite3 *sql, 
  * @cfg = loaded config   * @cfg = loaded config
  * @sql = SQL handle   * @sql = SQL handle
  * @connid = connection id   * @connid = connection id
  * @msgid = MessageID  
  * @topic = topic   * @topic = topic
  * @retain = retain 0 get only dynamic, >0 get only retained and -1 no matter   * @retain = retain 0 get only dynamic, >0 get only retained and -1 no matter
  * return: NULL error or not found and !=NULL allocated subscribe topics   * return: NULL error or not found and !=NULL allocated subscribe topics
  */   */
 mqtt_subscr_t *  mqtt_subscr_t *
mqtt_rtlm_read_topic(cfg_root_t *cfg, sqlite3 *sql, const char *connid, u_short msgid, mqtt_rtlm_read_topic(cfg_root_t *cfg, sqlite3 *sql, const char *connid, 
                 const char *topic, char retain)                  const char *topic, char retain)
 {  {
         int rowz = 0;          int rowz = 0;
Line 457  mqtt_rtlm_read_topic(cfg_root_t *cfg, sqlite3 *sql, co Line 456  mqtt_rtlm_read_topic(cfg_root_t *cfg, sqlite3 *sql, co
                 mqtt_rtlm_log("Error:: not found topics table name");                  mqtt_rtlm_log("Error:: not found topics table name");
                 return NULL;                  return NULL;
         }          }
        psStmt = sqlite3_mprintf("SELECT Retain, Topic, Value FROM %s WHERE "        psStmt = sqlite3_mprintf("SELECT QoS, Topic, Value  FROM %s WHERE "
                        "ConnID = '%q' AND MsgID = %d AND Topic LIKE '%q' %s;",                         "ConnID LIKE '%q' AND Topic LIKE '%q' %s;", 
                        str, connid, msgid, topic, szStr);                        str, connid, topic, szStr);
   
         if (sqlite3_prepare_v2(sql, psStmt, strlen(psStmt), &stmt, NULL)) {          if (sqlite3_prepare_v2(sql, psStmt, strlen(psStmt), &stmt, NULL)) {
                 MQTT_RTLM_LOG(sql);                  MQTT_RTLM_LOG(sql);
Line 488  mqtt_rtlm_read_topic(cfg_root_t *cfg, sqlite3 *sql, co Line 487  mqtt_rtlm_read_topic(cfg_root_t *cfg, sqlite3 *sql, co
                 s[j].sub_value.msg_base = (u_char*) malloc(s[j].sub_value.msg_len);                  s[j].sub_value.msg_base = (u_char*) malloc(s[j].sub_value.msg_len);
                 if (s[j].sub_value.msg_base)                  if (s[j].sub_value.msg_base)
                         memcpy(s[j].sub_value.msg_base, AIT_GET_PTR(&v), s[j].sub_value.msg_len);                          memcpy(s[j].sub_value.msg_base, AIT_GET_PTR(&v), s[j].sub_value.msg_len);
                   AIT_FREE_VAL(&v);
         }          }
 end:  end:
         sqlite3_finalize(stmt);          sqlite3_finalize(stmt);

Removed from v.1.2.2.13  
changed lines
  Added in v.1.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>