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
cba9838e
Commit
cba9838e
authored
23 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
Somewhat ugly fix to deal with non-blocking sockets. We just loop and try
again. THIS IS NOT A NICE FIX.
parent
b6dba9f5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/http.c
+24
-4
24 additions, 4 deletions
lib/http.c
with
24 additions
and
4 deletions
lib/http.c
+
24
−
4
View file @
cba9838e
...
...
@@ -128,8 +128,10 @@ static
CURLcode
add_buffer_send
(
int
sockfd
,
struct
connectdata
*
conn
,
send_buffer
*
in
,
long
*
bytes_written
)
{
size_t
amount
;
CURLcode
result
;
ssize_t
amount
;
CURLcode
res
;
char
*
ptr
;
int
size
;
if
(
conn
->
data
->
set
.
verbose
)
{
fputs
(
"> "
,
conn
->
data
->
set
.
err
);
...
...
@@ -137,7 +139,25 @@ CURLcode add_buffer_send(int sockfd, struct connectdata *conn, send_buffer *in,
fwrite
(
in
->
buffer
,
in
->
size_used
,
1
,
conn
->
data
->
set
.
err
);
}
result
=
Curl_write
(
conn
,
sockfd
,
in
->
buffer
,
in
->
size_used
,
&
amount
);
/* The looping below is required since we use non-blocking sockets, but due
to the circumstances we will just loop and try again and again etc */
ptr
=
in
->
buffer
;
size
=
in
->
size_used
;
do
{
res
=
Curl_write
(
conn
,
sockfd
,
ptr
,
size
,
&
amount
);
if
(
CURLE_OK
!=
res
)
break
;
if
(
amount
!=
size
)
{
size
+=
amount
;
ptr
+=
amount
;
}
else
break
;
}
while
(
1
);
if
(
in
->
buffer
)
free
(
in
->
buffer
);
...
...
@@ -145,7 +165,7 @@ CURLcode add_buffer_send(int sockfd, struct connectdata *conn, send_buffer *in,
*
bytes_written
=
amount
;
return
res
ult
;
return
res
;
}
...
...
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