summaryrefslogtreecommitdiff
path: root/service/http/response_windows.go
diff options
context:
space:
mode:
Diffstat (limited to 'service/http/response_windows.go')
-rw-r--r--service/http/response_windows.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/service/http/response_windows.go b/service/http/response_windows.go
new file mode 100644
index 00000000..f1ac6a37
--- /dev/null
+++ b/service/http/response_windows.go
@@ -0,0 +1,24 @@
+// +build windows
+
+package http
+
+import (
+ "errors"
+ "net"
+ "os"
+ "syscall"
+)
+
+var errEPIPE = errors.New("WSAECONNABORTED (10053) -> an established connection was aborted")
+
+// handleWriteError just check if error was caused by aborted connection
+func handleWriteError(err error) error {
+ if netErr, ok2 := err.(*net.OpError); ok2 {
+ if syscallErr, ok3 := netErr.Err.(*os.SyscallError); ok3 {
+ if syscallErr.Err == syscall.WSAECONNABORTED {
+ return errEPIPE
+ }
+ }
+ }
+ return err
+}