--- mqtt/src/pubmqtt.c 2012/05/05 14:51:02 1.2.2.6 +++ mqtt/src/pubmqtt.c 2012/05/08 13:04:02 1.2.2.7 @@ -454,15 +454,14 @@ mqtt_rtlm_write_subscribe(cfg_root_t *cfg, sqlite3 *sq * @topic = topic * @user = username * @host = hostname - * @qos = Subscribe QoS if -1 no matter * return: -1 error, 0 no changes or >0 deleted rows */ int mqtt_rtlm_delete_subscribe(cfg_root_t *cfg, sqlite3 *sql, const char *topic, - const char *user, const char *host, char qos) + const char *user, const char *host) { int ret = 0; - char *str, szStr[STRSIZ] = { 0 }, szStmt[BUFSIZ] = { 0 }; + char *str, szStmt[BUFSIZ] = { 0 }; sqlite3_stmt *stmt; if (!cfg || !sql || !topic) @@ -473,11 +472,9 @@ mqtt_rtlm_delete_subscribe(cfg_root_t *cfg, sqlite3 *s mqtt_rtlm_log("Error:: not found subscribes table name"); return -1; } - if (qos > -1 && qos < 3) - snprintf(szStr, sizeof szStr, "AND QoS = %d", qos); snprintf(szStmt, sizeof szStmt, "DELETE FROM %s WHERE Topic LIKE '%s' AND " - "PubUser LIKE '%s' AND PubHost LIKE '%s' %s;", str, - topic, user, host, szStr); + "PubUser LIKE '%s' AND PubHost LIKE '%s';", str, + topic, user, host); if (sqlite3_prepare_v2(sql, szStmt, strlen(szStmt), &stmt, NULL)) { MQTT_RTLM_LOG(sql);