Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
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
liblongpath
liblongpath-rsync
Commits
e028b9ff
Commit
e028b9ff
authored
Jan 02, 2004
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Call bind() with the right ai_addr/ai_addrlen info.
parent
9c07d253
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
socket.c
socket.c
+4
-6
No files found.
socket.c
View file @
e028b9ff
...
...
@@ -80,8 +80,7 @@ static int establish_proxy_connection(int fd, char *host, int port)
}
/* throw away the rest of the HTTP header */
while
(
1
)
{
for
(
cp
=
buffer
;
cp
<
&
buffer
[
sizeof
(
buffer
)
-
1
];
cp
++
)
{
for
(
cp
=
buffer
;
cp
<
&
buffer
[
sizeof
(
buffer
)
-
1
];
cp
++
)
{
if
(
read
(
fd
,
cp
,
1
)
!=
1
)
{
rprintf
(
FERROR
,
"failed to read from proxy: %s
\n
"
,
strerror
(
errno
));
...
...
@@ -103,8 +102,7 @@ static int establish_proxy_connection(int fd, char *host, int port)
* Try to set the local address for a newly-created socket. Return -1
* if this fails.
**/
int
try_bind_local
(
int
s
,
int
ai_family
,
int
ai_socktype
,
int
try_bind_local
(
int
s
,
int
ai_family
,
int
ai_socktype
,
const
char
*
bind_address
)
{
int
error
;
...
...
@@ -322,8 +320,8 @@ static int open_socket_in(int type, int port, const char *bind_address,
setsockopt
(
s
,
SOL_SOCKET
,
SO_REUSEADDR
,
(
char
*
)
&
one
,
sizeof
one
);
/*
now we've got a socket - we need to bind it
*/
if
(
bind
(
s
,
all_ai
->
ai_addr
,
all_ai
->
ai_addrlen
)
<
0
)
{
/*
Now we've got a socket - we need to bind it.
*/
if
(
bind
(
s
,
resp
->
ai_addr
,
resp
->
ai_addrlen
)
<
0
)
{
/* Nope, try another */
close
(
s
);
continue
;
...
...
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