mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-31 02:17:41 +00:00 
			
		
		
		
	Add timeout to last chunk
This commit is contained in:
		
							parent
							
								
									762ae7eb62
								
							
						
					
					
						commit
						ed073d6db0
					
				| @ -35,6 +35,7 @@ import java.io.File; | |||||||
| import java.io.IOException; | import java.io.IOException; | ||||||
| import java.io.RandomAccessFile; | import java.io.RandomAccessFile; | ||||||
| import java.nio.channels.FileChannel; | import java.nio.channels.FileChannel; | ||||||
|  | import java.util.concurrent.TimeUnit; | ||||||
| 
 | 
 | ||||||
| import okhttp3.MediaType; | import okhttp3.MediaType; | ||||||
| 
 | 
 | ||||||
| @ -118,12 +119,12 @@ public class ChunkedUploadRemoteFileOperation extends UploadRemoteFileOperation | |||||||
| //                    // next method will throw an exception | //                    // next method will throw an exception | ||||||
| //                } | //                } | ||||||
| 
 | 
 | ||||||
| //                if (chunkIndex == chunkCount - 1) { |                 if (chunkIndex == chunkCount - 1) { | ||||||
| //                    // Added a high timeout to the last chunk due to when the last chunk |                     // Added a high timeout to the last chunk due to when the last chunk | ||||||
| //                    // arrives to the server with the last PUT, all chunks get assembled |                     // arrives to the server with the last PUT, all chunks get assembled | ||||||
| //                    // within that PHP request, so last one takes longer. |                     // within that PHP request, so last one takes longer. | ||||||
| //                    mPutMethod.getParams().setSoTimeout(LAST_CHUNK_TIMEOUT); |                     mPutMethod.setReadTimeout(LAST_CHUNK_TIMEOUT, TimeUnit.MILLISECONDS); | ||||||
| //                } |                 } | ||||||
| 
 | 
 | ||||||
|                 mPutMethod.setRequestBody(mFileRequestBody); |                 mPutMethod.setRequestBody(mFileRequestBody); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user