X Tutup
Skip to content

Add flexibility to getFileSizeViaCurl#40065

Merged
phil-davis merged 2 commits intomasterfrom
flexible-getFileSizeViaCurl
May 19, 2022
Merged

Add flexibility to getFileSizeViaCurl#40065
phil-davis merged 2 commits intomasterfrom
flexible-getFileSizeViaCurl

Conversation

@phil-davis
Copy link
Contributor

@phil-davis phil-davis commented May 10, 2022

Description

See discussion in the related issue, and the code comments in this PR.

CURLOPT_HEADER is not always causing the headers to actually be returned. That is a bug somewhere in php-curl and/or libcurl and their "integration" on Ubuntu 20.04 and 22.04.

This PR adds to the code of getFileSizeViaCurl so that it uses CURLOPT_HEADERFUNCTION and finds the Content-Length from there, if the data is not returned by CURLOPT_HEADER.

I have confirmed that this works on Ubuntu 20.04 - see PR #40006 which now passes. And locally on Ubuntu 22.04 in a VM.

Related Issue

#38348

How Has This Been Tested?

CI with Ubuntu 18.04 (this PR) and 20.04 (PR #40006 )

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:
  • Changelog item, see TEMPLATE

@phil-davis phil-davis self-assigned this May 10, 2022
@phil-davis phil-davis force-pushed the flexible-getFileSizeViaCurl branch from b133f47 to d998335 Compare May 10, 2022 09:03
@owncloud owncloud deleted a comment from update-docs bot May 10, 2022
@phil-davis phil-davis marked this pull request as ready for review May 10, 2022 09:09
@phil-davis phil-davis force-pushed the flexible-getFileSizeViaCurl branch from d998335 to a8ae58f Compare May 16, 2022 08:01
@phil-davis phil-davis requested a review from jvillafanez May 16, 2022 08:56
@phil-davis phil-davis force-pushed the flexible-getFileSizeViaCurl branch from a63b3ce to 1b826e4 Compare May 16, 2022 09:07
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

75.0% 75.0% Coverage
0.0% 0.0% Duplication

@phil-davis phil-davis marked this pull request as draft May 16, 2022 11:19
@phil-davis
Copy link
Contributor Author

Note: this changes some real code. I will merge after 10.10.0 release is really happening, just to reduce any chance of a conflict in merging-back the 10.10.0 release branch.

There is no hurry to actually merge this to master - it can happily end up in some future release.

@phil-davis phil-davis marked this pull request as ready for review May 19, 2022 16:18
@phil-davis phil-davis merged commit 5f4a27f into master May 19, 2022
@delete-merged-branch delete-merged-branch bot deleted the flexible-getFileSizeViaCurl branch May 19, 2022 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup