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
c8e88e17
Commit
c8e88e17
authored
9 years ago
by
Sergey Lyubka
Browse files
Options
Downloads
Patches
Plain Diff
Sync fossa struct definitions
parent
bf7a115b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mongoose.c
+20
-18
20 additions, 18 deletions
mongoose.c
with
20 additions
and
18 deletions
mongoose.c
+
20
−
18
View file @
c8e88e17
...
...
@@ -238,6 +238,7 @@ struct ns_connection {
sock_t
sock
;
// Socket
union
socket_address
sa
;
// Peer address
size_t
recv_iobuf_limit
;
/* Max size of recv buffer */
struct
iobuf
recv_iobuf
;
// Received data
struct
iobuf
send_iobuf
;
// Data scheduled for sending
SSL
*
ssl
;
...
...
@@ -5270,31 +5271,32 @@ static void process_udp(struct ns_connection *nc) {
//ns_printf(nc, "%s", "HTTP/1.0 200 OK\r\n\r\n");
}
static
void
mg_ev_handler
(
struct
ns_connection
*
nc
,
int
ev
,
void
*
p
)
{
struct
connection
*
conn
=
(
struct
connection
*
)
nc
->
user_data
;
// Send NS event to the handler. Note that call_user won't send an event
// if conn == NULL. Therefore, repeat this for NS_ACCEPT event as well.
#ifdef MONGOOSE_SEND_NS_EVENTS
{
struct
connection
*
conn
=
(
struct
connection
*
)
nc
->
user_data
;
static
void
send_ns_event
(
struct
ns_connection
*
nc
,
int
ev
,
void
*
p
)
{
struct
connection
*
conn
=
(
struct
connection
*
)
nc
->
user_data
;
if
(
conn
!=
NULL
)
{
void
*
param
[
2
]
=
{
nc
,
p
};
if
(
conn
!=
NULL
)
conn
->
mg_conn
.
callback_param
=
param
;
conn
->
mg_conn
.
callback_param
=
param
;
call_user
(
conn
,
(
enum
mg_event
)
ev
);
}
}
#else
static
void
send_ns_event
(
struct
ns_connection
*
nc
,
int
ev
,
void
*
p
)
{
(
void
)
nc
;
(
void
)
p
;
}
#endif
static
void
mg_ev_handler
(
struct
ns_connection
*
nc
,
int
ev
,
void
*
p
)
{
struct
connection
*
conn
=
(
struct
connection
*
)
nc
->
user_data
;
// Send NS event to the handler. Note that call_user won't send an event
// if conn == NULL. Therefore, repeat this for NS_ACCEPT event as well.
send_ns_event
(
nc
,
ev
,
p
);
switch
(
ev
)
{
case
NS_ACCEPT
:
on_accept
(
nc
,
(
union
socket_address
*
)
p
);
#ifdef MONGOOSE_SEND_NS_EVENTS
{
struct
connection
*
conn
=
(
struct
connection
*
)
nc
->
user_data
;
void
*
param
[
2
]
=
{
nc
,
p
};
if
(
conn
!=
NULL
)
conn
->
mg_conn
.
callback_param
=
param
;
call_user
(
conn
,
(
enum
mg_event
)
ev
);
}
#endif
send_ns_event
(
nc
,
ev
,
p
);
break
;
case
NS_CONNECT
:
...
...
@@ -5366,9 +5368,9 @@ static void mg_ev_handler(struct ns_connection *nc, int ev, void *p) {
write_terminating_chunk
(
conn
);
}
close_local_endpoint
(
conn
);
/*
/*
* MG_POLL callback returned MG_TRUE,
* i.e. data is sent, set corresponding flag
* i.e. data is sent, set corresponding flag
*/
conn
->
ns_conn
->
flags
|=
NSF_FINISHED_SENDING_DATA
;
}
...
...
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