Skip to content
Snippets Groups Projects
Commit e406de7e authored by Alexander Alashkin's avatar Alexander Alashkin Committed by Cesanta Bot
Browse files

Remove extra error message

PUBLISHED_FROM=8b7fcfc1bc32ff9ff38e2904ddb730c83bf9fae4
parent 53ed8502
No related branches found
No related tags found
No related merge requests found
Showing
with 45 additions and 45 deletions
......@@ -8,6 +8,6 @@ signature: |
size_t len);
---
Adds a new option to mg_coap_message structure.
Add new option to mg_coap_message structure.
Returns pointer to the newly created option.
......@@ -6,6 +6,6 @@ signature: |
void mg_coap_free_options(struct mg_coap_message *cm);
---
Frees the memory allocated for options.
If the cm paramater doesn't contain any option it does nothing.
Free the memory allocated for options,
if cm paramater doesn't contain any option does nothing.
......@@ -6,13 +6,13 @@ signature: |
uint32_t mg_coap_parse(struct mbuf *io, struct mg_coap_message *cm);
---
Parses CoAP message and fills mg_coap_message and returns cm->flags.
Parse COAP message and fills mg_coap_message and returns cm->flags.
This is a helper function.
NOTE: usually CoAP works over UDP, so lack of data means format error.
But, in theory, it is possible to use CoAP over TCP (according to RFC)
NOTE: usually CoAP work over UDP, so lack of data means format error,
but in theory it is possible to use CoAP over TCP (according to RFC)
The caller has to check results and treat COAP_NOT_ENOUGH_DATA according to
The caller have to check results and treat COAP_NOT_ENOUGH_DATA according to
underlying protocol:
- in case of UDP COAP_NOT_ENOUGH_DATA means COAP_FORMAT_ERROR,
......
......@@ -6,7 +6,7 @@ signature: |
uint32_t mg_coap_send_ack(struct mg_connection *nc, uint16_t msg_id);
---
Composes CoAP acknowledgement from `mg_coap_message`
and sends it into `nc` connection.
Compose CoAP acknowledgement from `mg_coap_message`
and send it into `nc` connection.
Return value: see `mg_coap_send_message()`
......@@ -7,9 +7,9 @@ signature: |
struct mg_coap_message *cm);
---
Composes a CoAP message from `mg_coap_message`
and sends it into `nc` connection.
Returns 0 on success. On error, it is a bitmask:
Compose CoAP message from `mg_coap_message`
and send it into `nc` connection.
Return 0 on success. On error, it is a bitmask:
- `#define MG_COAP_ERROR 0x10000`
- `#define MG_COAP_FORMAT_ERROR (MG_COAP_ERROR | 0x20000)`
......
......@@ -6,5 +6,5 @@ signature: |
int mg_set_protocol_coap(struct mg_connection *nc);
---
Sets CoAP protocol handler - triggers CoAP specific events.
Set CoAP protocol handler - trigger CoAP specific events
......@@ -7,18 +7,18 @@ signature: |
struct mg_dns_message *msg);
---
Creates a DNS reply.
Create a DNS reply.
The reply will be based on an existing query message `msg`.
The query body will be appended to the output buffer.
"reply + recursion allowed" will be added to the message flags and the
"reply + recursion allowed" will be added to the message flags and
message's num_answers will be set to 0.
Answer records can be appended with `mg_dns_send_reply` or by lower
level function defined in the DNS API.
In order to send a reply use `mg_dns_send_reply`.
It's possible to use a connection's send buffer as reply buffer,
In order to send the reply use `mg_dns_send_reply`.
It's possible to use a connection's send buffer as reply buffers,
and it will work for both UDP and TCP connections.
Example:
......
......@@ -9,10 +9,10 @@ signature: |
size_t rdata_len);
---
Appends a DNS reply record to the IO buffer and to the DNS message.
Append a DNS reply record to the IO buffer and to the DNS message.
The message's num_answers field will be incremented. It's the caller's duty
to ensure num_answers is properly initialised.
The message num_answers field will be incremented. It's caller's duty
to ensure num_answers is propertly initialized.
Returns -1 on error.
......@@ -6,11 +6,11 @@ signature: |
void mg_dns_send_reply(struct mg_connection *nc, struct mg_dns_reply *r);
---
Sends a DNS reply through a connection.
Send a DNS reply through a connection.
The DNS data is stored in an IO buffer pointed by reply structure in `r`.
This function mutates the content of that buffer in order to ensure that
the DNS header reflects the size and flags of the message, that might have been
the DNS header reflects size and flags of the mssage, that might have been
updated either with `mg_dns_reply_record` or by direct manipulation of
`r->message`.
......
......@@ -6,10 +6,10 @@ signature: |
int mg_dns_copy_questions(struct mbuf *io, struct mg_dns_message *msg);
---
Appends already encoded questions from an existing message.
Append already encoded questions from an existing message.
This is useful when generating a DNS reply message which includes
all question records.
Returns the number of appened bytes.
Return number of appened bytes.
......@@ -8,11 +8,11 @@ signature: |
size_t rlen);
---
Encodes and appends a DNS resource record to an IO buffer.
Encode and append a DNS resource record to an IO buffer.
The record metadata is taken from the `rr` parameter, while the name and data
are taken from the parameters, encoded in the appropriate format depending on
record type and stored in the IO buffer. The encoded values might contain
record type, and stored in the IO buffer. The encoded values might contain
offsets within the IO buffer. It's thus important that the IO buffer doesn't
get trimmed while a sequence of records are encoded while preparing a DNS
*reply.
......@@ -21,5 +21,5 @@ This function doesn't update the `name` and `rdata` pointers in the `rr`
*struct
because they might be invalidated as soon as the IO buffer grows again.
Returns the number of bytes appened or -1 in case of error.
Return the number of bytes appened or -1 in case of error.
......@@ -7,7 +7,7 @@ signature: |
struct mg_dns_message *msg);
---
Inserts a DNS header to an IO buffer.
Insert a DNS header to an IO buffer.
Returns the number of bytes inserted.
Return number of bytes inserted.
......@@ -8,7 +8,7 @@ signature: |
size_t data_len);
---
Parses the record data from a DNS resource record.
Parse the record data from a DNS resource record.
- A: struct in_addr *ina
- AAAA: struct in6_addr *ina
......
......@@ -7,15 +7,15 @@ signature: |
char *dst, int dst_len);
---
Uncompresses a DNS compressed name.
Uncompress a DNS compressed name.
The containing DNS message is required because of the compressed encoding
The containing dns message is required because the compressed encoding
and reference suffixes present elsewhere in the packet.
If the name is less than `dst_len` characters long, the remainder
of `dst` is terminated with `\0` characters. Otherwise, `dst` is not
If name is less than `dst_len` characters long, the remainder
of `dst` is terminated with `\0' characters. Otherwise, `dst` is not
*terminated.
If `dst_len` is 0 `dst` can be NULL.
Returns the uncompressed name length.
Return the uncompressed name length.
......@@ -7,5 +7,5 @@ signature: |
int query_type);
---
Sends a DNS query to the remote end.
Send a DNS query to the remote end.
......@@ -6,11 +6,11 @@ signature: |
void mg_set_protocol_dns(struct mg_connection *nc);
---
Attaches a built-in DNS event handler to the given listening connection.
Attach built-in DNS event handler to the given listening connection.
The DNS event handler parses the incoming UDP packets, treating them as DNS
requests. If an incoming packet gets successfully parsed by the DNS event
handler, a user event handler will receive an `MG_DNS_REQUEST` event, with
DNS event handler parses incoming UDP packets, treating them as DNS
requests. If incoming packet gets successfully parsed by the DNS event
handler, a user event handler will receive `MG_DNS_REQUEST` event, with
`ev_data` pointing to the parsed `struct mg_dns_message`.
See
......
......@@ -6,9 +6,9 @@ signature: |
void mg_mqtt_broker(struct mg_connection *brk, int ev, void *data);
---
Processes a MQTT broker message.
Process a MQTT broker message.
The listening connection expects a pointer to an initialised `mg_mqtt_broker`
Listening connection expects a pointer to an initialized `mg_mqtt_broker`
structure in the `user_data` field.
Basic usage:
......
......@@ -6,5 +6,5 @@ signature: |
void mg_mqtt_broker_init(struct mg_mqtt_broker *brk, void *user_data);
---
Initialises a MQTT broker.
Initialize a MQTT broker.
......@@ -7,7 +7,7 @@ signature: |
struct mg_mqtt_session *s);
---
Iterates over all MQTT session connections. Example:
Iterate over all mqtt sessions connections. Example:
```c
struct mg_mqtt_session *s;
......
......@@ -6,5 +6,5 @@ signature: |
void mg_mqtt_connack(struct mg_connection *nc, uint8_t return_code);
---
Sends a CONNACK command with a given `return_code`.
Send a CONNACK command with a given `return_code`.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment