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
f72c3fa9
Commit
f72c3fa9
authored
Nov 09, 2016
by
Alexander Alashkin
Committed by
Cesanta Bot
Nov 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unbreak PIC32 compilation. Close cesanta/dev#5807
PUBLISHED_FROM=cfd7de45e4357a17719501b8ab004c2edbd3e87e
parent
d0c50632
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
mongoose.c
mongoose.c
+23
-1
No files found.
mongoose.c
View file @
f72c3fa9
...
@@ -12939,6 +12939,14 @@ char *inet_ntoa(struct in_addr in) {
...
@@ -12939,6 +12939,14 @@ char *inet_ntoa(struct in_addr in) {
static
void
mg_handle_send
(
struct
mg_connection
*
nc
)
{
static
void
mg_handle_send
(
struct
mg_connection
*
nc
)
{
uint16_t
bytes_written
=
0
;
uint16_t
bytes_written
=
0
;
if
(
nc
->
flags
&
MG_F_UDP
)
{
if
(
nc
->
flags
&
MG_F_UDP
)
{
if
(
!
TCPIP_UDP_RemoteBind
(
(
UDP_SOCKET
)
nc
->
sock
,
nc
->
sa
.
sin
.
sin_family
==
AF_INET
?
IP_ADDRESS_TYPE_IPV4
:
IP_ADDRESS_TYPE_IPV6
,
ntohs
(
nc
->
sa
.
sin
.
sin_port
),
(
IP_MULTI_ADDRESS
*
)
&
nc
->
sa
.
sin
))
{
nc
->
flags
|=
MG_F_CLOSE_IMMEDIATELY
;
return
;
}
bytes_written
=
TCPIP_UDP_TxPutIsReady
((
UDP_SOCKET
)
nc
->
sock
,
0
);
bytes_written
=
TCPIP_UDP_TxPutIsReady
((
UDP_SOCKET
)
nc
->
sock
,
0
);
if
(
bytes_written
>=
nc
->
send_mbuf
.
len
)
{
if
(
bytes_written
>=
nc
->
send_mbuf
.
len
)
{
if
(
TCPIP_UDP_ArrayPut
((
UDP_SOCKET
)
nc
->
sock
,
if
(
TCPIP_UDP_ArrayPut
((
UDP_SOCKET
)
nc
->
sock
,
...
@@ -13058,6 +13066,20 @@ void mg_pic32_harmony_if_get_conn_addr(struct mg_connection *nc, int remote,
...
@@ -13058,6 +13066,20 @@ void mg_pic32_harmony_if_get_conn_addr(struct mg_connection *nc, int remote,
/* TODO(alaskin): not implemented yet */
/* TODO(alaskin): not implemented yet */
}
}
void
mg_pic32_harmony_if_connect_tcp
(
struct
mg_connection
*
nc
,
const
union
socket_address
*
sa
)
{
nc
->
sock
=
TCPIP_TCP_ClientOpen
(
sa
->
sin
.
sin_family
==
AF_INET
?
IP_ADDRESS_TYPE_IPV4
:
IP_ADDRESS_TYPE_IPV6
,
ntohs
(
sa
->
sin
.
sin_port
),
(
IP_MULTI_ADDRESS
*
)
&
sa
->
sin
);
nc
->
err
=
(
nc
->
sock
==
INVALID_SOCKET
)
?
-
1
:
0
;
}
void
mg_pic32_harmony_if_connect_udp
(
struct
mg_connection
*
nc
)
{
nc
->
sock
=
TCPIP_UDP_ClientOpen
(
IP_ADDRESS_TYPE_ANY
,
0
,
NULL
);
nc
->
err
=
(
nc
->
sock
==
INVALID_SOCKET
)
?
-
1
:
0
;
}
/* clang-format off */
/* clang-format off */
#define MG_PIC32_HARMONY_IFACE_VTABLE \
#define MG_PIC32_HARMONY_IFACE_VTABLE \
{ \
{ \
...
@@ -13082,7 +13104,7 @@ void mg_pic32_harmony_if_get_conn_addr(struct mg_connection *nc, int remote,
...
@@ -13082,7 +13104,7 @@ void mg_pic32_harmony_if_get_conn_addr(struct mg_connection *nc, int remote,
struct
mg_iface_vtable
mg_pic32_harmony_iface_vtable
=
struct
mg_iface_vtable
mg_pic32_harmony_iface_vtable
=
MG_PIC32_HARMONY_IFACE_VTABLE
;
MG_PIC32_HARMONY_IFACE_VTABLE
;
#if MG_NET_IF == MG_NET_IF_PIC32_HARMONY
_LOW_LEVEL
#if MG_NET_IF == MG_NET_IF_PIC32_HARMONY
struct
mg_iface_vtable
mg_default_iface_vtable
=
MG_PIC32_HARMONY_IFACE_VTABLE
;
struct
mg_iface_vtable
mg_default_iface_vtable
=
MG_PIC32_HARMONY_IFACE_VTABLE
;
#endif
#endif
...
...
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