comparison Net/HTTP.cs @ 101:04c56f31db37

Merge
author Ivo Smits <Ivo@UCIS.nl>
date Mon, 29 Sep 2014 01:36:27 +0200
parents 2b5e7bb9b979 be17dd3f6927
children a03e6ad0051f
comparison
equal deleted inserted replaced
100:2b5e7bb9b979 101:04c56f31db37
730 State = HTTPConnectionState.Closed; 730 State = HTTPConnectionState.Closed;
731 return Reader; 731 return Reader;
732 } 732 }
733 733
734 private void SendErrorAndClose(int code) { 734 private void SendErrorAndClose(int code) {
735 SendErrorResponse(code); 735 try {
736 Close(); 736 SendErrorResponse(code);
737 } catch (IOException) {
738 } catch (SocketException) {
739 } catch (ObjectDisposedException) {
740 } finally {
741 Close();
742 }
737 } 743 }
738 private void Close() { 744 private void Close() {
739 if (State == HTTPConnectionState.Closed) return; 745 if (State == HTTPConnectionState.Closed) return;
740 Reader.Close(); 746 Reader.Close();
741 State = HTTPConnectionState.Closed; 747 State = HTTPConnectionState.Closed;