[Mono-dev] Bug found in Mono.WebServer.XSPWorker ?

Jean-François Burdet jfburdet at humanweb.ch
Sat Sep 2 12:14:42 EDT 2006


Hi there,

I hope it's the correct place to post such request.

I was searching a way of embedding an secure web server in my .Net
application i'm writting using Visual Studio 2005.

At first, I simply took the Mono.WebServer2.dll and Mono.Security.Dll
from the Mono Window build (1.1.17.1) and some sources files (server.cs
and security.cs) to build the Mono.XSP assembly which simply parse the
command line then launching Mono.WebServer.ApplicationServer.

Using that setup I had success running the server, including static html
files, ASP pages, web services under http and https/SSL. Good :-)

Then I wanted to dig a bit into Mono.Webserver, so I grab the source
files from the 1.1.17.1 tarball and made another project to build my own
Mono.Webserver.dll then using it instead of the Mono.WebServer2.dll of
the official windows build to make the Mono.XSP server running and ...
it works as good as before BUT :

I realized that when using SSL, something was now broken, it seems that
now the SSL negociation is somehow buggy and I can't figure out why but
when running regular http everything is ok (asp, webservices, ...).

When opening the webpage from my browser, it simply waits, receiving
nothing ...

So I dig a bit into the source code and I realize that the worker was
reading it's data from the socket but not the stream ... so I simply
change some line in the XSPApplicationHost.cs source file :

1. "sock.BeginReceive (buffer, 0, buffer.Length, SocketFlags.None, new
AsyncCallback (ReadCB), buffer);" becomes "stream.BeginRead(buffer, 0,
buffer.Length, new AsyncCallback(ReadCB), buffer);"

2. "int nread = sock.EndReceive (ares);" becomes "int nread =
stream.EndRead(ares);"

and ... it now works fine.

Please can you confirm I found a bug, if the solution is ok, you can
comit this to the source tree.

Regards,

JF

PS: I'm starting to wonder why it was working with the DLL from the
Official windows build ... The Reflector disassembler showed me that
this dll code is not the same as the latest sources, for example, look
at the XSPWorker.Run method is absolutly not the same than the source code !

-- 
Humanweb
Jean-Francois Burdet





More information about the Mono-devel-list mailing list