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> 2006-02-21 James Willcox <snorp@snorp.net>
* configure.ac: bump to 0.3.1 * configure.ac: bump to 0.3.1

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

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