Anonymous | Login | 03-03-2021 00:03 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | |||||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | |||||||
0006430 | [Squeak] Network | trivial | always | 04-18-07 20:33 | 04-19-07 07:32 | |||||||
Reporter | dletz | View Status | public | |||||||||
Assigned To | cdegroot | |||||||||||
Priority | normal | Resolution | open | |||||||||
Status | assigned | Product Version | 3.9 | |||||||||
Summary | 0006430: Socket>>sendStreamContents:checkBlock: uses wrong send loop | |||||||||||
Description |
Hello Everyone, when adding progress information to the FTPClient I found that this message has a Bug. It should call the "checkBlock" every 5000 thousand bytes - but does call it only once at the end of the file transfer. To fix this i suggest replacing the two lines: [[stream atEnd and: [checkBlock value]] whileFalse: [ with: [[stream atEnd not and: [checkBlock value]] whileTrue: [ For reference I provide the full message code here: sendStreamContents: stream checkBlock: checkBlock "Send the data in the stream. Close the stream after you are done. After each block of data evaluate checkBlock and abort if it returns false. Usefull for directly sending contents of a file without reading into memory first." | chunkSize buffer | chunkSize _ 5000. buffer _ ByteArray new: chunkSize. stream binary. [[stream atEnd and: [checkBlock value]] whileFalse: [ buffer _ stream next: chunkSize into: buffer. self sendData: buffer]] ensure: [stream close] |
|||||||||||
Additional Information | Providing fix as changeset | |||||||||||
Attached Files |
![]() |
|||||||||||
|
Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
44 total queries executed. 34 unique queries executed. |