Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mongoose
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ganil-acq
GANILinux
linux-service
library
mongoose
Commits
71d09722
Commit
71d09722
authored
8 years ago
by
Yiming Sun
Committed by
Cesanta Bot
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix http_client doc
PUBLISHED_FROM=f415ddbac47e3069d3ab29467a23f6b8dab0066f
parent
349d25dc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/http/client_example.md
+3
-2
3 additions, 2 deletions
docs/http/client_example.md
with
3 additions
and
2 deletions
docs/http/client_example.md
+
3
−
2
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
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment