Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Main
Synchronet
Commits
e85a980e
Commit
e85a980e
authored
11 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Fix a couple boneheaded errors, and extern "C" the functions.
parent
ae81f19c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/xpdev/multisock.c
+3
-3
3 additions, 3 deletions
src/xpdev/multisock.c
src/xpdev/multisock.h
+8
-0
8 additions, 0 deletions
src/xpdev/multisock.h
with
11 additions
and
3 deletions
src/xpdev/multisock.c
+
3
−
3
View file @
e85a980e
...
@@ -71,7 +71,7 @@ BOOL xpms_add(struct xpms_set *xpms_set, int domain, int type,
...
@@ -71,7 +71,7 @@ BOOL xpms_add(struct xpms_set *xpms_set, int domain, int type,
}
}
for
(
cur
=
res
;
cur
;
cur
=
cur
->
ai_next
)
{
for
(
cur
=
res
;
cur
;
cur
=
cur
->
ai_next
)
{
new_socks
=
(
struct
xpms_sockdef
*
)
realloc
(
xpms_set
->
socks
,
sizeof
(
struct
xpms_s
et
)
*
xpms_set
->
sock_count
+
1
);
new_socks
=
(
struct
xpms_sockdef
*
)
realloc
(
xpms_set
->
socks
,
sizeof
(
struct
xpms_s
ockdef
)
*
(
xpms_set
->
sock_count
+
1
)
)
;
if
(
new_socks
==
NULL
)
{
if
(
new_socks
==
NULL
)
{
/* This may be a partial failure */
/* This may be a partial failure */
if
(
xpms_set
->
lprintf
)
if
(
xpms_set
->
lprintf
)
...
@@ -114,9 +114,9 @@ BOOL xpms_add(struct xpms_set *xpms_set, int domain, int type,
...
@@ -114,9 +114,9 @@ BOOL xpms_add(struct xpms_set *xpms_set, int domain, int type,
bind_init
(
TRUE
);
bind_init
(
TRUE
);
}
}
if
(
!
listen
(
xpms_set
->
socks
[
xpms_set
->
sock_count
].
sock
,
SOMAXCONN
))
{
if
(
listen
(
xpms_set
->
socks
[
xpms_set
->
sock_count
].
sock
,
SOMAXCONN
)
==-
1
)
{
if
(
xpms_set
->
lprintf
)
if
(
xpms_set
->
lprintf
)
xpms_set
->
lprintf
(
LOG_WARNING
,
"%04d !ERROR %d listen()ing o
p
port %d"
xpms_set
->
lprintf
(
LOG_WARNING
,
"%04d !ERROR %d listen()ing o
n
port %d"
,
xpms_set
->
socks
[
xpms_set
->
sock_count
].
sock
,
ERROR_VALUE
,
port
);
,
xpms_set
->
socks
[
xpms_set
->
sock_count
].
sock
,
ERROR_VALUE
,
port
);
closesocket
(
xpms_set
->
socks
[
xpms_set
->
sock_count
].
sock
);
closesocket
(
xpms_set
->
socks
[
xpms_set
->
sock_count
].
sock
);
FREE_AND_NULL
(
xpms_set
->
socks
[
xpms_set
->
sock_count
].
address
);
FREE_AND_NULL
(
xpms_set
->
socks
[
xpms_set
->
sock_count
].
address
);
...
...
This diff is collapsed.
Click to expand it.
src/xpdev/multisock.h
+
8
−
0
View file @
e85a980e
...
@@ -25,6 +25,10 @@ struct xpms_set {
...
@@ -25,6 +25,10 @@ struct xpms_set {
#define XPMS_FOREVER UINT_MAX
#define XPMS_FOREVER UINT_MAX
#ifdef __cplusplus
extern
"C"
{
#endif
struct
xpms_set
*
xpms_create
(
unsigned
int
retries
,
unsigned
int
wait_secs
,
struct
xpms_set
*
xpms_create
(
unsigned
int
retries
,
unsigned
int
wait_secs
,
int
(
*
lprintf
)(
int
level
,
const
char
*
fmt
,
...));
int
(
*
lprintf
)(
int
level
,
const
char
*
fmt
,
...));
void
xpms_destroy
(
struct
xpms_set
*
xpms_set
);
void
xpms_destroy
(
struct
xpms_set
*
xpms_set
);
...
@@ -34,4 +38,8 @@ BOOL xpms_add(struct xpms_set *xpms_set, int domain, int type,
...
@@ -34,4 +38,8 @@ BOOL xpms_add(struct xpms_set *xpms_set, int domain, int type,
SOCKET
xpms_accept
(
struct
xpms_set
*
,
struct
sockaddr
*
addr
,
SOCKET
xpms_accept
(
struct
xpms_set
*
,
struct
sockaddr
*
addr
,
socklen_t
*
addrlen
,
unsigned
int
timeout
,
void
**
cb_data
);
socklen_t
*
addrlen
,
unsigned
int
timeout
,
void
**
cb_data
);
#ifdef __cplusplus
}
#endif
#endif
#endif
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