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
015fc6aa
Commit
015fc6aa
authored
17 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
wrong, revert the previous "fix" and instead check that the fd_set pointer
is non-NULL before we FD_CLR
parent
a739b9bc
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
ares/ares_process.c
+25
-22
25 additions, 22 deletions
ares/ares_process.c
with
25 additions
and
22 deletions
ares/ares_process.c
+
25
−
22
View file @
015fc6aa
...
...
@@ -109,7 +109,7 @@ void ares_process_fd(ares_channel channel,
* otherwise. This is mostly for HP-UX, which could return EAGAIN or
* EWOULDBLOCK. See this man page
*
*
http://devrsrc1.external.hp.com/STKS/cgi-bin/man2html?manpage=/usr/share/man/man2.Z/send.2
*
http://devrsrc1.external.hp.com/STKS/cgi-bin/man2html?manpage=/usr/share/man/man2.Z/send.2
*/
static
int
try_again
(
int
errnum
)
{
...
...
@@ -146,7 +146,7 @@ static void write_tcp_data(ares_channel channel,
ssize_t
wcount
;
size_t
n
;
if
(
!
write_fds
||
(
write_fd
==
ARES_SOCKET_BAD
))
if
(
!
write_fds
&&
(
write_fd
==
ARES_SOCKET_BAD
))
/* no possible action */
return
;
...
...
@@ -167,12 +167,13 @@ static void write_tcp_data(ares_channel channel,
continue
;
}
/* If there's an error and we close this socket, then open
* another with the same fd to talk to another server, then we
* don't want to think that it was the new socket that was
* ready. This is not disastrous, but is likely to result in
* extra system calls and confusion. */
FD_CLR
(
server
->
tcp_socket
,
write_fds
);
if
(
write_fds
)
/* If there's an error and we close this socket, then open
* another with the same fd to talk to another server, then we
* don't want to think that it was the new socket that was
* ready. This is not disastrous, but is likely to result in
* extra system calls and confusion. */
FD_CLR
(
server
->
tcp_socket
,
write_fds
);
/* Count the number of send queue items. */
n
=
0
;
...
...
@@ -267,7 +268,7 @@ static void read_tcp_data(ares_channel channel, fd_set *read_fds,
int
i
;
ssize_t
count
;
if
(
!
read_fds
||
(
read_fd
==
ARES_SOCKET_BAD
))
if
(
!
read_fds
&&
(
read_fd
==
ARES_SOCKET_BAD
))
/* no possible action */
return
;
...
...
@@ -287,12 +288,13 @@ static void read_tcp_data(ares_channel channel, fd_set *read_fds,
continue
;
}
/* If there's an error and we close this socket, then open
* another with the same fd to talk to another server, then we
* don't want to think that it was the new socket that was
* ready. This is not disastrous, but is likely to result in
* extra system calls and confusion. */
FD_CLR
(
server
->
tcp_socket
,
read_fds
);
if
(
read_fds
)
/* If there's an error and we close this socket, then open
* another with the same fd to talk to another server, then we
* don't want to think that it was the new socket that was
* ready. This is not disastrous, but is likely to result in
* extra system calls and confusion. */
FD_CLR
(
server
->
tcp_socket
,
read_fds
);
if
(
server
->
tcp_lenbuf_pos
!=
2
)
{
...
...
@@ -363,7 +365,7 @@ static void read_udp_packets(ares_channel channel, fd_set *read_fds,
ssize_t
count
;
unsigned
char
buf
[
PACKETSZ
+
1
];
if
(
!
read_fds
||
(
read_fd
==
ARES_SOCKET_BAD
))
if
(
!
read_fds
&&
(
read_fd
==
ARES_SOCKET_BAD
))
/* no possible action */
return
;
...
...
@@ -384,12 +386,13 @@ static void read_udp_packets(ares_channel channel, fd_set *read_fds,
continue
;
}
/* If there's an error and we close this socket, then open
* another with the same fd to talk to another server, then we
* don't want to think that it was the new socket that was
* ready. This is not disastrous, but is likely to result in
* extra system calls and confusion. */
FD_CLR
(
server
->
udp_socket
,
read_fds
);
if
(
read_fds
)
/* If there's an error and we close this socket, then open
* another with the same fd to talk to another server, then we
* don't want to think that it was the new socket that was
* ready. This is not disastrous, but is likely to result in
* extra system calls and confusion. */
FD_CLR
(
server
->
udp_socket
,
read_fds
);
count
=
sread
(
server
->
udp_socket
,
buf
,
sizeof
(
buf
));
if
(
count
==
-
1
&&
try_again
(
SOCKERRNO
))
...
...
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