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
a77d18ef
Commit
a77d18ef
authored
12 years ago
by
Marc Hoersken
Browse files
Options
Downloads
Patches
Plain Diff
tests/server/sockfilt.c: Improved log error messages
Include error code and parameters in error messages.
parent
dd561c38
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
tests/server/sockfilt.c
+13
-7
13 additions, 7 deletions
tests/server/sockfilt.c
with
13 additions
and
7 deletions
tests/server/sockfilt.c
+
13
−
7
View file @
a77d18ef
...
...
@@ -265,7 +265,8 @@ static ssize_t fullread(int filedes, void *buffer, size_t nbytes)
error
=
ERRNO
;
if
((
error
==
EINTR
)
||
(
error
==
EAGAIN
))
continue
;
logmsg
(
"unrecoverable read() failure: %s"
,
strerror
(
error
));
logmsg
(
"unrecoverable read() failure: (%d) %s"
,
error
,
strerror
(
error
));
return
-
1
;
}
...
...
@@ -309,7 +310,8 @@ static ssize_t fullwrite(int filedes, const void *buffer, size_t nbytes)
error
=
ERRNO
;
if
((
error
==
EINTR
)
||
(
error
==
EAGAIN
))
continue
;
logmsg
(
"unrecoverable write() failure: %s"
,
strerror
(
error
));
logmsg
(
"unrecoverable write() failure: (%d) %s"
,
error
,
strerror
(
error
));
return
-
1
;
}
...
...
@@ -780,9 +782,13 @@ static bool juggle(curl_socket_t *sockfdp,
if
(
*
mode
==
PASSIVE_LISTEN
)
{
/* there's no stream set up yet, this is an indication that there's a
client connecting. */
sockfd
=
accept
(
sockfd
,
NULL
,
NULL
);
if
(
CURL_SOCKET_BAD
==
sockfd
)
logmsg
(
"accept() failed"
);
listenfd
=
sockfd
;
sockfd
=
accept
(
listenfd
,
NULL
,
NULL
);
if
(
CURL_SOCKET_BAD
==
sockfd
)
{
error
=
SOCKERRNO
;
logmsg
(
"accept(%d, NULL, NULL) failed with error: (%d) %s"
,
listenfd
,
error
,
strerror
(
error
));
}
else
{
logmsg
(
"====> Client connect"
);
if
(
!
write_stdout
(
"CNCT
\n
"
,
5
))
...
...
@@ -954,8 +960,8 @@ static curl_socket_t sockdaemon(curl_socket_t sock,
rc
=
listen
(
sock
,
5
);
if
(
0
!=
rc
)
{
error
=
SOCKERRNO
;
logmsg
(
"listen() failed with error: (%d) %s"
,
error
,
strerror
(
error
));
logmsg
(
"listen(
%d, 5
) failed with error: (%d) %s"
,
sock
,
error
,
strerror
(
error
));
sclose
(
sock
);
return
CURL_SOCKET_BAD
;
}
...
...
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