changeset 99:be17dd3f6927

Small fixes in HTTP server and libusb1 backend
author Ivo Smits <Ivo@UCIS.nl>
date Sun, 17 Aug 2014 15:35:23 +0200
parents c9bc014bdbe8
children 04c56f31db37
files Net/HTTP.cs USBLib/Communication/LibUsb1/libusb1.cs
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Net/HTTP.cs	Tue Jul 08 16:52:10 2014 +0200
+++ b/Net/HTTP.cs	Sun Aug 17 15:35:23 2014 +0200
@@ -721,8 +721,14 @@
 		}
 
 		private void SendErrorAndClose(int code) {
-			SendErrorResponse(code);
-			Close();
+			try {
+				SendErrorResponse(code);
+			} catch (IOException) {
+			} catch (SocketException) {
+			} catch (ObjectDisposedException) {
+			} finally {
+				Close();
+			}
 		}
 		private void Close() {
 			if (State == HTTPConnectionState.Closed) return;
--- a/USBLib/Communication/LibUsb1/libusb1.cs	Tue Jul 08 16:52:10 2014 +0200
+++ b/USBLib/Communication/LibUsb1/libusb1.cs	Sun Aug 17 15:35:23 2014 +0200
@@ -29,7 +29,7 @@
 	}
 	unsafe static class libusb1 {
 		const CallingConvention LIBUSB1_CC = CallingConvention.Winapi;
-		const String LIBUSB1_DLL = "libusb-1.0.dll";
+		const String LIBUSB1_DLL = "libusb-1.0";
 
 		[StructLayout(LayoutKind.Sequential, Pack = 1)]
 		public struct libusb_device_descriptor {