[ 
https://issues.apache.org/jira/browse/GUACAMOLE-44?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15313249#comment-15313249
 ] 

ASF GitHub Bot commented on GUACAMOLE-44:
-----------------------------------------

GitHub user mike-jumper opened a pull request:

    https://github.com/apache/incubator-guacamole-client/pull/14

    GUACAMOLE-44: Slice uploaded files into chunks (DO NOT slurp entire file 
into memory)

    The old file upload code was inherently flawed as it required reading the 
entire file into memory. Besides being a poor user experience (long delay 
before upload begins), this could even crash the browser if the file was large 
enough.
    
    This change adds a new writer-style object, `Guacamole.FileWriter`, whose 
`sendFile()` efficiently streams a provided `File` over an underlying 
`Guacamole.OutputStream`. The implementation streams the `File` properly via 
`slice()`; it is not read in its entirety into memory.
    
    As this required wrapping a `Guacamole.ArrayBufferWriter` and being aware 
of the Guacamole protocol's instruction size restrictions, this change replaces 
the old magic 6048 with a well-documented constant, 
`Guacamole.ArrayBufferWriter.DEFAULT_BLOB_LENGTH`, and exposes the blob length 
used by any particular `Guacamole.ArrayBufferWriter` instance with a mutable 
`blobLength` property.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mike-jumper/incubator-guacamole-client 
slice-uploads

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-guacamole-client/pull/14.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #14
    
----
commit 2c977a31349848826596ef510993a45217145ccc
Author: Michael Jumper <[email protected]>
Date:   2016-06-02T22:40:09Z

    GUACAMOLE-44: Explicitly define and document the magic 6048-byte blob 
within ArrayBufferWriter. Allow the blob size to be overridden.

commit 998eff9ca3878fe419690bf7ba7d582606ce6821
Author: Michael Jumper <[email protected]>
Date:   2016-06-02T22:41:08Z

    GUACAMOLE-44: Implement Guacamole.FileWriter which provides for streaming 
local files over a Guacamole.OutputStream.

commit 2934f4a9be67952d2be03124fc4ff34a3fd9c33b
Author: Michael Jumper <[email protected]>
Date:   2016-06-02T22:51:15Z

    GUACAMOLE-44: Use Guacamole.FileWriter within ManagedFileUpload (rather 
than load entire file into memory).

----


> Upload/download of files that are more than 1 GB fail
> -----------------------------------------------------
>
>                 Key: GUACAMOLE-44
>                 URL: https://issues.apache.org/jira/browse/GUACAMOLE-44
>             Project: Guacamole
>          Issue Type: Bug
>          Components: guacamole
>            Reporter: Michael Jumper
>            Assignee: Michael Jumper
>             Fix For: 0.9.10-incubating
>
>
> {panel:bgColor=#FFFFEE}
> *The description of this issue was copied from 
> [GUAC-784|https://glyptodon.org/jira/browse/GUAC-784], an issue in the JIRA 
> instance used by the Guacamole project prior to its acceptance into the 
> Apache Incubator.*
> Comments, attachments, related issues, and history from prior to acceptance 
> *have not been copied* and can be found instead at the original issue.
> {panel}
> From Chrome, after attempting upload of a file greater than 1 GB in size:
> {code:none}
> Uncaught TypeError: Cannot read property 'length' of null client-ui.js:1525
> _upload_file.reader.onloadend
> {code}
> Uploading this file via Firefox simply crashes the browser. The same issue 
> will occur for file downloads, as Guacamole always creates the entire file in 
> memory before starting the transfer.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to