Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:netway:mono
xsp
xsp-sendfile-fix.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xsp-sendfile-fix.patch of Package xsp
diff --git a/src/Mono.WebServer.XSP/XSPWorkerRequest.cs b/src/Mono.WebServer.XSP/XSPWorkerRequest.cs index 13eeab4..fd2c0e6 100644 --- a/src/Mono.WebServer.XSP/XSPWorkerRequest.cs +++ b/src/Mono.WebServer.XSP/XSPWorkerRequest.cs @@ -723,7 +723,16 @@ namespace Mono.WebServer while (length > 0) { int result = sendfile ((int) socket, (int) handle, ref offset, (IntPtr) length); if (result == -1) - throw new System.ComponentModel.Win32Exception (); + { + var ex = new System.ComponentModel.Win32Exception(); + if (ex.NativeErrorCode == (int)Errno.EINTR || ex.NativeErrorCode == (int)Errno.EAGAIN) + { + // If socket was not ready for sending, let's keep retrying.. + continue; + } + + throw ex; + } // sendfile() will set 'offset' for us length -= result; @@ -783,6 +792,12 @@ namespace Mono.WebServer [DllImport ("libc", SetLastError=true, EntryPoint="send")] unsafe extern static int send (int s, byte *buffer, IntPtr len, int flags); + + internal enum Errno + { + EINTR = 4, + EAGAIN = 11 // same as EWOULDBLOCK + } } }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor