Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
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
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
3bdc883c
Commit
3bdc883c
authored
21 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
some annoying compilers warn about "(void)foo;" lines so we avoid them
parent
cc85f813
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
lib/connect.c
+17
-15
17 additions, 15 deletions
lib/connect.c
with
17 additions
and
15 deletions
lib/connect.c
+
17
−
15
View file @
3bdc883c
...
...
@@ -223,7 +223,6 @@ static CURLcode bindlocal(struct connectdata *conn,
* Select device to bind socket to
*************************************************************/
if
(
strlen
(
data
->
set
.
device
)
<
255
)
{
struct
sockaddr_in
sa
;
struct
Curl_dns_entry
*
h
=
NULL
;
size_t
size
;
char
myhost
[
256
]
=
""
;
...
...
@@ -282,7 +281,6 @@ static CURLcode bindlocal(struct connectdata *conn,
/* we don't need it anymore after this function has returned */
#ifdef ENABLE_IPV6
(
void
)
sa
;
/* prevent compiler warning */
if
(
bind
(
sockfd
,
addr
->
ai_addr
,
addr
->
ai_addrlen
)
>=
0
)
{
/* we succeeded to bind */
struct
sockaddr_in6
add
;
...
...
@@ -295,21 +293,25 @@ static CURLcode bindlocal(struct connectdata *conn,
}
}
#else
memset
((
char
*
)
&
sa
,
0
,
sizeof
(
sa
));
memcpy
((
char
*
)
&
sa
.
sin_addr
,
addr
->
h_addr
,
addr
->
h_length
);
sa
.
sin_family
=
AF_INET
;
sa
.
sin_addr
.
s_addr
=
in
;
sa
.
sin_port
=
0
;
/* get any port */
{
struct
sockaddr_in
sa
;
memset
((
char
*
)
&
sa
,
0
,
sizeof
(
sa
));
memcpy
((
char
*
)
&
sa
.
sin_addr
,
addr
->
h_addr
,
addr
->
h_length
);
sa
.
sin_family
=
AF_INET
;
sa
.
sin_addr
.
s_addr
=
in
;
sa
.
sin_port
=
0
;
/* get any port */
if
(
bind
(
sockfd
,
(
struct
sockaddr
*
)
&
sa
,
sizeof
(
sa
))
>=
0
)
{
/* we succeeded to bind */
struct
sockaddr_in
add
;
if
(
bind
(
sockfd
,
(
struct
sockaddr
*
)
&
sa
,
sizeof
(
sa
))
>=
0
)
{
/* we succeeded to bind */
struct
sockaddr_in
add
;
size
=
sizeof
(
add
);
if
(
getsockname
(
sockfd
,
(
struct
sockaddr
*
)
&
add
,
(
socklen_t
*
)
&
size
)
<
0
)
{
failf
(
data
,
"getsockname() failed"
);
return
CURLE_HTTP_PORT_FAILED
;
size
=
sizeof
(
add
);
if
(
getsockname
(
sockfd
,
(
struct
sockaddr
*
)
&
add
,
(
socklen_t
*
)
&
size
)
<
0
)
{
failf
(
data
,
"getsockname() failed"
);
return
CURLE_HTTP_PORT_FAILED
;
}
}
}
#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