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
57b6202e
Commit
57b6202e
authored
21 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
New code for BeOS-style non-blocking sockets, provided by Shard and
Jeremy Friesner.
parent
0bbe184f
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
lib/connect.c
+14
-3
14 additions, 3 deletions
lib/connect.c
with
14 additions
and
3 deletions
lib/connect.c
+
14
−
3
View file @
57b6202e
...
...
@@ -103,6 +103,7 @@ int Curl_nonblock(int socket, /* operate on this */
{
#undef SETBLOCK
#ifdef HAVE_O_NONBLOCK
/* most recent unix versions */
int
flags
;
flags
=
fcntl
(
socket
,
F_GETFL
,
0
);
...
...
@@ -114,6 +115,7 @@ int Curl_nonblock(int socket, /* operate on this */
#endif
#ifdef HAVE_FIONBIO
/* older unix versions */
int
flags
;
flags
=
nonblock
;
...
...
@@ -122,6 +124,7 @@ int Curl_nonblock(int socket, /* operate on this */
#endif
#ifdef HAVE_IOCTLSOCKET
/* Windows? */
int
flags
;
flags
=
nonblock
;
return
ioctlsocket
(
socket
,
FIONBIO
,
&
flags
);
...
...
@@ -129,13 +132,21 @@ int Curl_nonblock(int socket, /* operate on this */
#endif
#ifdef HAVE_IOCTLSOCKET_CASE
/* presumably for Amiga */
return
IoctlSocket
(
socket
,
FIONBIO
,
(
long
)
nonblock
);
#define SETBLOCK 4
#endif
#ifdef HAVE_SO_NONBLOCK
/* BeOS */
long
b
=
nonblock
?
1
:
0
;
return
setsockopt
(
socket
,
SOL_SOCKET
,
SO_NONBLOCK
,
&
b
,
sizeof
(
b
));
#define SETBLOCK 5
#endif
#ifdef HAVE_DISABLED_NONBLOCKING
return
0
;
/* returns success */
#define SETBLOCK
5
#define SETBLOCK
6
#endif
#ifndef SETBLOCK
...
...
@@ -348,11 +359,11 @@ int socketerror(int sockfd)
{
int
err
=
0
;
socklen_t
errSize
=
sizeof
(
err
);
#ifdef SO_ERROR
if
(
-
1
==
getsockopt
(
sockfd
,
SOL_SOCKET
,
SO_ERROR
,
(
void
*
)
&
err
,
&
errSize
))
err
=
Curl_ourerrno
();
#endif
return
err
;
}
...
...
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