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
8ab96ec7
Commit
8ab96ec7
authored
Sep 14, 2015
by
Marko Mikulicic
Committed by
Sergey Lyubka
Sep 21, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement binary and incremental clubby client
PUBLISHED_FROM=ba371b8a3d9dd8afcb771144beb8e5c344c7d6c7
parent
0730590e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
6 deletions
+25
-6
mongoose.c
mongoose.c
+1
-1
mongoose.h
mongoose.h
+24
-5
No files found.
mongoose.c
View file @
8ab96ec7
...
...
@@ -3686,7 +3686,7 @@ static void mg_send_ws_header(struct mg_connection *nc, int op, size_t len,
int
header_len
;
unsigned
char
header
[
10
];
header
[
0
]
=
0x80
+
(
op
&
0x0f
);
header
[
0
]
=
(
op
&
WEBSOCKET_DONT_FIN
?
0x0
:
0x80
)
+
(
op
&
0x0f
);
if
(
len
<
126
)
{
header
[
1
]
=
len
;
header_len
=
2
;
...
...
mongoose.h
View file @
8ab96ec7
...
...
@@ -1307,7 +1307,7 @@ void mg_send_websocket_handshake(struct mg_connection *nc, const char *uri,
/*
* Send websocket frame to the remote end.
*
* `op
` specifies frame's type
, one of:
* `op
_and_flags` specifies frame's type
, one of:
*
* - WEBSOCKET_OP_CONTINUE
* - WEBSOCKET_OP_TEXT
...
...
@@ -1315,17 +1315,22 @@ void mg_send_websocket_handshake(struct mg_connection *nc, const char *uri,
* - WEBSOCKET_OP_CLOSE
* - WEBSOCKET_OP_PING
* - WEBSOCKET_OP_PONG
*
* Orred with one of the flags:
*
* - WEBSOCKET_DONT_FIN: Don't set the FIN flag on the frame to be sent.
*
* `data` and `data_len` contain frame data.
*/
void
mg_send_websocket_frame
(
struct
mg_connection
*
nc
,
int
op
,
const
void
*
data
,
size_t
data_len
);
void
mg_send_websocket_frame
(
struct
mg_connection
*
nc
,
int
op
_and_flags
,
const
void
*
data
,
size_t
data_len
);
/*
* Send multiple websocket frames.
*
* Like `mg_send_websocket_frame()`, but composes a frame from multiple buffers.
*/
void
mg_send_websocket_framev
(
struct
mg_connection
*
nc
,
int
op
,
void
mg_send_websocket_framev
(
struct
mg_connection
*
nc
,
int
op
_and_flags
,
const
struct
mg_str
*
strings
,
int
num_strings
);
/*
...
...
@@ -1334,7 +1339,7 @@ void mg_send_websocket_framev(struct mg_connection *nc, int op,
* Like `mg_send_websocket_frame()`, but allows to create formatted message
* with `printf()`-like semantics.
*/
void
mg_printf_websocket_frame
(
struct
mg_connection
*
nc
,
int
op
,
void
mg_printf_websocket_frame
(
struct
mg_connection
*
nc
,
int
op
_and_flags
,
const
char
*
fmt
,
...);
/*
...
...
@@ -1376,6 +1381,20 @@ void mg_printf_html_escape(struct mg_connection *, const char *, ...);
#define WEBSOCKET_OP_PING 9
#define WEBSOCKET_OP_PONG 10
/*
* If set causes the FIN flag to not be set on outbound
* frames. This enables sending multiple fragments of a single
* logical message.
*
* The WebSocket protocol mandates that if the FIN flag of a data
* frame is not set, the next frame must be a WEBSOCKET_OP_CONTINUE.
* The last frame must have the FIN bit set.
*
* Note that mongoose will automatically defragment incoming messages,
* so this flag is used only on outbound messages.
*/
#define WEBSOCKET_DONT_FIN 0x100
/*
* Parse a HTTP message.
*
...
...
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