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
4566ca56
Commit
4566ca56
authored
Jun 06, 2012
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Squashed warnings in callback()
parent
2e3e1ba7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
hello.c
examples/hello.c
+5
-3
No files found.
examples/hello.c
View file @
4566ca56
...
...
@@ -6,15 +6,17 @@ static void *callback(enum mg_event event,
struct
mg_connection
*
conn
,
const
struct
mg_request_info
*
request_info
)
{
if
(
event
==
MG_NEW_REQUEST
)
{
const
char
*
content
=
"hello from mongoose!"
;
char
content
[
1024
];
int
content_length
=
snprintf
(
content
,
sizeof
(
content
),
"Hello from mongoose! Remote port: %d"
,
request_info
->
remote_port
);
mg_printf
(
conn
,
"HTTP/1.1 200 OK
\r\n
"
"Content-Type: text/plain
\r\n
"
"Content-Length: %d
\r\n
"
// Always set Content-Length
"
\r\n
"
"%s"
,
strlen
(
content
),
content
);
content_length
,
content
);
// Mark as processed
return
""
;
}
else
{
...
...
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