Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
b6423939
Commit
b6423939
authored
Jun 20, 2012
by
Chris Young
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more getaddrinfo compatibility
parent
8d18f1f7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
src/netops.c
+5
-3
No files found.
src/netops.c
View file @
b6423939
...
...
@@ -66,12 +66,15 @@ static int getaddrinfo(const char *host, const char *port, struct addrinfo *hint
else
ainfo
->
ai_port
=
atol
(
port
);
ainfo
->
ai_addrlen
=
ainfo
->
ai_hostent
->
h_length
;
memcpy
(
&
ainfo
->
ai_addr_in
.
sin_addr
,
ainfo
->
ai_hostent
->
h_addr_list
[
0
],
ainfo
->
ai_hostent
->
h_length
);
ainfo
->
ai_addr_in
.
sin_family
=
ainfo
->
ai_hostent
->
h_addrtype
;
ainfo
->
ai_protocol
=
0
;
ainfo
->
ai_socktype
=
hints
->
ai_socktype
;
ainfo
->
ai_family
=
ainfo
->
ai_hostent
->
h_addrtype
;
ainfo
->
ai_addr_in
.
sin_family
=
ainfo
->
ai_family
;
ainfo
->
ai_addr_in
.
sin_port
=
ainfo
->
ai_port
;
ainfo
->
ai_addr
=
(
struct
addrinfo
*
)
&
ainfo
->
ai_addr_in
;
ainfo
->
ai_addrlen
=
sizeof
(
struct
sockaddr_in
);
*
info
=
ainfo
;
...
...
@@ -87,7 +90,6 @@ static int getaddrinfo(const char *host, const char *port, struct addrinfo *hint
memcpy
(
&
ai
->
ai_next
,
ainfo
,
sizeof
(
struct
addrinfo
));
memcpy
(
&
ai
->
ai_next
->
ai_addr_in
.
sin_addr
,
ainfo
->
ai_hostent
->
h_addr_list
[
p
],
ainfo
->
ai_hostent
->
h_length
);
ai
->
ai_next
->
ai_addr
=
(
struct
addrinfo
*
)
&
ai
->
ai_next
->
ai_addr_in
;
ainfo
->
ai_addrlen
=
ainfo
->
ai_hostent
->
h_length
;
ai
=
ai
->
ai_next
;
}
...
...
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