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
53aa6b21
Commit
53aa6b21
authored
15 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
- Ben Greear provided an update for TFTP that fixes upload.
parent
7842704e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGES
+2
-0
2 additions, 0 deletions
CHANGES
RELEASE-NOTES
+2
-1
2 additions, 1 deletion
RELEASE-NOTES
lib/tftp.c
+39
-33
39 additions, 33 deletions
lib/tftp.c
with
43 additions
and
34 deletions
CHANGES
+
2
−
0
View file @
53aa6b21
...
...
@@ -7,6 +7,8 @@
Changelog
Daniel Stenberg (1 Mar 2010)
- Ben Greear provided an update for TFTP that fixes upload.
- Wesley Miaw reported bug #2958179 which identified a case of looping during
OpenSSL based SSL handshaking even though the multi interface was used and
there was no good reason for it.
...
...
This diff is collapsed.
Click to expand it.
RELEASE-NOTES
+
2
−
1
View file @
53aa6b21
...
...
@@ -22,6 +22,7 @@ This release includes the following bugfixes:
o curl --trace-time not using local time
o off-by-one in the chunked encoding trailer parser
o superfluous blocking for OpenSSL-based SSL connects and multi interface
o TFTP upload
This release includes the following known bugs:
...
...
@@ -31,6 +32,6 @@ This release would not have looked like this without help, code, reports and
advice from friends like these:
Steven M. Schweda, Yang Tse, Jack Zhang, Tom Donovan, Martin Hager,
Daniel Fandrich, Patrick Monnerat, Pat Ray, Wesley Miaw
Daniel Fandrich, Patrick Monnerat, Pat Ray, Wesley Miaw
, Ben Greear
Thanks! (and sorry if I forgot to mention someone)
This diff is collapsed.
Click to expand it.
lib/tftp.c
+
39
−
33
View file @
53aa6b21
...
...
@@ -399,7 +399,7 @@ static CURLcode tftp_parse_option_ack(tftp_state_data_t *state,
tsize
=
strtol
(
value
,
NULL
,
10
);
if
(
!
tsize
)
{
failf
(
data
,
"invalid tsize value in OACK packet"
);
failf
(
data
,
"invalid tsize
-:%s:-
value in OACK packet"
,
value
);
return
CURLE_TFTP_ILLEGAL
;
}
Curl_pgrsSetDownloadSize
(
data
,
tsize
);
...
...
@@ -701,38 +701,44 @@ static CURLcode tftp_tx(tftp_state_data_t *state, tftp_event_t event)
switch
(
event
)
{
case
TFTP_EVENT_ACK
:
/* Ack the packet */
rblock
=
getrpacketblock
(
&
state
->
rpacket
);
if
(
rblock
!=
state
->
block
)
{
/* This isn't the expected block. Log it and up the retry counter */
infof
(
data
,
"Received ACK for block %d, expecting %d
\n
"
,
rblock
,
state
->
block
);
state
->
retries
++
;
/* Bail out if over the maximum */
if
(
state
->
retries
>
state
->
retry_max
)
{
failf
(
data
,
"tftp_tx: giving up waiting for block %d ack"
,
state
->
block
);
res
=
CURLE_SEND_ERROR
;
}
else
{
/* Re-send the data packet */
sbytes
=
sendto
(
state
->
sockfd
,
(
void
*
)
&
state
->
spacket
,
4
+
state
->
sbytes
,
SEND_4TH_ARG
,
(
struct
sockaddr
*
)
&
state
->
remote_addr
,
state
->
remote_addrlen
);
/* Check all sbytes were sent */
if
(
sbytes
<
0
)
{
failf
(
data
,
"%s"
,
Curl_strerror
(
state
->
conn
,
SOCKERRNO
));
res
=
CURLE_SEND_ERROR
;
}
}
return
res
;
case
TFTP_EVENT_OACK
:
if
(
event
==
TFTP_EVENT_ACK
)
{
/* Ack the packet */
rblock
=
getrpacketblock
(
&
state
->
rpacket
);
if
(
rblock
!=
state
->
block
)
{
/* This isn't the expected block. Log it and up the retry counter */
infof
(
data
,
"Received ACK for block %d, expecting %d
\n
"
,
rblock
,
state
->
block
);
state
->
retries
++
;
/* Bail out if over the maximum */
if
(
state
->
retries
>
state
->
retry_max
)
{
failf
(
data
,
"tftp_tx: giving up waiting for block %d ack"
,
state
->
block
);
res
=
CURLE_SEND_ERROR
;
}
else
{
/* Re-send the data packet */
sbytes
=
sendto
(
state
->
sockfd
,
(
void
*
)
&
state
->
spacket
,
4
+
state
->
sbytes
,
SEND_4TH_ARG
,
(
struct
sockaddr
*
)
&
state
->
remote_addr
,
state
->
remote_addrlen
);
/* Check all sbytes were sent */
if
(
sbytes
<
0
)
{
failf
(
data
,
"%s"
,
Curl_strerror
(
state
->
conn
,
SOCKERRNO
));
res
=
CURLE_SEND_ERROR
;
}
}
return
res
;
}
/* This is the expected packet. Reset the counters and send the next
block */
time
(
&
state
->
rx_time
);
state
->
block
++
;
}
else
{
state
->
block
=
1
;
/* first data block is 1 when using OACK */
}
/* This is the expected packet. Reset the counters and send the next
block */
time
(
&
state
->
rx_time
);
state
->
block
++
;
state
->
retries
=
0
;
setpacketevent
(
&
state
->
spacket
,
TFTP_EVENT_DATA
);
setpacketblock
(
&
state
->
spacket
,
state
->
block
);
...
...
@@ -798,7 +804,7 @@ static CURLcode tftp_tx(tftp_state_data_t *state, tftp_event_t event)
break
;
default:
failf
(
data
,
"%s"
,
"tftp_tx: internal error
"
);
failf
(
data
,
"tftp_tx: internal error
, event: %i"
,
(
int
)(
event
)
);
break
;
}
...
...
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