Skip to content

Commit b194b99

Browse files
committed
Updated README, fixed bug in server.c constant declaration
1 parent 789bacb commit b194b99

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Sol
44
Oversimplified MQTT broker written from scratch, which mimick mosquitto
55
features. Implemented for learning how the protocol works, for now it supports
66
almost all MQTT v3.1.1 commands on linux platform; it relies on EPOLL interface
7-
introduced on kernel 2.5.44.
7+
for multiplexing I/O. Development process is documented in this (series of posts)[https://codepr.github.io/posts/sol-mqtt-broker].
88

99
## Build
1010

src/list.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ struct list_node *list_merge_sort(struct list_node *head, cmp cmp_func) {
329329
}
330330

331331
/* Insert a new list node in a list maintaining the order of the list */
332-
struct list_node *list_sort_inset(struct list_node **head,
333-
struct list_node *new, cmp cmp_func) {
332+
struct list_node *list_sort_insert(struct list_node **head,
333+
struct list_node *new, cmp cmp_func) {
334334

335335
if (!*head || cmp_func(*head, new) >= 0) {
336336
new->next = *head;

src/list.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ struct list_node *list_merge_sort(struct list_node *, cmp);
9696
struct list_node *bisect_list(struct list_node *);
9797

9898
/* Insert a new node into a list while maintaining the order of the elements */
99-
struct list_node *list_sort_inset(struct list_node **,
100-
struct list_node *, compare_func);
99+
struct list_node *list_sort_insert(struct list_node **,
100+
struct list_node *, compare_func);
101101

102102

103103
#endif

src/mqtt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <string.h>
2929
#include <arpa/inet.h>
3030
#include "util.h"
31+
#include "pack.h"
3132
#include "mqtt.h"
3233

3334

src/mqtt.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
* POSSIBILITY OF SUCH DAMAGE.
2626
*/
2727

28-
#include "pack.h"
29-
3028
#ifndef MQTT_H
3129
#define MQTT_H
3230

31+
#include <stdio.h>
32+
3333

3434
#define MQTT_HEADER_LEN 2
3535
#define MQTT_ACK_LEN 4

src/server.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ static struct sol sol;
5757
* Statistics topics, published every N seconds defined by configuration
5858
* interval
5959
*/
60-
static const int SYS_TOPICS = 14;
60+
#define SYS_TOPICS 14
61+
6162
static const char *sys_topics[SYS_TOPICS] = {
6263
"$SOL/",
6364
"$SOL/broker/",

src/server.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ struct sol_info {
6060
int nconnections;
6161
/* Timestamp of the start time */
6262
long long start_time;
63-
/* Total number of requests served */
64-
int nrequests;
6563
/* Total number of bytes received */
6664
long long bytes_recv;
6765
/* Total number of bytes sent out */

0 commit comments

Comments
 (0)