Skip to content

Commit

Permalink
Remove dead values.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Jan 23, 2020
1 parent 18f0508 commit 05ec02b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 26 deletions.
12 changes: 1 addition & 11 deletions lib/helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ struct userdata__callback {
int (*callback)(struct mosquitto *, void *, const struct mosquitto_message *);
void *userdata;
int qos;
int rc;
};

struct userdata__simple {
Expand Down Expand Up @@ -168,7 +167,6 @@ libmosq_EXPORT int mosquitto_subscribe_callback(

cb_userdata.topic = topic;
cb_userdata.qos = qos;
cb_userdata.rc = 0;
cb_userdata.userdata = userdata;
cb_userdata.callback = callback;

Expand Down Expand Up @@ -214,14 +212,6 @@ libmosq_EXPORT int mosquitto_subscribe_callback(
}
rc = mosquitto_loop_forever(mosq, -1, 1);
mosquitto_destroy(mosq);
if(cb_userdata.rc){
rc = cb_userdata.rc;
}
//if(!rc && cb_userdata.max_msg_count == 0){
//return MOSQ_ERR_SUCCESS;
//}else{
//return rc;
//}
return MOSQ_ERR_SUCCESS;
return rc;
}

1 change: 0 additions & 1 deletion lib/mosquitto.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,6 @@ int mosquitto_sub_topic_tokenise(const char *subtopic, char ***topics, int *coun
if(!(*topics)) return MOSQ_ERR_NOMEM;

start = 0;
stop = 0;
hier = 0;

for(i=0; i<len+1; i++){
Expand Down
15 changes: 2 additions & 13 deletions src/database.c
Original file line number Diff line number Diff line change
Expand Up @@ -982,21 +982,9 @@ int db__message_write(struct mosquitto_db *db, struct mosquitto *context)
/* Message is expired, must not send. */
db__message_remove(db, &context->msgs_in, tail);
continue;
}else{
expiry_interval = tail->store->message_expiry_time - now;
}
}else{
expiry_interval = 0;
}
mid = tail->mid;
retries = tail->dup;
retain = tail->retain;
topic = tail->store->topic;
qos = tail->qos;
payloadlen = tail->store->payloadlen;
payload = UHPA_ACCESS_PAYLOAD(tail->store);
cmsg_props = tail->properties;
store_props = tail->store->properties;

switch(tail->state){
case mosq_ms_send_pubrec:
Expand Down Expand Up @@ -1033,7 +1021,6 @@ int db__message_write(struct mosquitto_db *db, struct mosquitto *context)

DL_FOREACH_SAFE(context->msgs_out.inflight, tail, tmp){
msg_count++;
expiry_interval = 0;
if(tail->store->message_expiry_time){
if(now == 0){
now = time(NULL);
Expand All @@ -1045,6 +1032,8 @@ int db__message_write(struct mosquitto_db *db, struct mosquitto *context)
}else{
expiry_interval = tail->store->message_expiry_time - now;
}
}else{
expiry_interval = 0;
}
mid = tail->mid;
retries = tail->dup;
Expand Down
1 change: 0 additions & 1 deletion src/subs.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ static int sub__topic_tokenise(const char *subtopic, struct sub__token **topics)
start = 0;
}

stop = 0;
for(i=start; i<len+1; i++){
if(subtopic[i] == '/' || subtopic[i] == '\0'){
stop = i;
Expand Down

0 comments on commit 05ec02b

Please sign in to comment.