diff --git a/apps/db_dump/db_dump.c b/apps/db_dump/db_dump.c index 5ae009f236..c5ecf0f7eb 100644 --- a/apps/db_dump/db_dump.c +++ b/apps/db_dump/db_dump.c @@ -99,7 +99,6 @@ static void free__client_msg(struct P_client_msg *chunk) static void free__msg_store(struct P_msg_store *chunk) { - //free(chunk->source_id); free(chunk->topic); free(chunk->payload); mosquitto_property_free_all(&chunk->properties); @@ -425,7 +424,7 @@ int main(int argc, char *argv[]) read_e(fd, &header, 15); if(!memcmp(header, magic, 15)){ if(do_print) printf("Mosquitto DB dump\n"); - // Restore DB as normal + /* Restore DB as normal */ read_e(fd, &crc, sizeof(uint32_t)); if(do_print) printf("CRC: %d\n", crc); read_e(fd, &i32temp, sizeof(uint32_t)); diff --git a/apps/db_dump/print.c b/apps/db_dump/print.c index bc4eac3ed0..886563bdc3 100644 --- a/apps/db_dump/print.c +++ b/apps/db_dump/print.c @@ -183,8 +183,8 @@ void print__msg_store(struct P_msg_store *chunk, uint32_t length) printf("DB_CHUNK_MSG_STORE:\n"); printf("\tLength: %d\n", length); printf("\tStore ID: %" PRIu64 "\n", chunk->F.store_id); - //printf("\tSource ID: %s\n", chunk->source_id); - //printf("\tSource Username: %s\n", chunk->source_username); + /* printf("\tSource ID: %s\n", chunk->source_id); */ + /* printf("\tSource Username: %s\n", chunk->source_username); */ printf("\tSource Port: %d\n", chunk->F.source_port); printf("\tSource MID: %d\n", chunk->F.source_mid); printf("\tTopic: %s\n", chunk->topic); diff --git a/apps/mosquitto_ctrl/dynsec.c b/apps/mosquitto_ctrl/dynsec.c index 4b03386ae7..a8a6a9d112 100644 --- a/apps/mosquitto_ctrl/dynsec.c +++ b/apps/mosquitto_ctrl/dynsec.c @@ -440,7 +440,7 @@ static void dynsec__payload_callback(struct mosq_ctrl *ctrl, long payloadlen, co }else if(!strcasecmp(j_command->valuestring, "getAnonymousGroup")){ print_anonymous_group(j_response); }else{ - //fprintf(stderr, "%s: Success\n", j_command->valuestring); + /* fprintf(stderr, "%s: Success\n", j_command->valuestring); */ } } cJSON_Delete(tree); diff --git a/client/client_shared.c b/client/client_shared.c index c668c9f493..e6c6ad5675 100644 --- a/client/client_shared.c +++ b/client/client_shared.c @@ -53,7 +53,7 @@ static int check_format(const char *str) for(i=0; i= '0' && str[i+1] <= '9'){ i++; if(i == len-1){ - // error + /* error */ fprintf(stderr, "Error: Incomplete format specifier.\n"); return 1; } @@ -81,7 +81,7 @@ static int check_format(const char *str) /* Precision specifier */ i++; if(i == len-1){ - // error + /* error */ fprintf(stderr, "Error: Incomplete format specifier.\n"); return 1; } @@ -89,7 +89,7 @@ static int check_format(const char *str) while(str[i+1] >= '0' && str[i+1] <= '9'){ i++; if(i == len-1){ - // error + /* error */ fprintf(stderr, "Error: Incomplete format specifier.\n"); return 1; } @@ -97,49 +97,49 @@ static int check_format(const char *str) } if(str[i+1] == '%'){ - // Print %, ignore + /* Print %, ignore */ }else if(str[i+1] == 'A'){ - // MQTT v5 property topic-alias + /* MQTT v5 property topic-alias */ }else if(str[i+1] == 'C'){ - // MQTT v5 property content-type + /* MQTT v5 property content-type */ }else if(str[i+1] == 'D'){ - // MQTT v5 property correlation-data + /* MQTT v5 property correlation-data */ }else if(str[i+1] == 'E'){ - // MQTT v5 property message-expiry-interval + /* MQTT v5 property message-expiry-interval */ }else if(str[i+1] == 'F'){ - // MQTT v5 property payload-format-indicator + /* MQTT v5 property payload-format-indicator */ }else if(str[i+1] == 'I'){ - // ISO 8601 date+time + /* ISO 8601 date+time */ }else if(str[i+1] == 'l'){ - // payload length + /* payload length */ }else if(str[i+1] == 'm'){ - // mid + /* mid */ }else if(str[i+1] == 'P'){ - // MQTT v5 property user-property + /* MQTT v5 property user-property */ }else if(str[i+1] == 'p'){ - // payload + /* payload */ }else if(str[i+1] == 'q'){ - // qos + /* qos */ }else if(str[i+1] == 'R'){ - // MQTT v5 property response-topic + /* MQTT v5 property response-topic */ }else if(str[i+1] == 'S'){ - // MQTT v5 property subscription-identifier + /* MQTT v5 property subscription-identifier */ }else if(str[i+1] == 'r'){ - // retain + /* retain */ }else if(str[i+1] == 't'){ - // topic + /* topic */ }else if(str[i+1] == 'j'){ - // JSON output, escaped payload + /* JSON output, escaped payload */ }else if(str[i+1] == 'J'){ - // JSON output, assuming JSON payload + /* JSON output, assuming JSON payload */ }else if(str[i+1] == 'U'){ - // Unix time+nanoseconds + /* Unix time+nanoseconds */ #ifdef WIN32 fprintf(stderr, "Error: The %%U format option is not supported on Windows.\n"); return 1; #endif }else if(str[i+1] == 'x' || str[i+1] == 'X'){ - // payload in hex + /* payload in hex */ }else{ fprintf(stderr, "Error: Invalid format specifier '%c'.\n", str[i+1]); return 1; @@ -148,26 +148,26 @@ static int check_format(const char *str) } }else if(str[i] == '@'){ if(i == len-1){ - // error + /* error */ fprintf(stderr, "Error: Incomplete format specifier.\n"); return 1; } i++; }else if(str[i] == '\\'){ if(i == len-1){ - // error + /* error */ fprintf(stderr, "Error: Incomplete escape specifier.\n"); return 1; }else{ switch(str[i+1]){ - case '\\': // '\' - case '0': // 0 (NULL) - case 'a': // alert - case 'e': // escape - case 'n': // new line - case 'r': // carriage return - case 't': // horizontal tab - case 'v': // vertical tab + case '\\': /* '\' */ + case '0': /* 0 (NULL) */ + case 'a': /* alert */ + case 'e': /* escape */ + case 'n': /* new line */ + case 'r': /* carriage return */ + case 't': /* horizontal tab */ + case 'v': /* vertical tab */ break; default: @@ -1463,12 +1463,13 @@ static int mosquitto__parse_socks_url(struct mosq_config *cfg, char *url) return 1; } - // socks5h://username:password@host:1883 - // socks5h://username:password@host - // socks5h://username@host:1883 - // socks5h://username@host - // socks5h://host:1883 - // socks5h://host + /* socks5h://username:password@host:1883 + * socks5h://username:password@host + * socks5h://username@host:1883 + * socks5h://username@host + * socks5h://host:1883 + * socks5h://host + */ start = 0; for(i=0; isock != INVALID_SOCKET){ - net__socket_close(mosq); //close socket + net__socket_close(mosq); } #ifdef WITH_SOCKS diff --git a/lib/packet_mosq.c b/lib/packet_mosq.c index ebe6b6b85d..91c82d7e90 100644 --- a/lib/packet_mosq.c +++ b/lib/packet_mosq.c @@ -456,7 +456,7 @@ int packet__read(struct mosquitto *mosq) return MOSQ_ERR_OVERSIZE_PACKET; } #else - // FIXME - client case for incoming message received from broker too large + /* FIXME - client case for incoming message received from broker too large */ #endif if(mosq->in_packet.remaining_length > 0){ mosq->in_packet.payload = mosquitto__malloc(mosq->in_packet.remaining_length*sizeof(uint8_t)); diff --git a/plugins/dynamic-security/clients.c b/plugins/dynamic-security/clients.c index 50eba2781b..e5416ba209 100644 --- a/plugins/dynamic-security/clients.c +++ b/plugins/dynamic-security/clients.c @@ -645,7 +645,7 @@ static int client__set_password(struct dynsec__client *client, const char *passw return MOSQ_ERR_SUCCESS; }else{ client->pw.valid = false; - // FIXME - this should fail safe without modifying the existing password + /* FIXME - this should fail safe without modifying the existing password */ return MOSQ_ERR_NOMEM; } } diff --git a/plugins/dynamic-security/sub_matches_sub.c b/plugins/dynamic-security/sub_matches_sub.c index 5f5d55a66f..8de7974a46 100644 --- a/plugins/dynamic-security/sub_matches_sub.c +++ b/plugins/dynamic-security/sub_matches_sub.c @@ -95,7 +95,7 @@ bool sub_acl_check(const char *acl, const char *sub) } sub_len = strlen(sub); - //mosquitto_validate_utf8(acl, acl_len); + /* mosquitto_validate_utf8(acl, acl_len); */ acl_local = strdup(acl); sub_local = strdup(sub); diff --git a/src/conf.c b/src/conf.c index ae867732d0..592ea97961 100644 --- a/src/conf.c +++ b/src/conf.c @@ -876,7 +876,7 @@ static int config__read_file_core(struct mosquitto__config *config, bool reload, return MOSQ_ERR_INVAL; } }else if(!strcmp(token, "auth_plugin") || !strcmp(token, "plugin")){ - if(reload) continue; // Auth plugin not currently valid for reloading. + if(reload) continue; /* Auth plugin not currently valid for reloading. */ conf__set_cur_security_options(config, cur_listener, &cur_security_options); cur_security_options->auth_plugin_configs = mosquitto__realloc(cur_security_options->auth_plugin_configs, (size_t)(cur_security_options->auth_plugin_config_count+1)*sizeof(struct mosquitto__auth_plugin_config)); if(!cur_security_options->auth_plugin_configs){ @@ -1053,7 +1053,7 @@ static int config__read_file_core(struct mosquitto__config *config, bool reload, #endif }else if(!strcmp(token, "bridge_max_packet_size")){ #if defined(WITH_BRIDGE) - if(reload) continue; // Bridges not valid for reloading. + if(reload) continue; /* Bridges not valid for reloading. */ if(!cur_bridge){ log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); return MOSQ_ERR_INVAL; @@ -1066,7 +1066,7 @@ static int config__read_file_core(struct mosquitto__config *config, bool reload, #endif }else if(!strcmp(token, "bridge_outgoing_retain")){ #if defined(WITH_BRIDGE) - if(reload) continue; // Listeners not valid for reloading. + if(reload) continue; /* Listeners not valid for reloading. */ if(!cur_bridge){ log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); return MOSQ_ERR_INVAL; @@ -1214,7 +1214,7 @@ static int config__read_file_core(struct mosquitto__config *config, bool reload, #endif }else if(!strcmp(token, "local_cleansession")){ #ifdef WITH_BRIDGE - if(reload) continue; // FIXME + if(reload) continue; /* FIXME */ if(!cur_bridge){ log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); return MOSQ_ERR_INVAL; diff --git a/src/database.c b/src/database.c index 4316a25e34..fc2c123d0d 100644 --- a/src/database.c +++ b/src/database.c @@ -677,7 +677,6 @@ int db__messages_easy_queue(struct mosquitto *context, const char *topic, uint8_ /* This function requires topic to be allocated on the heap. Once called, it owns topic and will free it on error. Likewise payload and properties. */ int db__message_store(const struct mosquitto *source, struct mosquitto_msg_store *stored, uint32_t message_expiry_interval, dbid_t store_id, enum mosquitto_msg_origin origin) -//int db__message_store(const struct mosquitto *source, uint16_t source_mid, char *topic, int qos, uint32_t payloadlen, mosquitto__payload_uhpa *payload, int retain, struct mosquitto_msg_store **stored, uint32_t message_expiry_interval, mosquitto_property *properties, dbid_t store_id, enum mosquitto_msg_origin origin) { assert(stored); diff --git a/src/plugin.c b/src/plugin.c index fae5fba202..45fc8c998b 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -181,9 +181,9 @@ void plugin__handle_tick(void) struct mosquitto__callback *cb_base; struct mosquitto__security_options *opts; - // FIXME - set now_s and now_ns to avoid need for multiple time lookups + /* FIXME - set now_s and now_ns to avoid need for multiple time lookups */ if(db.config->per_listener_settings){ - // FIXME - iterate over all listeners + /* FIXME - iterate over all listeners */ }else{ opts = &db.config->security_options; memset(&event_data, 0, sizeof(event_data));