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
c8e88e17
Commit
c8e88e17
authored
May 15, 2015
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sync fossa struct definitions
parent
bf7a115b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
mongoose.c
mongoose.c
+20
-18
No files found.
mongoose.c
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
;
}
...
...
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