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
e9e89490
Commit
e9e89490
authored
13 years ago
by
Yang Tse
Browse files
Options
Downloads
Patches
Plain Diff
pingpong.c: avoid a memmove call in function Curl_pp_vsendf
parent
a5021071
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/pingpong.c
+7
-4
7 additions, 4 deletions
lib/pingpong.c
with
7 additions
and
4 deletions
lib/pingpong.c
+
7
−
4
View file @
e9e89490
...
...
@@ -195,6 +195,10 @@ CURLcode Curl_pp_vsendf(struct pingpong *pp,
enum
protection_level
data_sec
=
conn
->
data_prot
;
#endif
DEBUGASSERT
(
pp
->
sendleft
==
0
);
DEBUGASSERT
(
pp
->
sendsize
==
0
);
DEBUGASSERT
(
pp
->
sendthis
==
NULL
);
fmt_crlf
=
aprintf
(
"%s
\r\n
"
,
fmt
);
/* append a trailing CRLF */
if
(
!
fmt_crlf
)
return
CURLE_OUT_OF_MEMORY
;
...
...
@@ -236,11 +240,10 @@ CURLcode Curl_pp_vsendf(struct pingpong *pp,
s
,
(
size_t
)
bytes_written
,
conn
);
if
(
bytes_written
!=
(
ssize_t
)
write_len
)
{
/* the whole chunk was not sent, store the rest of the data */
write_len
-=
bytes_written
;
memmove
(
s
,
s
+
bytes_written
,
write_len
+
1
);
/* the whole chunk was not sent, keep it around and adjust sizes */
pp
->
sendthis
=
s
;
pp
->
sendsize
=
pp
->
sendleft
=
write_len
;
pp
->
sendsize
=
write_len
;
pp
->
sendleft
=
write_len
-
bytes_written
;
}
else
{
free
(
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