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
71d09722
Commit
71d09722
authored
Feb 27, 2017
by
Yiming Sun
Committed by
Cesanta Bot
Feb 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix http_client doc
PUBLISHED_FROM=f415ddbac47e3069d3ab29467a23f6b8dab0066f
parent
349d25dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
client_example.md
docs/http/client_example.md
+3
-2
No files found.
docs/http/client_example.md
View file @
71d09722
...
...
@@ -18,8 +18,9 @@ static int exit_flag = 0;
static
void
ev_handler
(
struct
mg_connection
*
c
,
int
ev
,
void
*
p
)
{
if
(
ev
==
MG_EV_HTTP_REPLY
)
{
struct
http_message
*
hm
=
(
struct
http_message
*
)
p
;
c
->
flags
|=
MG_F_CLOSE_IMMEDIATELY
;
fwrite
(
hm
->
message
.
p
,
1
,
hm
->
message
.
len
,
stdout
);
fwrite
(
hm
->
message
.
p
,
1
,
(
int
)
hm
->
message
.
len
,
stdout
);
putchar
(
'\n'
);
exit_flag
=
1
;
}
else
if
(
ev
==
MG_EV_CLOSE
)
{
...
...
@@ -31,7 +32,7 @@ int main(void) {
struct
mg_mgr
mgr
;
mg_mgr_init
(
&
mgr
,
NULL
);
mg_connect_http
(
mgr
,
ev_handler
,
url
,
NULL
,
NULL
);
mg_connect_http
(
&
mgr
,
ev_handler
,
url
,
NULL
,
NULL
);
while
(
exit_flag
==
0
)
{
...
...
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