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
423b9783
Commit
423b9783
authored
9 years ago
by
Sergey Lyubka
Committed by
rojer
9 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Report read-only vars to UI
PUBLISHED_FROM=2ca4b52e777a54d9bb05a177e57a8b73bb962fdb
parent
ecf20ec7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
mongoose.c
mongoose.c
+9
-5
mongoose.h
mongoose.h
+4
-0
No files found.
mongoose.c
View file @
423b9783
...
...
@@ -1801,7 +1801,6 @@ void to_wchar(const char *path, wchar_t *wbuf, size_t wbuf_len) {
#endif
#define MG_CTL_MSG_MESSAGE_SIZE 8192
#define MG_VPRINTF_BUFFER_SIZE 100
#define MG_MAX_HOST_LEN 200
#define MG_COPY_COMMON_CONNECTION_OPTIONS(dst, src) \
...
...
@@ -4091,7 +4090,7 @@ void mg_send_websocket_framev(struct mg_connection *nc, int op,
void
mg_printf_websocket_frame
(
struct
mg_connection
*
nc
,
int
op
,
const
char
*
fmt
,
...)
{
char
mem
[
BUFSIZ
],
*
buf
=
mem
;
char
mem
[
MG_VPRINTF_BUFFER_SIZE
],
*
buf
=
mem
;
va_list
ap
;
int
len
;
...
...
@@ -4131,7 +4130,7 @@ static void websocket_handler(struct mg_connection *nc, int ev, void *ev_data) {
static
void
ws_handshake
(
struct
mg_connection
*
nc
,
const
struct
mg_str
*
key
)
{
static
const
char
*
magic
=
"258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
;
char
buf
[
500
],
sha
[
20
],
b64_sha
[
sizeof
(
sha
)
*
2
];
char
buf
[
MG_VPRINTF_BUFFER_SIZE
],
sha
[
20
],
b64_sha
[
sizeof
(
sha
)
*
2
];
cs_sha1_ctx
sha_ctx
;
snprintf
(
buf
,
sizeof
(
buf
),
"%.*s%s"
,
(
int
)
key
->
len
,
key
->
p
,
magic
);
...
...
@@ -4525,7 +4524,12 @@ void mg_send_head(struct mg_connection *c, int status_code,
if
(
content_length
<
0
)
{
mg_printf
(
c
,
"%s"
,
"Transfer-Encoding: chunked
\r\n
"
);
}
else
{
#ifdef MG_ESP8266
/* TODO(lsm): remove this when ESP stdlib supports %lld */
mg_printf
(
c
,
"Content-Length: %lu
\r\n
"
,
(
unsigned
long
)
content_length
);
#else
mg_printf
(
c
,
"Content-Length: %"
INT64_FMT
"
\r\n
"
,
content_length
);
#endif
}
mg_send
(
c
,
"
\r\n
"
,
2
);
}
...
...
@@ -4927,7 +4931,7 @@ void mg_send_http_chunk(struct mg_connection *nc, const char *buf, size_t len) {
}
void
mg_printf_http_chunk
(
struct
mg_connection
*
nc
,
const
char
*
fmt
,
...)
{
char
mem
[
500
],
*
buf
=
mem
;
char
mem
[
MG_VPRINTF_BUFFER_SIZE
],
*
buf
=
mem
;
int
len
;
va_list
ap
;
...
...
@@ -4947,7 +4951,7 @@ void mg_printf_http_chunk(struct mg_connection *nc, const char *fmt, ...) {
}
void
mg_printf_html_escape
(
struct
mg_connection
*
nc
,
const
char
*
fmt
,
...)
{
char
mem
[
500
],
*
buf
=
mem
;
char
mem
[
MG_VPRINTF_BUFFER_SIZE
],
*
buf
=
mem
;
int
i
,
j
,
len
;
va_list
ap
;
...
...
This diff is collapsed.
Click to expand it.
mongoose.h
View file @
423b9783
...
...
@@ -649,6 +649,10 @@ typedef void *SSL;
typedef
void
*
SSL_CTX
;
#endif
#ifndef MG_VPRINTF_BUFFER_SIZE
#define MG_VPRINTF_BUFFER_SIZE 100
#endif
#ifdef MG_USE_READ_WRITE
#define MG_RECV_FUNC(s, b, l, f) read(s, b, l)
#define MG_SEND_FUNC(s, b, l, f) write(s, b, l)
...
...
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