Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
d9b7ec18
Commit
d9b7ec18
authored
8 years ago
by
Alexander Alashkin
Committed by
Cesanta Bot
8 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add MG_F_ENABLE_BROADCAST option
PUBLISHED_FROM=293a54ab09e6879b6f0c36975a137eeaeff92098
parent
ffed9c4d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletion
+8
-1
struct_mg_connection.md
docs/c-api/net.h/struct_mg_connection.md
+1
-0
mongoose.c
mongoose.c
+6
-1
mongoose.h
mongoose.h
+1
-0
No files found.
docs/c-api/net.h/struct_mg_connection.md
View file @
d9b7ec18
...
...
@@ -59,6 +59,7 @@ signature: |
#define MG_F_CLOSE_IMMEDIATELY (1 << 11) /* Disconnect */
#define MG_F_WEBSOCKET_NO_DEFRAG (1 << 12) /* Websocket specific */
#define MG_F_DELETE_CHUNK (1 << 13) /* HTTP specific */
#define MG_F_ENABLE_BROADCAST (1 << 14) /* Allow broadcast address usage */
#define MG_F_USER_1 (1 << 20) /* Flags left for application */
#define MG_F_USER_2 (1 << 21)
...
...
This diff is collapsed.
Click to expand it.
mongoose.c
View file @
d9b7ec18
...
...
@@ -1679,7 +1679,7 @@ const char *c_strnstr(const char *s, const char *find, size_t slen) {
/* Which flags can be pre-set by the user at connection creation time. */
#define _MG_ALLOWED_CONNECT_FLAGS_MASK \
(MG_F_USER_1 | MG_F_USER_2 | MG_F_USER_3 | MG_F_USER_4 | MG_F_USER_5 | \
MG_F_USER_6 | MG_F_WEBSOCKET_NO_DEFRAG)
MG_F_USER_6 | MG_F_WEBSOCKET_NO_DEFRAG
| MG_F_ENABLE_BROADCAST
)
/* Which flags should be modifiable by user's callbacks. */
#define _MG_CALLBACK_MODIFIABLE_FLAGS_MASK \
(MG_F_USER_1 | MG_F_USER_2 | MG_F_USER_3 | MG_F_USER_4 | MG_F_USER_5 | \
...
...
@@ -2789,6 +2789,11 @@ void mg_if_connect_udp(struct mg_connection *nc) {
nc
->
err
=
errno
?
errno
:
1
;
return
;
}
if
(
nc
->
flags
&
MG_F_ENABLE_BROADCAST
)
{
int
optval
=
1
;
setsockopt
(
nc
->
sock
,
SOL_SOCKET
,
SO_BROADCAST
,
(
const
char
*
)
&
optval
,
sizeof
(
optval
));
}
nc
->
err
=
0
;
}
...
...
This diff is collapsed.
Click to expand it.
mongoose.h
View file @
d9b7ec18
...
...
@@ -1263,6 +1263,7 @@ struct mg_connection {
#define MG_F_CLOSE_IMMEDIATELY (1 << 11)
/* Disconnect */
#define MG_F_WEBSOCKET_NO_DEFRAG (1 << 12)
/* Websocket specific */
#define MG_F_DELETE_CHUNK (1 << 13)
/* HTTP specific */
#define MG_F_ENABLE_BROADCAST (1 << 14)
/* Allow broadcast address usage */
#define MG_F_USER_1 (1 << 20)
/* Flags left for application */
#define MG_F_USER_2 (1 << 21)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment