2006-02-22 James Willcox <snorp@snorp.net>

* src/Database.cs (DownloadSong): don't assume that the length
        argument is valid.


svn path=/trunk/daap-sharp/; revision=57188
This commit is contained in:
James Willcox 2006-02-23 00:14:00 +00:00
Родитель a996448d1f
Коммит 6ec962230e
2 изменённых файлов: 11 добавлений и 7 удалений

Просмотреть файл

@ -1,3 +1,8 @@
2006-02-22 James Willcox <snorp@snorp.net>
* src/Database.cs (DownloadSong): don't assume that the length
argument is valid.
2006-02-21 James Willcox <snorp@snorp.net>
* configure.ac: bump to 0.3.1

Просмотреть файл

@ -376,13 +376,12 @@ namespace DAAP {
try {
using (BinaryReader reader = new BinaryReader (response.GetResponseStream ())) {
int count = 0;
while (count < response.ContentLength) {
byte[] buf = reader.ReadBytes ((int) Math.Min (ChunkLength,
response.ContentLength - ChunkLength));
writer.Write (buf);
count += buf.Length;
}
byte[] buf = new byte[ChunkLength];
do {
count = reader.Read (buf, 0, ChunkLength);
writer.Write (buf, 0, count);
} while (count == ChunkLength);
}
} finally {
writer.Close ();