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
bc7fe85f
Commit
bc7fe85f
authored
21 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
Just moved around some logic in Curl_write() to make it easier to debug.
parent
89352d92
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/sendf.c
+32
-14
32 additions, 14 deletions
lib/sendf.c
with
32 additions
and
14 deletions
lib/sendf.c
+
32
−
14
View file @
bc7fe85f
...
...
@@ -94,7 +94,6 @@ struct curl_slist *curl_slist_append(struct curl_slist *list,
new_item
->
data
=
strdup
(
data
);
}
if
(
new_item
==
NULL
||
new_item
->
data
==
NULL
)
{
fprintf
(
stderr
,
"Cannot allocate memory for QUOTE list.
\n
"
);
return
NULL
;
}
...
...
@@ -229,6 +228,7 @@ CURLcode Curl_write(struct connectdata *conn, int sockfd,
ssize_t
*
written
)
{
ssize_t
bytes_written
;
CURLcode
retcode
;
(
void
)
conn
;
#ifdef USE_SSLEAY
...
...
@@ -244,13 +244,28 @@ CURLcode Curl_write(struct connectdata *conn, int sockfd,
switch
(
err
)
{
case
SSL_ERROR_WANT_READ
:
case
SSL_ERROR_WANT_WRITE
:
/* this is basicly the EWOULDBLOCK equivalent */
/* The operation did not complete; the same TLS/SSL I/O function
should be called again later. This is basicly an EWOULDBLOCK
equivalent. */
*
written
=
0
;
return
CURLE_OK
;
case
SSL_ERROR_SYSCALL
:
failf
(
conn
->
data
,
"SSL_write() returned SYSCALL, errno = %d
\n
"
,
Curl_ourerrno
());
return
CURLE_SEND_ERROR
;
case
SSL_ERROR_SSL
:
{
/* A failure in the SSL library occurred, usually a
protocol error. The OpenSSL error queue contains more
information on the error. */
char
error_buffer
[
120
];
/* OpenSSL documents that this must be at least
120 bytes long. */
int
sslerror
=
ERR_get_error
();
failf
(
conn
->
data
,
"SSL_write() error: %s
\n
"
,
ERR_error_string
(
sslerror
,
error_buffer
));
return
CURLE_SEND_ERROR
;
}
break
;
}
/* a true error */
failf
(
conn
->
data
,
"SSL_write() return error %d
\n
"
,
err
);
...
...
@@ -271,27 +286,30 @@ CURLcode Curl_write(struct connectdata *conn, int sockfd,
}
if
(
-
1
==
bytes_written
)
{
int
err
=
Curl_ourerrno
();
#ifdef WIN32
if
(
WSAEWOULDBLOCK
==
err
)
if
(
#ifdef WSAEWOULDBLOCK
/* This is how Windows does it */
(
WSAEWOULDBLOCK
==
err
)
#else
/* As pointed out by Christophe Demory on March 11 2003, errno
may be EWOULDBLOCK or on some systems EAGAIN when it returned
due to its inability to send off data without blocking. We
therefor treat both error codes the same here */
if
(
(
EWOULDBLOCK
==
err
)
||
(
EAGAIN
==
err
)
||
(
EINTR
==
err
)
)
/* As pointed out by Christophe Demory on March 11 2003, errno
may be EWOULDBLOCK or on some systems EAGAIN when it returned
due to its inability to send off data without blocking. We
therefor treat both error codes the same here */
(
EWOULDBLOCK
==
err
)
||
(
EAGAIN
==
err
)
||
(
EINTR
==
err
)
#endif
{
)
/* this is just a case of EWOULDBLOCK */
*
written
=
0
;
return
CURLE_OK
;
}
bytes_written
=
0
;
}
#ifdef USE_SSLEAY
}
#endif
*
written
=
bytes_written
;
return
(
-
1
!=
bytes_written
)
?
CURLE_OK
:
CURLE_SEND_ERROR
;
retcode
=
(
-
1
!=
bytes_written
)
?
CURLE_OK
:
CURLE_SEND_ERROR
;
return
retcode
;
}
/* client_write() sends data to the write callback(s)
...
...
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