View Issue Details

IDProjectCategoryView StatusLast Update
0005724Talertwisterpublic2019-12-20 18:12
ReporterMarcello Stanisci Assigned ToMarcello Stanisci Resolution deadline
ImplementerReviewer 
Release signed byDeployed by 
VerifierCommunicator 
Data protection authority notification requiredNo  
CSIRT notification requiredNo  
Estimated effort (hours)Actual effort (hours)0 
Fast-trackNo
Work packagenone
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Versiongit (master) 
Target Version0.6Fixed in Version0.6 
Summary0005724: code repetition and conflicting parameters.
DescriptionThe Twister has some code repetition where both the POST and the PUT cases set the CURLOPT_INFILESIZE option. And more, this option sounds like conflicting -- or doing "the same thing" -- as CURLOPT_POSTFIELDSIZE.

We should either not repeat the code, or cut entirely off the CURLOPT_INFILESIZE paths.
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

Marcello Stanisci

2019-06-03 18:27

reporter   ~0014502

As per manpage, CURLOPT_POSTFIELDSIZE should be used when the payload size should
NOT be calculated by libcurl; for example, when binary files are being sent. That's due to the
fact that libcurl uses strlen() to calculate that size.

Marcello Stanisci

2019-06-03 18:33

reporter   ~0014503

CURLOPT_INFILESIZE, OTOH, sounds like to be used when uploading *files*, that we also never do with the Twister.

So in short, the two options look not important for the Twister.

Agree?

Marcello Stanisci

2019-06-03 19:17

reporter   ~0014504

Last edited: 2019-06-03 19:22

Well, testing confirms that POSTs want CURLOPT_POSTFIELDSIZE and PUTs want CURLOPT_INFILESIZE.

The real optimization was to set all the options (including read/write callbacks) but the method on the easy handle *before* even checking which method we are going to perform, and set the method as a last step. This is not breaking, since if a method doesn't need a callback/option, it will ignore it.

The gain is that all the common options set by the *three* methods (GET/POST/PUT) are mentioned in *one* place in the code, instead of three.

Tested against the Twister testcase itself, and on exchange's and merchant's twisted tests.

Issue History

Date ModifiedUsernameFieldChange
2019-05-15 14:58Marcello StanisciNew Issue
2019-05-15 14:58Marcello StanisciStatusnew => assigned
2019-05-15 14:58Marcello StanisciAssigned To => Marcello Stanisci
2019-06-03 18:27Marcello StanisciNote Added: 0014502
2019-06-03 18:33Marcello StanisciNote Added: 0014503
2019-06-03 19:17Marcello StanisciNote Added: 0014504
2019-06-03 19:18Marcello StanisciNote Edited: 0014504
2019-06-03 19:18Marcello StanisciNote Edited: 0014504
2019-06-03 19:22Marcello StanisciNote Edited: 0014504
2019-06-03 19:22Marcello StanisciNote Edited: 0014504
2019-06-03 20:16Marcello StanisciStatusassigned => informing
2019-06-03 20:16Marcello StanisciResolutionopen => fixed
2019-06-05 19:28Christian GrothoffProduct Version => git (master)
2019-06-05 19:28Christian GrothoffFixed in Version => 0.6
2019-06-05 19:28Christian GrothoffTarget Version => 0.6
2019-12-20 18:12Christian GrothoffStatusinforming => closed