2006-08-06 James Willcox <snorp@snorp.net>
* src/Server.cs: when opening tracks for streaming, use FileAccess.Read * src/ContentCodeBag.cs: don't specify the 'content-code' embedded resource specifically since when building on Windows it gets assigned a totally outrageous name. svn path=/trunk/daap-sharp/; revision=64113
This commit is contained in:
Родитель
c5fb8b0b25
Коммит
2395cd6879
|
@ -1,3 +1,10 @@
|
|||
2006-08-06 James Willcox <snorp@snorp.net>
|
||||
|
||||
* src/Server.cs: when opening tracks for streaming, use FileAccess.Read
|
||||
* src/ContentCodeBag.cs: don't specify the 'content-code' embedded
|
||||
resource specifically since when building on Windows it gets assigned
|
||||
a totally outrageous name.
|
||||
|
||||
2006-07-13 James Willcox <snorp@snorp.net>
|
||||
|
||||
* src/ContentCodeBag.cs: add some missing content codes for use
|
||||
|
|
|
@ -57,17 +57,19 @@ namespace DAAP {
|
|||
get {
|
||||
if (defaultBag == null) {
|
||||
|
||||
|
||||
using (BinaryReader reader = new BinaryReader (Assembly.GetExecutingAssembly ().GetManifestResourceStream ("content-codes"))) {
|
||||
MemoryStream buf = new MemoryStream ();
|
||||
byte[] bytes = null;
|
||||
|
||||
do {
|
||||
bytes = reader.ReadBytes (ChunkLength);
|
||||
buf.Write (bytes, 0, bytes.Length);
|
||||
} while (bytes.Length == ChunkLength);
|
||||
// this is crappy
|
||||
foreach (string name in Assembly.GetExecutingAssembly().GetManifestResourceNames()) {
|
||||
using (BinaryReader reader = new BinaryReader(Assembly.GetExecutingAssembly().GetManifestResourceStream(name))) {
|
||||
MemoryStream buf = new MemoryStream();
|
||||
byte[] bytes = null;
|
||||
|
||||
defaultBag = ContentCodeBag.ParseCodes (buf.GetBuffer ());
|
||||
do {
|
||||
bytes = reader.ReadBytes(ChunkLength);
|
||||
buf.Write(bytes, 0, bytes.Length);
|
||||
} while (bytes.Length == ChunkLength);
|
||||
|
||||
defaultBag = ContentCodeBag.ParseCodes(buf.GetBuffer());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ namespace DAAP {
|
|||
public void WriteResponseFile (Socket client, string file, long offset) {
|
||||
FileInfo info = new FileInfo (file);
|
||||
|
||||
FileStream stream = info.Open (FileMode.Open, FileAccess.Read);
|
||||
FileStream stream = info.Open(FileMode.Open, FileAccess.Read, FileShare.Read);
|
||||
WriteResponseStream (client, stream, info.Length, offset);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче