Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exception sending file on windows #132

Open
dannydulai opened this issue Aug 20, 2011 · 1 comment
Open

exception sending file on windows #132

dannydulai opened this issue Aug 20, 2011 · 1 comment

Comments

@dannydulai
Copy link
Contributor

Unhandled Exception: System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
   at System.Net.Sockets.Socket.BeginSend(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, AsyncCallback callback, Object state)
   at Manos.IO.Managed.TcpSocket.TcpStream.WriteSingleFragment(ByteBuffer fragment) in c:\cygwin\home\Danny\work\sooloos\Cola\Manos\src\Manos.IO\Manos.IO.Managed\TcpSocket.cs:line 94
   at Manos.IO.FragmentStream`1.WriteCurrentFragment() in c:\cygwin\home\Danny\work\sooloos\Cola\Manos\src\Manos.IO\Manos.IO\FragmentStream.cs:line 431
   at Manos.IO.FragmentStream`1.HandleWrite() in c:\cygwin\home\Danny\work\sooloos\Cola\Manos\src\Manos.IO\Manos.IO\FragmentStream.cs:line 422
   at Manos.IO.Managed.ManagedStream`1.HandleWrite() in c:\cygwin\home\Danny\work\sooloos\Cola\Manos\src\Manos.IO\Manos.IO.Managed\ManagedStream.cs:line 151
   at Manos.IO.Managed.TcpSocket.TcpStream.<>c__DisplayClass18.<WriteCallback>b__17() in c:\cygwin\home\Danny\work\sooloos\Cola\Manos\src\Manos.IO\Manos.IO.Managed\TcpSocket.cs:line 109
   at Manos.IO.Managed.Context.RunOnceNonblocking() in c:\cygwin\home\Danny\work\sooloos\Cola\Manos\src\Manos.IO\Manos.IO.Managed\Context.cs:line 124
   at Manos.IO.Managed.Context.RunOnce() in c:\cygwin\home\Danny\work\sooloos\Cola\Manos\src\Manos.IO\Manos.IO.Managed\Context.cs:line 107
   at Manos.IO.Managed.Context.Start() in c:\cygwin\home\Danny\work\sooloos\Cola\Manos\src\Manos.IO\Manos.IO.Managed\Context.cs:line 100

I boiled it down to this code in HttpStream.cs:

                void SendFileData (string fileName)
                {
                        if (SocketStream is ISendfileCapable) {
                                ((ISendfileCapable) SocketStream).SendFile (fileName);
                        } else {
                                SocketStream.PauseWriting ();
                                var fs = HttpEntity.Context.OpenFile (fileName, OpenMode.Read, 64 * 1024);
                                SocketStream.Write (new StreamCopySequencer (fs, SocketStream, true));
                        }
                        SocketStream.Write (SendCallback (SendBufferedOps));
                }

If I comment out the if() + SendFile(), it works fine.

@dannydulai
Copy link
Contributor Author

oh, also, if i hit it with chrome15 (dev channel), i get:

Error 321 (net::ERR_INVALID_CHUNKED_ENCODING): Unknown error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant