Make mg_conn_addr_to_str return len

Also amend api_net.js to use returned length.

PUBLISHED_FROM=38e15f9587edf28049c5b9e5f126b4db159910e8
This commit is contained in:
Sergey Lyubka authored and Cesanta Bot committed 2017-06-26 21:02:02 +00:00
1 parent fb3a5a7d90
commit 8d76733fad
4 files changed
+19 -16

No files matched your search

+4 -3
View File
@@ -3,8 +3,8 @@ title: "mg_conn_addr_to_str()"
decl_name: "mg_conn_addr_to_str"
symbol_kind: "func"
signature: |
void mg_conn_addr_to_str(struct mg_connection *nc, char *buf, size_t len,
int flags);
int mg_conn_addr_to_str(struct mg_connection *c, char *buf, size_t len,
int flags);
---
Converts a connection's local or remote address into string.
@@ -17,5 +17,6 @@ see `MG_SOCK_STRINGIFY_*` definitions.
- MG_SOCK_STRINGIFY_REMOTE - print remote peer's IP/port, not local address
If both port number and IP address are printed, they are separated by `:`.
If compiled with `-DMG_ENABLE_IPV6`, IPv6 addresses are supported.
If compiled with `-DMG_ENABLE_IPV6`, IPv6 addresses are supported.
Return length of the stringified address.
+2 -2
View File
@@ -3,8 +3,8 @@ title: "mg_sock_addr_to_str()"
decl_name: "mg_sock_addr_to_str"
symbol_kind: "func"
signature: |
void mg_sock_addr_to_str(const union socket_address *sa, char *buf, size_t len,
int flags);
int mg_sock_addr_to_str(const union socket_address *sa, char *buf, size_t len,
int flags);
---
Convert the socket's address into string.