Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-12755

Remote upload stuck in infinite loop if server sends keep-alive

    Details

      Activity

      Hide
      thenickdude thenickdude [X] (Inactive) added a comment - - edited

      The proposed patch seems to correctly implement a timeout, which prevents the loop from running forever. However, it's still impossible to upload avatars from servers which use keepalive. Because these servers hold the connection open after sending the image, feof will never return true. The only way this loop will terminate is by timing out, which will cause the upload to fail. For example, uploading this avatar does not work:

      http://awanderingtiger.weebly.com/uploads/2/0/4/0/20408477/9446501_orig.png

      The loop needs to check if it has already received all the bytes that were promised by the server response's Content-Length header (if present), and return the successful upload. I'll submit a patch with that additional code.

      Show
      thenickdude thenickdude [X] (Inactive) added a comment - - edited The proposed patch seems to correctly implement a timeout, which prevents the loop from running forever. However, it's still impossible to upload avatars from servers which use keepalive. Because these servers hold the connection open after sending the image, feof will never return true. The only way this loop will terminate is by timing out, which will cause the upload to fail. For example, uploading this avatar does not work: http://awanderingtiger.weebly.com/uploads/2/0/4/0/20408477/9446501_orig.png The loop needs to check if it has already received all the bytes that were promised by the server response's Content-Length header (if present), and return the successful upload. I'll submit a patch with that additional code.
      Hide
      thenickdude thenickdude [X] (Inactive) added a comment -

      I'm a newbie to Github, so I wasn't able to figure out how to submit a revised pull request, sorry. Attached is functions_upload.php with my changes to support keepalive, based on your branch.

      Show
      thenickdude thenickdude [X] (Inactive) added a comment - I'm a newbie to Github, so I wasn't able to figure out how to submit a revised pull request, sorry. Attached is functions_upload.php with my changes to support keepalive, based on your branch.
      Hide
      Marc Marc added a comment -

      Thank you. Your changes have been added to the PR.

      Show
      Marc Marc added a comment - Thank you. Your changes have been added to the PR.

        People

        • Assignee:
          Marc Marc
          Reporter:
          Marc Marc
        • Votes:
          0 Vote for this issue
          Watchers:
          3 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved:

            Development