Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c66c14dd
Commit
c66c14dd
authored
Dec 11, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Dec 26, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Move the buffer used by inet_ntoa into the per-thread data.
parent
3a56f9b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
9 deletions
+4
-9
socket.c
dlls/ws2_32/socket.c
+4
-8
sock.c
dlls/ws2_32/tests/sock.c
+0
-1
No files found.
dlls/ws2_32/socket.c
View file @
c66c14dd
...
@@ -378,6 +378,7 @@ struct per_thread_data
...
@@ -378,6 +378,7 @@ struct per_thread_data
int
he_len
;
int
he_len
;
int
se_len
;
int
se_len
;
int
pe_len
;
int
pe_len
;
char
ntoa_buffer
[
16
];
/* 4*3 digits + 3 '.' + 1 '\0' */
};
};
/* internal: routing description information */
/* internal: routing description information */
...
@@ -3525,17 +3526,12 @@ WS_u_short WINAPI WS_ntohs(WS_u_short netshort)
...
@@ -3525,17 +3526,12 @@ WS_u_short WINAPI WS_ntohs(WS_u_short netshort)
*/
*/
char
*
WINAPI
WS_inet_ntoa
(
struct
WS_in_addr
in
)
char
*
WINAPI
WS_inet_ntoa
(
struct
WS_in_addr
in
)
{
{
/* use "buffer for dummies" here because some applications have a
* propensity to decode addresses in ws_hostent structure without
* saving them first...
*/
static
char
dbuffer
[
16
];
/* Yes, 16: 4*3 digits + 3 '.' + 1 '\0' */
char
*
s
=
inet_ntoa
(
*
((
struct
in_addr
*
)
&
in
));
char
*
s
=
inet_ntoa
(
*
((
struct
in_addr
*
)
&
in
));
if
(
s
)
if
(
s
)
{
{
strcpy
(
dbuffer
,
s
);
struct
per_thread_data
*
data
=
get_per_thread_data
();
return
dbuffer
;
strcpy
(
data
->
ntoa_buffer
,
s
);
return
data
->
ntoa_buffer
;
}
}
SetLastError
(
wsaErrno
());
SetLastError
(
wsaErrno
());
return
NULL
;
return
NULL
;
...
...
dlls/ws2_32/tests/sock.c
View file @
c66c14dd
...
@@ -7073,7 +7073,6 @@ static void test_inet_ntoa(void)
...
@@ -7073,7 +7073,6 @@ static void test_inet_ntoa(void)
thread
=
CreateThread
(
NULL
,
0
,
inet_ntoa_thread_proc
,
event
,
0
,
&
tid
);
thread
=
CreateThread
(
NULL
,
0
,
inet_ntoa_thread_proc
,
event
,
0
,
&
tid
);
WaitForSingleObject
(
event
[
0
],
3000
);
WaitForSingleObject
(
event
[
0
],
3000
);
todo_wine
ok
(
!
strcmp
(
str
,
"1.2.3.4"
),
"expected 1.2.3.4, got %s
\n
"
,
str
);
ok
(
!
strcmp
(
str
,
"1.2.3.4"
),
"expected 1.2.3.4, got %s
\n
"
,
str
);
SetEvent
(
event
[
1
]);
SetEvent
(
event
[
1
]);
...
...
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