Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ticket/12755] Add timeout to remote upload to prevent infinite loop #2633

Merged
merged 5 commits into from Jun 24, 2014

Conversation

@marc1706
Copy link
Member

commented Jun 21, 2014

// Cancel upload if we exceed timeout
if ((time() - $upload_start) >= $this->upload_timeout)
{
$file = new fileerror($user->lang[$this->error_prefix . 'EMPTY_REMOTE_DATA']);

This comment has been minimized.

Copy link
@dhruvgoel92

dhruvgoel92 Jun 21, 2014

Contributor

Maybe we should display timeout error instead of empty remote data?

This comment has been minimized.

Copy link
@nickvergessen

nickvergessen Jun 23, 2014

Contributor

bump?

marc1706 added 3 commits Jun 23, 2014
[ticket/12755] Terminate upload loop if upload reaches filesize
Terminate the upload loop if the expected filesize has been reached instead
of trying to read more bytes until the timeout has been reached.

PHPBB3-12755
$length = false;
$timer_stop = time() + $this->upload_timeout;
while (!($length && $filesize >= $length) && !@feof($fsock))

This comment has been minimized.

Copy link
@bantu

bantu Jun 24, 2014

Member

de morgan

This comment has been minimized.

Copy link
@bantu

bantu Jun 24, 2014

Member

$filesize is always 0 ?

This comment has been minimized.

Copy link
@bantu

bantu Jun 24, 2014

Member

ah no, it isn't

This comment has been minimized.

Copy link
@bantu

bantu Jun 24, 2014

Member

while ((!$length || $filesize < $length) && !@feof($fsock)))

bantu added a commit that referenced this pull request Jun 24, 2014
Merge pull request #2633 from marc1706/ticket/12755
[ticket/12755] Add timeout to remote upload to prevent infinite loop

* marc1706/ticket/12755:
  [ticket/12755] Apply de morgan to conditional
  [ticket/12755] Terminate upload loop if upload reaches filesize
  [ticket/12755] Change upload in remote_upload() method to fit get_remote_file
  [ticket/12755] Add language string for timed out remote upload
  [ticket/12755] Add timeout to remote upload to prevent infinite loop

@bantu bantu merged commit 8b3cc9a into phpbb:develop-olympus Jun 24, 2014

1 check was pending

continuous-integration/travis-ci The Travis CI build is in progress
Details

@marc1706 marc1706 deleted the marc1706:ticket/12755 branch Jan 23, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.