Mailinglist Archive: opensuse-commit (1318 mails)

< Previous Next >
commit xsp
  • From: root@xxxxxxx (h_root)
  • Date: Tue, 1 Aug 2006 17:15:52 +0200 (CEST)
  • Message-id: <20060801151552.1925994E6F@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package xsp
checked in at Tue Aug 1 17:15:52 CEST 2006.

--------
--- xsp/xsp.changes 2006-04-26 02:22:29.000000000 +0200
+++ xsp/xsp.changes 2006-08-01 02:56:13.000000000 +0200
@@ -1,0 +2,7 @@
+Tue Aug 1 02:53:13 CEST 2006 - wberrier@xxxxxxx
+
+- update to 1.1.16.1
+- better connection handling
+- fixes bugs: 77698,78034,78621
+
+-------------------------------------------------------------------

Old:
----
xsp-1.1.13.7.tar.gz

New:
----
xsp-1.1.16.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ xsp.spec ++++++
--- /var/tmp/diff_new_pack.AMJTyD/_old 2006-08-01 17:15:46.000000000 +0200
+++ /var/tmp/diff_new_pack.AMJTyD/_new 2006-08-01 17:15:46.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package xsp (Version 1.1.13.7)
+# spec file for package xsp (Version 1.1.16.1)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -20,8 +20,8 @@
Group: Productivity/Networking/Web/Servers
Autoreqprov: on
Requires: gnome-filesystem
-Version: 1.1.13.7
-Release: 2
+Version: 1.1.16.1
+Release: 1
Summary: Small Web Server Hosting ASP.NET
Source: %{name}-%{version}.tar.gz
#Patch: xsp-libexecdir.patch
@@ -65,6 +65,10 @@
%doc NEWS README

%changelog -n xsp
+* Tue Aug 01 2006 - wberrier@xxxxxxx
+- update to 1.1.16.1
+- better connection handling
+- fixes bugs: 77698,78034,78621
* Wed Apr 26 2006 - wberrier@xxxxxxx
- Security update (remove all the duplicated slashes
and don't do an extra Replace on non-windows.) and minor fix for

++++++ xsp-1.1.13.7.tar.gz -> xsp-1.1.16.1.tar.gz ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/ChangeLog new/xsp-1.1.16.1/ChangeLog
--- old/xsp-1.1.13.7/ChangeLog 2006-04-26 02:12:39.000000000 +0200
+++ new/xsp-1.1.16.1/ChangeLog 2006-07-20 09:47:38.000000000 +0200
@@ -1,3 +1,33 @@
+2006-07-20 Gonzalo Paniagua Javier <gonzalo@xxxxxxxxxx>
+
+ * src/ModMonoApplicationHost.cs: don't prepend the file:// scheme, as
+ it's currently breaking mod-mono-server 2.0.
+
+2006-06-14 Gonzalo Paniagua Javier <gonzalo@xxxxxxxxxx>
+
+ * src/Mono.WebServer/ApplicationServer.cs: when stopping the server,
+ reset the 'started' variable. Fixes bug #78621.
+
+2006-06-01 Gonzalo Paniagua Javier <gonzalo@xxxxxxxxxx>
+
+ * tools/asp_state/asp-state.exe.config:
+ * tools/asp_state/asp-state2.exe.config: use FQDN.
+
+2006-05-10 Gonzalo Paniagua Javier <gonzalo@xxxxxxxxxx>
+
+ * src/server.cs:
+ * src/Mono.WebServer/XSPWorkerRequest.cs:
+ * src/Mono.WebServer/BaseRequestBroker.cs:
+ * src/Mono.WebServer/ApplicationServer.cs:
+ * src/Mono.WebServer/XSPApplicationHost.cs:
+ * src/Mono.WebServer/InitialWorkerRequest.cs:
+ * src/Mono.WebServer/LingeringNetworkStream.cs:
+ * src/Mono.WebServer/IWebSource.cs:
+ * src/ModMonoApplicationHost.cs: accepting a connection and the initial
+ read are now done asynchronously. SocketPool class and that Select are
+ over now and xsp/mod-mono-server behave much better when getting many
+ simultaneous connections.
+
2006-04-25 Gonzalo Paniagua Javier <gonzalo@xxxxxxxxxx>

* src/Mono.WebServer/MonoWorkerRequest.cs: remove all the duplicated
@@ -9,16 +39,32 @@
option (like a port number). Fixes bug #78034. Thanks to Hubert
Fongarnand.

-2006-01-24 Gonzalo Paniagua Javier <gonzalo@xxxxxxxxxx>
+2006-03-05 Robert Jordan <robertj@xxxxxxx>
+
+ * tools/dbsessmgr/dbsessmgr.cs:
+ * tools/dbsessmgr/dbsessmgr.exe.config:
+ * man/dbsessmgr.1.in: make SQL statements and parameters
+ provider independent/configurable. Fixes bug #77698.
+
+2006-01-25 Chris Toshok <toshok@xxxxxxxxxx>
+
+ * src/Mono.WebServer/Makefile.am: define NET_2_0 in the
+ Mono.WebServer2.dll case.
+
+ * src/Mono.WebServer/XSPWorkerRequest.cs: use ConfigurationManager
+ in 2.0.

- * src/Mono.WebServer/ApplicationServer.cs: revert the workaround. The
- problem is now fixed in the runtime.
+ * src/Makefile.am: define NET_2_0 in the
+ xsp2.exe/mod-moon-server2.exe cases.

-2006-01-23 Gonzalo Paniagua Javier <gonzalo@xxxxxxxxxx>
+ * src/server.cs (AppSettings): use ConfigurationManager in 2.0,
+ and isolate the ifdef here so everywhere else we can just use
+ "AppSettings".
+ (Main): s/ConfigurationSettings.AppSettings/AppSettings/

- * src/Mono.WebServer/ApplicationServer.cs: temporary workaround to
- prevent threadpool exhaustion.
+ * src/ModMonoWorkerRequest.cs: use ConfigurationManager in 2.0

+>>>>>>> .r59119
2005-12-27 Gonzalo Paniagua Javier <gonzalo@xxxxxxxxxx>

* src/ModMonoRequest.cs: use UTF8 instead of the default encoding. Fixes
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/INSTALL new/xsp-1.1.16.1/INSTALL
--- old/xsp-1.1.13.7/INSTALL 2006-04-26 02:12:39.000000000 +0200
+++ new/xsp-1.1.16.1/INSTALL 2006-07-06 00:27:10.000000000 +0200
@@ -11,17 +11,8 @@

If you don't specify --prefix, it will default to /usr/local.

- If ./configure finds 'gmcs' it will assume that you have an
- installation able to compile .NET 2.0 executables. This means that
- you need to make sure you have the required assemblies installed.
- This is done from svn by:
-
- ./configure --profile=net_2_0
- make
- make install
-
- in the mcs/ svn module or configuring the mono tarball/module
- using the '--with-preview=yes' option.
+ If ./configure finds a working 'gmcs' it will automatically build a
+ 2.0 profile version of xsp, named xsp2.

* Running XSP with the bundled tests
------------------------------------
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/configure new/xsp-1.1.16.1/configure
--- old/xsp-1.1.13.7/configure 2006-04-26 02:12:46.000000000 +0200
+++ new/xsp-1.1.16.1/configure 2006-07-20 09:47:53.000000000 +0200
@@ -1620,7 +1620,7 @@

# Define the identity of the package.
PACKAGE=xsp
- VERSION=1.1.13.7
+ VERSION=1.1.16.1


cat >>confdefs.h <<_ACEOF
@@ -2119,7 +2119,7 @@



-if test ! x$CSC = xno; then
+if test x$platform_win32 = xyes; then
XSP_ONLY_TRUE=
XSP_ONLY_FALSE='#'
else
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/configure.in new/xsp-1.1.16.1/configure.in
--- old/xsp-1.1.13.7/configure.in 2006-04-26 02:12:39.000000000 +0200
+++ new/xsp-1.1.16.1/configure.in 2006-07-20 09:47:38.000000000 +0200
@@ -1,7 +1,7 @@
AC_PREREQ(2.57)
AC_INIT(src/server.cs)
AC_CANONICAL_SYSTEM
-AM_INIT_AUTOMAKE(xsp, 1.1.13.7)
+AM_INIT_AUTOMAKE(xsp, 1.1.16.1)
AM_MAINTAINER_MODE

AC_PROG_INSTALL
@@ -49,7 +49,7 @@

AM_CONDITIONAL(PLATFORM_WIN32, test x$platform_win32 = xyes)
AM_CONDITIONAL(NET_2_0, test ! x$GMCS = xno)
-AM_CONDITIONAL(XSP_ONLY, test ! x$CSC = xno)
+AM_CONDITIONAL(XSP_ONLY, test x$platform_win32 = xyes)

echo "$CS compiler: $MCS"
test x$GMCS = xno || echo "$CS 2.0 compiler: $GMCS"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/man/dbsessmgr.1.in new/xsp-1.1.16.1/man/dbsessmgr.1.in
--- old/xsp-1.1.13.7/man/dbsessmgr.1.in 2006-04-26 02:12:39.000000000 +0200
+++ new/xsp-1.1.16.1/man/dbsessmgr.1.in 2006-07-06 00:27:10.000000000 +0200
@@ -24,8 +24,8 @@
Display session data.
.SH CONFIGURATION
You can choose the assembly and type used to connect to your database
-backend and also set the connection string through the configuration
-file, named dbsessmgr.exe.config.
+backend and also set the connection string and the SQL parameter prefix
+through the configuration file, named dbsessmgr.exe.config.
The configuration shipped by default is:

.nf
@@ -36,6 +36,8 @@
value="Npgsql.NpgsqlConnection"/>
<add key="DBConnectionString"
value="SERVER=127.0.0.1;USER ID=monostate;PASSWORD=monostate;dbname=monostate"/>
+ <add key="DBParamPrefix"
+ value=":" />
</appSettings>
.fi
.SH AUTHORS
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/src/Makefile.am new/xsp-1.1.16.1/src/Makefile.am
--- old/xsp-1.1.13.7/src/Makefile.am 2006-04-26 02:12:39.000000000 +0200
+++ new/xsp-1.1.16.1/src/Makefile.am 2006-07-06 00:27:10.000000000 +0200
@@ -26,7 +26,7 @@

#
xsp_references= -r:System.Web.dll -r:Mono.WebServer/Mono.WebServer.dll -r:Mono.Security.dll
-xsp2_references= -r:System.Web.dll -r:Mono.WebServer/Mono.WebServer2.dll -r:Mono.Security.dll
+xsp2_references= -r:System.Web.dll -r:System.Configuration.dll -r:Mono.WebServer/Mono.WebServer2.dll -r:Mono.Security.dll
if PLATFORM_WIN32
modmono_references= -lib:"$(prefix)/lib" -r:Mono.WebServer/Mono.WebServer.dll \
-r:System.Web.dll -r:Mono.Posix.dll
@@ -34,7 +34,7 @@
-r:System.Web.dll -r:Mono.Posix.dll
else
modmono_references= -r:System.Web.dll -r:Mono.WebServer/Mono.WebServer.dll -r:Mono.Posix.dll
-modmono2_references= -r:System.Web.dll -r:Mono.WebServer/Mono.WebServer2.dll -r:Mono.Posix.dll
+modmono2_references= -r:System.Web.dll -r:System.Configuration.dll -r:Mono.WebServer/Mono.WebServer2.dll -r:Mono.Posix.dll
endif

xsp_sources = server.cs security.cs
@@ -56,8 +56,8 @@
$(MCS) $(MCSFLAGS) $(modmono_references) /d:MODMONO_SERVER /out:$@ $(modmono_build_sources)

xsp2.exe: $(xsp_build_sources)
- $(GMCS) $(MCSFLAGS) $(xsp2_references) /out:$@ $(xsp_build_sources)
+ $(GMCS) -d:NET_2_0 $(MCSFLAGS) $(xsp2_references) /out:$@ $(xsp_build_sources)

mod-mono-server2.exe: $(modmono_build_sources)
- $(GMCS) $(MCSFLAGS) $(modmono2_references) /d:MODMONO_SERVER /out:$@ $(modmono_build_sources)
+ $(GMCS) -d:NET_2_0 $(MCSFLAGS) $(modmono2_references) /d:MODMONO_SERVER /out:$@ $(modmono_build_sources)

diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/src/Makefile.in new/xsp-1.1.16.1/src/Makefile.in
--- old/xsp-1.1.13.7/src/Makefile.in 2006-04-26 02:12:43.000000000 +0200
+++ new/xsp-1.1.16.1/src/Makefile.in 2006-07-20 09:47:50.000000000 +0200
@@ -165,12 +165,12 @@

#
xsp_references = -r:System.Web.dll -r:Mono.WebServer/Mono.WebServer.dll -r:Mono.Security.dll
-xsp2_references = -r:System.Web.dll -r:Mono.WebServer/Mono.WebServer2.dll -r:Mono.Security.dll
+xsp2_references = -r:System.Web.dll -r:System.Configuration.dll -r:Mono.WebServer/Mono.WebServer2.dll -r:Mono.Security.dll
@PLATFORM_WIN32_FALSE@modmono_references = -r:System.Web.dll -r:Mono.WebServer/Mono.WebServer.dll -r:Mono.Posix.dll
@PLATFORM_WIN32_TRUE@modmono_references = -lib:"$(prefix)/lib" -r:Mono.WebServer/Mono.WebServer.dll \
@PLATFORM_WIN32_TRUE@ -r:System.Web.dll -r:Mono.Posix.dll

-@PLATFORM_WIN32_FALSE@modmono2_references = -r:System.Web.dll -r:Mono.WebServer/Mono.WebServer2.dll -r:Mono.Posix.dll
+@PLATFORM_WIN32_FALSE@modmono2_references = -r:System.Web.dll -r:System.Configuration.dll -r:Mono.WebServer/Mono.WebServer2.dll -r:Mono.Posix.dll
@PLATFORM_WIN32_TRUE@modmono2_references = -lib:"$(prefix)/lib" -r:Mono.WebServer/Mono.WebServer2.dll \
@PLATFORM_WIN32_TRUE@ -r:System.Web.dll -r:Mono.Posix.dll

@@ -580,10 +580,10 @@
$(MCS) $(MCSFLAGS) $(modmono_references) /d:MODMONO_SERVER /out:$@ $(modmono_build_sources)

xsp2.exe: $(xsp_build_sources)
- $(GMCS) $(MCSFLAGS) $(xsp2_references) /out:$@ $(xsp_build_sources)
+ $(GMCS) -d:NET_2_0 $(MCSFLAGS) $(xsp2_references) /out:$@ $(xsp_build_sources)

mod-mono-server2.exe: $(modmono_build_sources)
- $(GMCS) $(MCSFLAGS) $(modmono2_references) /d:MODMONO_SERVER /out:$@ $(modmono_build_sources)
+ $(GMCS) -d:NET_2_0 $(MCSFLAGS) $(modmono2_references) /d:MODMONO_SERVER /out:$@ $(modmono_build_sources)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/src/ModMonoApplicationHost.cs new/xsp-1.1.16.1/src/ModMonoApplicationHost.cs
--- old/xsp-1.1.13.7/src/ModMonoApplicationHost.cs 2006-04-07 22:29:55.000000000 +0200
+++ new/xsp-1.1.16.1/src/ModMonoApplicationHost.cs 2006-07-20 09:47:38.000000000 +0200
@@ -39,7 +39,7 @@
// ModMonoWebSource: Provides methods to get objects and types specific
// to mod_mono.
//
- public class ModMonoWebSource: IWebSource, IDisposable
+ public class ModMonoWebSource: WebSource
{
string filename;
bool file_bound;
@@ -94,7 +94,7 @@
return result;
}

- public virtual Socket CreateSocket ()
+ public override Socket CreateSocket ()
{
if (filename == null)
throw new InvalidOperationException ("filename not set");
@@ -106,7 +106,7 @@
conn.Connect (ep);
conn.Close ();
throw new InvalidOperationException ("There's already a server listening on " + filename);
- } catch (SocketException se) {
+ } catch (SocketException) {
}
File.Delete (filename);
}
@@ -117,27 +117,22 @@
return listen_socket;
}

- public IWorker CreateWorker (Socket client, ApplicationServer server)
+ public override Worker CreateWorker (Socket client, ApplicationServer server)
{
return new ModMonoWorker (client, server);
}

- public Type GetApplicationHostType ()
+ public override Type GetApplicationHostType ()
{
return typeof (ModMonoApplicationHost);
}

- public IRequestBroker CreateRequestBroker ()
+ public override IRequestBroker CreateRequestBroker ()
{
return new ModMonoRequestBroker ();
}

- public void Dispose ()
- {
- Dispose (true);
- }
-
- protected virtual void Dispose (bool expl)
+ protected override void Dispose (bool expl)
{
if (filename != null) {
string f = filename;
@@ -209,7 +204,7 @@
// ModMonoWorker: The worker that do the initial processing of mod_mono
// requests.
//
- internal class ModMonoWorker: IWorker
+ internal class ModMonoWorker: Worker
{
ApplicationServer server;
public LingeringNetworkStream Stream;
@@ -226,12 +221,11 @@
int requestId = -1;
ModMonoRequestBroker broker = null;

- public void Run (object state)
+ public override void Run (object state)
{
try {
InnerRun (state);
- } catch (Exception e) {
- //Console.WriteLine ("In ModMonoWorker.Run: {0}", e.Message);
+ } catch (Exception) {
try {
// Closing is enough for mod_mono. the module will return a 50x
Stream.Close ();
@@ -277,10 +271,11 @@
}


- Console.Error.WriteLine ("final_pdir: {0} final_vdir: {1}", final_pdir, final_vdir);
+ //Console.Error.WriteLine ("final_pdir: {0} final_vdir: {1}", final_pdir, final_vdir);
vapp = server.GetApplicationForPath (vhost, port, virt, false);
if (vapp == null) {
- final_pdir = "file://" + final_pdir;
+ // Don't know why this breaks mod-mono-server2.exe, but not mod-mono-server.exe
+ //final_pdir = "file://" + final_pdir;
if (final_vdir [0] != '/')
final_vdir = "/" + final_vdir;
server.AddApplication (vhost, port, final_vdir, final_pdir);
@@ -372,17 +367,17 @@
modRequest.GetAllHeaderValues());
}

- public int Read (byte[] buffer, int position, int size)
+ public override int Read (byte[] buffer, int position, int size)
{
return modRequest.GetClientBlock (buffer, position, size);
}

- public void Write (byte[] buffer, int position, int size)
+ public override void Write (byte[] buffer, int position, int size)
{
modRequest.SendResponseFromMemory (buffer, position, size);
}

- public void Close ()
+ public override void Close ()
{
if (closed)
return;
@@ -399,12 +394,12 @@
} catch {}
}

- public void Flush ()
+ public override void Flush ()
{
//modRequest.Flush (); No-op
}

- public bool IsConnected ()
+ public override bool IsConnected ()
{
return modRequest.IsConnected ();
}
@@ -430,3 +425,4 @@
}
}
}
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/src/ModMonoWorkerRequest.cs new/xsp-1.1.16.1/src/ModMonoWorkerRequest.cs
--- old/xsp-1.1.13.7/src/ModMonoWorkerRequest.cs 2006-04-26 02:12:39.000000000 +0200
+++ new/xsp-1.1.16.1/src/ModMonoWorkerRequest.cs 2006-07-06 00:27:10.000000000 +0200
@@ -116,7 +116,11 @@

static ModMonoWorkerRequest ()
{
+#if NET_2_0
+ string indexes = ConfigurationManager.AppSettings ["MonoServerDefaultIndexFiles"];
+#else
string indexes = ConfigurationSettings.AppSettings ["MonoServerDefaultIndexFiles"];
+#endif
SetDefaultIndexFiles (indexes);
}

diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/src/Mono.WebServer/ApplicationServer.cs new/xsp-1.1.16.1/src/Mono.WebServer/ApplicationServer.cs
--- old/xsp-1.1.13.7/src/Mono.WebServer/ApplicationServer.cs 2006-04-07 22:29:55.000000000 +0200
+++ new/xsp-1.1.16.1/src/Mono.WebServer/ApplicationServer.cs 2006-07-06 00:27:10.000000000 +0200
@@ -45,8 +45,8 @@
{
// ApplicationServer runs the main server thread, which accepts client
// connections and forwards the requests to the correct web application.
- // ApplicationServer takes an IWebSource object as parameter in the
- // constructor. IWebSource provides methods for getting some objects
+ // ApplicationServer takes an WebSource object as parameter in the
+ // constructor. WebSource provides methods for getting some objects
// whose behavior is specific to XSP or mod_mono.

// Each web application lives in its own application domain, and incoming
@@ -66,24 +66,24 @@
// The complete sequence of servicing a request is the following:
//
// 1) The listener accepts an incoming connection.
- // 2) An IWorker object is created (through the IWebSource), and it is
+ // 2) An Worker object is created (through the WebSource), and it is
// queued in the thread pool.
- // 3) When the IWorker's run method is called, it registers itself in
+ // 3) When the Worker's run method is called, it registers itself in
// the application's request broker, and gets a request id. All this is
// done in the main domain.
- // 4) The IWorker starts the request processing by making a cross-app domain
+ // 4) The Worker starts the request processing by making a cross-app domain
// call to the application host. It passes as parameters the request id
// and other information already read from the request.
// 5) The application host executes the request. When it needs to read or
// write request data, it performs remote calls to the request broker,
- // passing the request id provided by the IWorker.
+ // passing the request id provided by the Worker.
// 6) When the request broker receives a call from the application host,
- // it locates the IWorker registered with the provided request id and
+ // it locates the Worker registered with the provided request id and
// forwards the call to it.

public class ApplicationServer : MarshalByRefObject
{
- IWebSource webSource;
+ WebSource webSource;
bool started;
bool stop;
bool verbose;
@@ -94,7 +94,7 @@
// This is much faster than hashtable for typical cases.
ArrayList vpathToHost = new ArrayList ();

- public ApplicationServer (IWebSource source)
+ public ApplicationServer (WebSource source)
{
webSource = source;
}
@@ -283,6 +283,7 @@
runner.Abort ();
listen_socket.Close ();
UnloadAll ();
+ started = false;
Thread.Sleep (1000);
}

@@ -307,46 +308,56 @@
#endif
}

- SocketPool spool = new SocketPool ();

+ AsyncCallback accept_cb;
void RunServer ()
{
- spool.AddReadSocket (listen_socket);
started = true;
- Socket client;
- int w;
- while (!stop){
- ArrayList wSockets = spool.SelectRead ();
- w = wSockets.Count;
- for (int i = 0; i < w; i++) {
- Socket s = (Socket) wSockets [i];
- if (s == listen_socket) {
- try {
- client = s.Accept ();
- client.Blocking = true;
- } catch (Exception e) {
- continue;
- }
- SetSocketOptions (client);
- spool.AddReadSocket (client, DateTime.UtcNow);
- continue;
- }
-
- spool.RemoveReadSocket (s);
- IWorker worker = null;
- try {
- // This might happen when reusing and the client closes.
- worker = webSource.CreateWorker (s, this);
- } catch (Exception) {
- try { s.Close (); } catch {}
- continue;
- }
+ accept_cb = new AsyncCallback (OnAccept);
+ listen_socket.BeginAccept (accept_cb, null);
+ if (runner.IsBackground)
+ return;
+
+ while (true) // Just sleep until we're aborted.
+ Thread.Sleep (1000000);
+ }

+ void OnAccept (IAsyncResult ares)
+ {
+ Socket accepted = null;
+ try {
+ accepted = listen_socket.EndAccept (ares);
+ } catch {
+ } finally {
+ listen_socket.BeginAccept (accept_cb, null);
+ }
+
+ if (accepted == null)
+ return;
+ accepted.Blocking = true;
+ SetSocketOptions (accepted);
+ StartRequest (accepted, 0);
+ }
+
+ void StartRequest (Socket accepted, int reuses)
+ {
+ Worker worker = null;
+ try {
+ // The next line can throw (reusing and the client closed)
+ worker = webSource.CreateWorker (accepted, this);
+ worker.SetReuseCount (reuses);
+ if (false == worker.IsAsync)
ThreadPool.QueueUserWorkItem (new WaitCallback (worker.Run));
- }
+ else
+ worker.Run (null);
+ } catch (Exception) {
+ try { accepted.Close (); } catch {}
}
+ }

- started = false;
+ public void ReuseSocket (Socket sock, int reuses)
+ {
+ StartRequest (sock, reuses);
}

public VPathToHost GetApplicationForPath (string vhost, int port, string path,
@@ -398,134 +409,8 @@
{
return null;
}
-
- public int GetAvailableReuses (Socket sock)
- {
- int res = spool.GetReuseCount (sock);
- if (res == -1 || res >= 100)
- return -1;
-
- return 100 - res;
- }
-
- public void ReuseSocket (Socket sock)
- {
- IWorker worker = webSource.CreateWorker (sock, this);
- spool.IncrementReuseCount (sock);
- ThreadPool.QueueUserWorkItem (new WaitCallback (worker.Run));
- }
-
- public void CloseSocket (Socket sock)
- {
- spool.RemoveReadSocket (sock);
- }
}

- class SocketPool {
- ArrayList readSockets = new ArrayList ();
- Hashtable timeouts = new Hashtable ();
- Hashtable uses = new Hashtable ();
- object locker = new object ();
-
- public ArrayList SelectRead ()
- {
- if (readSockets.Count == 0)
- throw new InvalidOperationException ("There are no sockets.");
-
- ArrayList wSockets = new ArrayList (readSockets);
- // A bug on MS (or is it just me?) makes the following select return immediately
- // when there's only one socket (the listen socket) in the array:
- // Socket.Select (wSockets, null, null, (w == 1) ? -1 : 1000 * 1000); // 1s
- // so i have to do this for the MS runtime not to hung all the CPU.
- if (wSockets.Count > 1) {
- Socket.Select (wSockets, null, null, 1000 * 1000); // 1s
- } else {
- Socket sock = (Socket) wSockets [0];
- sock.Poll (-1, SelectMode.SelectRead);
- // wSockets already contains listen_socket.
- }
-
- lock (locker)
- CheckTimeouts (wSockets);
-
- return wSockets;
- }
-
- void CheckTimeouts (ArrayList wSockets)
- {
- int w = timeouts.Count;
- if (w > 0) {
- Socket [] socks_timeout = new Socket [w];
- timeouts.Keys.CopyTo (socks_timeout, 0);
- DateTime now = DateTime.UtcNow;
- foreach (Socket k in socks_timeout) {
- if (wSockets.Contains (k))
- continue;
-
- DateTime atime = (DateTime) timeouts [k];
- TimeSpan diff = now - atime;
- if (diff.TotalMilliseconds > 15 * 1000) {
- RemoveReadSocket (k);
- wSockets.Remove (k);
- k.Close ();
- continue;
- }
- }
- }
- }
-
- public void IncrementReuseCount (Socket sock)
- {
- lock (locker) {
- if (uses.ContainsKey (sock)) {
- int n = (int) uses [sock];
- uses [sock] = n + 1;
- } else {
- uses [sock] = 1;
- }
- }
- }
-
- public int GetReuseCount (Socket sock)
- {
- lock (locker) {
- if (uses.ContainsKey (sock))
- return (int) uses [sock];
-
- uses [sock] = 1;
- return 1;
- }
- }
-
- public void AddReadSocket (Socket sock)
- {
- lock (locker)
- readSockets.Add (sock);
- }
-
- public void AddReadSocket (Socket sock, DateTime time)
- {
- lock (locker) {
- if (readSockets.Contains (sock)) {
- timeouts [sock] = time;
- return;
- }
-
- readSockets.Add (sock);
- timeouts [sock] = time;
- }
- }
-
- public void RemoveReadSocket (Socket sock)
- {
- lock (locker) {
- readSockets.Remove (sock);
- timeouts.Remove (sock);
- uses.Remove (sock);
- }
- }
- }
-
public class VPathToHost
{
public readonly string vhost;
@@ -628,7 +513,7 @@
return (vpath.StartsWith (this.vpath));
}

- public void CreateHost (ApplicationServer server, IWebSource webSource)
+ public void CreateHost (ApplicationServer server, WebSource webSource)
{
string v = vpath;
if (v != "/" && v.EndsWith ("/")) {
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/src/Mono.WebServer/BaseRequestBroker.cs new/xsp-1.1.16.1/src/Mono.WebServer/BaseRequestBroker.cs
--- old/xsp-1.1.13.7/src/Mono.WebServer/BaseRequestBroker.cs 2006-04-07 22:29:55.000000000 +0200
+++ new/xsp-1.1.16.1/src/Mono.WebServer/BaseRequestBroker.cs 2006-07-06 00:27:10.000000000 +0200
@@ -52,7 +52,7 @@
stk.Push (buffer);
}

- public int RegisterRequest (IWorker worker)
+ public int RegisterRequest (Worker worker)
{
int result = worker.GetHashCode ();
lock (requests) {
@@ -79,9 +79,9 @@
} else {
buffer = new byte[size];
}
- IWorker w;
+ Worker w;
lock (requests) {
- w = (IWorker) requests [requestId];
+ w = (Worker) requests [requestId];
}

int nread = 0;
@@ -91,30 +91,30 @@
return nread;
}

- public IWorker GetWorker (int requestId)
+ public Worker GetWorker (int requestId)
{
lock (requests) {
- return (IWorker) requests [requestId];
+ return (Worker) requests [requestId];
}
}

public void Write (int requestId, byte[] buffer, int position, int size)
{
- IWorker worker = GetWorker (requestId);
+ Worker worker = GetWorker (requestId);
if (worker != null)
worker.Write (buffer, position, size);
}

public void Close (int requestId)
{
- IWorker worker = GetWorker (requestId);
+ Worker worker = GetWorker (requestId);
if (worker != null)
worker.Close ();
}

public void Flush (int requestId)
{
- IWorker worker = GetWorker (requestId);
+ Worker worker = GetWorker (requestId);
if (worker != null)
worker.Flush ();
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/src/Mono.WebServer/IWebSource.cs new/xsp-1.1.16.1/src/Mono.WebServer/IWebSource.cs
--- old/xsp-1.1.13.7/src/Mono.WebServer/IWebSource.cs 2006-04-07 22:29:55.000000000 +0200
+++ new/xsp-1.1.16.1/src/Mono.WebServer/IWebSource.cs 2006-07-06 00:27:10.000000000 +0200
@@ -27,29 +27,51 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

-
-
using System;
+using System.IO;
using System.Net.Sockets;

-namespace Mono.WebServer
-{
- public interface IWebSource : IDisposable
+namespace Mono.WebServer {
+
+ public abstract class WebSource : IDisposable
{
- Socket CreateSocket ();
- IWorker CreateWorker (Socket client, ApplicationServer server);
- Type GetApplicationHostType ();
- IRequestBroker CreateRequestBroker ();
+ public abstract Socket CreateSocket ();
+ public abstract Worker CreateWorker (Socket client, ApplicationServer server);
+ public abstract Type GetApplicationHostType ();
+ public abstract IRequestBroker CreateRequestBroker ();
+
+ public void Dispose ()
+ {
+ Dispose (true);
+ GC.SuppressFinalize (this);
+ }
+
+ protected virtual void Dispose (bool disposing)
+ {
+ }
}

- public interface IWorker
+ public abstract class Worker
{
- void Run (object state);
- int Read (byte[] buffer, int position, int size);
- void Write (byte[] buffer, int position, int size);
- void Close ();
- void Flush ();
- bool IsConnected ();
+ public virtual bool IsAsync {
+ get { return false; }
+ }
+
+ public virtual void SetReuseCount (int reuses)
+ {
+ }
+
+ public virtual int GetRemainingReuses ()
+ {
+ return 0;
+ }
+
+ public abstract void Run (object state);
+ public abstract int Read (byte [] buffer, int position, int size);
+ public abstract void Write (byte [] buffer, int position, int size);
+ public abstract void Close ();
+ public abstract void Flush ();
+ public abstract bool IsConnected ();
}
}

diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/src/Mono.WebServer/InitialWorkerRequest.cs new/xsp-1.1.16.1/src/Mono.WebServer/InitialWorkerRequest.cs
--- old/xsp-1.1.13.7/src/Mono.WebServer/InitialWorkerRequest.cs 2006-04-07 22:29:55.000000000 +0200
+++ new/xsp-1.1.16.1/src/Mono.WebServer/InitialWorkerRequest.cs 2006-07-06 00:27:10.000000000 +0200
@@ -88,7 +88,7 @@
static Stack bufferStack = new Stack ();
static Encoding encoding = Encoding.GetEncoding (28591);

- static byte [] AllocateBuffer ()
+ public static byte [] AllocateBuffer ()
{
lock (bufferStack) {
if (bufferStack.Count != 0)
@@ -97,8 +97,11 @@
return new byte [BSize];
}

- static void FreeBuffer (byte [] buf)
+ public static void FreeBuffer (byte [] buf)
{
+ if (buf == null)
+ return;
+
lock (bufferStack) {
bufferStack.Push (buf);
}
@@ -118,6 +121,14 @@
FreeBuffer (inputBuffer);
}

+ public void SetBuffer (byte [] buffer, int length)
+ {
+ inputBuffer = buffer;
+ inputLength = length;
+ gotSomeInput = (length > 0);
+ position = 0;
+ }
+
void FillBuffer ()
{
position = 0;
@@ -288,13 +299,16 @@
get { return gotSomeInput; }
}

+ public byte [] InputBuffer {
+ get { return inputBuffer; }
+ }
+
public RequestData RequestData {
get {
RequestData rd = new RequestData (verb, path, queryString, protocol);
byte [] buffer = new byte [inputLength - position];
Buffer.BlockCopy (inputBuffer, position, buffer, 0, inputLength - position);
rd.InputBuffer = buffer;
- FreeBuffer (inputBuffer);
return rd;
}
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/src/Mono.WebServer/LingeringNetworkStream.cs new/xsp-1.1.16.1/src/Mono.WebServer/LingeringNetworkStream.cs
--- old/xsp-1.1.13.7/src/Mono.WebServer/LingeringNetworkStream.cs 2006-04-07 22:29:55.000000000 +0200
+++ new/xsp-1.1.16.1/src/Mono.WebServer/LingeringNetworkStream.cs 2006-07-06 00:27:10.000000000 +0200
@@ -38,9 +38,15 @@
bool enableLingering = true;
// We dont actually use the data from this buffer. So we cache it...
static byte [] buffer;
+ bool owns;

public LingeringNetworkStream (Socket sock, bool owns) : base (sock, owns)
{
+ this.owns = owns;
+ }
+
+ public bool OwnsSocket {
+ get { return owns; }
}

public bool EnableLingering
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/src/Mono.WebServer/Makefile.am new/xsp-1.1.16.1/src/Mono.WebServer/Makefile.am
--- old/xsp-1.1.13.7/src/Mono.WebServer/Makefile.am 2006-04-26 02:12:39.000000000 +0200
+++ new/xsp-1.1.16.1/src/Mono.WebServer/Makefile.am 2006-07-06 00:27:10.000000000 +0200
@@ -10,6 +10,7 @@

if NET_2_0
monowebserver2_install = Mono.WebServer2.dll
+monowebserver2_references = -r:System.Web.dll -r:System.Configuration.dll -r:Mono.Security.dll
endif

CLEANFILES = Mono.WebServer.dll* Mono.WebServer2.dll*
@@ -37,5 +38,5 @@
$(MCS) $(MCSFLAGS) $(monowebserver_references) /target:library /out:$@ $(monowebserver_build_sources)

Mono.WebServer2.dll: $(monowebserver2_build_sources)
- $(GMCS) $(MCSFLAGS) $(monowebserver_references) /target:library /out:$@ $(monowebserver2_build_sources)
+ $(GMCS) -d:NET_2_0 $(MCSFLAGS) $(monowebserver2_references) /target:library /out:$@ $(monowebserver2_build_sources)

diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/src/Mono.WebServer/Makefile.in new/xsp-1.1.16.1/src/Mono.WebServer/Makefile.in
--- old/xsp-1.1.13.7/src/Mono.WebServer/Makefile.in 2006-04-26 02:12:43.000000000 +0200
+++ new/xsp-1.1.16.1/src/Mono.WebServer/Makefile.in 2006-07-20 09:47:50.000000000 +0200
@@ -153,6 +153,7 @@
monowebserver_SCRIPTS = Mono.WebServer.dll
monowebserver2_SCRIPTS = $(monowebserver2_install)
@NET_2_0_TRUE@monowebserver2_install = Mono.WebServer2.dll
+@NET_2_0_TRUE@monowebserver2_references = -r:System.Web.dll -r:System.Configuration.dll -r:Mono.Security.dll
CLEANFILES = Mono.WebServer.dll* Mono.WebServer2.dll*
EXTRA_DIST = $(monowebserver_sources) AssemblyInfo.cs.in AssemblyInfo2.cs.in

@@ -399,7 +400,7 @@
$(MCS) $(MCSFLAGS) $(monowebserver_references) /target:library /out:$@ $(monowebserver_build_sources)

Mono.WebServer2.dll: $(monowebserver2_build_sources)
- $(GMCS) $(MCSFLAGS) $(monowebserver_references) /target:library /out:$@ $(monowebserver2_build_sources)
+ $(GMCS) -d:NET_2_0 $(MCSFLAGS) $(monowebserver2_references) /target:library /out:$@ $(monowebserver2_build_sources)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/src/Mono.WebServer/XSPApplicationHost.cs new/xsp-1.1.16.1/src/Mono.WebServer/XSPApplicationHost.cs
--- old/xsp-1.1.13.7/src/Mono.WebServer/XSPApplicationHost.cs 2006-04-07 22:29:55.000000000 +0200
+++ new/xsp-1.1.16.1/src/Mono.WebServer/XSPApplicationHost.cs 2006-07-06 00:27:10.000000000 +0200
@@ -5,7 +5,7 @@
// Gonzalo Paniagua Javier (gonzalo@xxxxxxxxxx)
// Lluis Sanchez Gual (lluis@xxxxxxxxxx)
//
-// (C) Copyright 2004 Novell, Inc. (http://www.novell.com)
+// (C) Copyright 2004,2005,2006 Novell, Inc. (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -33,6 +33,7 @@
using System.Net;
using System.Net.Sockets;
using System.Text;
+using System.Threading;
using System.Web;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
@@ -47,7 +48,7 @@
// XSPWebSource: Provides methods to get objects and types specific
// to XSP.
//
- public class XSPWebSource: IWebSource
+ public class XSPWebSource: WebSource
{
IPEndPoint bindAddress;
bool secureConnection;
@@ -93,32 +94,28 @@
this.bindAddress = bindAddress;
}

- public Socket CreateSocket ()
+ public override Socket CreateSocket ()
{
Socket listen_socket = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP);
listen_socket.Bind (bindAddress);
return listen_socket;
}

- public IWorker CreateWorker (Socket client, ApplicationServer server)
+ public override Worker CreateWorker (Socket client, ApplicationServer server)
{
return new XSPWorker (client, client.LocalEndPoint, server,
secureConnection, SecurityProtocol, cert, keyCB, allowClientCert, requireClientCert);
}

- public Type GetApplicationHostType ()
+ public override Type GetApplicationHostType ()
{
return typeof (XSPApplicationHost);
}

- public IRequestBroker CreateRequestBroker ()
+ public override IRequestBroker CreateRequestBroker ()
{
return new XSPRequestBroker ();
}
-
- public void Dispose ()
- {
- }
}

//
@@ -130,7 +127,7 @@
public int GetReuseCount (int requestId)
{
XSPWorker worker = (XSPWorker) GetWorker (requestId);
- return worker.GetReuseCount ();
+ return worker.GetRemainingReuses ();
}

public void Close (int requestId, bool keepAlive)
@@ -288,7 +285,7 @@
// XSPWorker: The worker that do the initial processing of XSP
// requests.
//
- internal class XSPWorker: IWorker
+ class XSPWorker: Worker
{
ApplicationServer server;
LingeringNetworkStream netStream;
@@ -297,6 +294,10 @@
IPEndPoint localEP;
Socket sock;
SslInformations ssl;
+ InitialWorkerRequest initial;
+ int requestId = -1;
+ XSPRequestBroker broker = null;
+ int reuses;

public XSPWorker (Socket client, EndPoint localEP, ApplicationServer server,
bool secureConnection,
@@ -328,60 +329,67 @@
this.localEP = (IPEndPoint) localEP;
}

- public int GetReuseCount ()
+ public override bool IsAsync {
+ get { return true; }
+ }
+
+ public override void SetReuseCount (int nreuses)
{
- return server.GetAvailableReuses (sock);
+ reuses = nreuses;
}

- int requestId = -1;
- XSPRequestBroker broker = null;
- public void Run (object state)
+ public override int GetRemainingReuses ()
{
- try {
- InnerRun (state);
- } catch (Exception e) {
- bool ignore = ((e is RequestLineException) || (e is IOException));
- if (!ignore)
- Console.WriteLine (e);
+ return 100 - reuses;
+ }

- try {
- if (!ignore) {
- byte [] error = HttpErrors.ServerError ();
- Write (error, 0, error.Length);
- }
- } catch {}
- try {
- Close ();
- } catch {}
+ public override void Run (object state)
+ {
+ initial = new InitialWorkerRequest (stream);
+ byte [] buffer = InitialWorkerRequest.AllocateBuffer ();
+ sock.BeginReceive (buffer, 0, buffer.Length, SocketFlags.None, new AsyncCallback (ReadCB), buffer);
+ }

- if (broker != null && requestId != -1)
- broker.UnregisterRequest (requestId);
+ void ReadCB (IAsyncResult ares)
+ {
+ byte [] buffer = (byte []) ares.AsyncState;
+ try {
+ int nread = sock.EndReceive (ares);
+ // See if we got at least 1 line
+ initial.SetBuffer (buffer, nread);
+ initial.ReadRequestData ();
+ ThreadPool.QueueUserWorkItem (new WaitCallback (RunInternal));
+ } catch (Exception e) {
+ InitialWorkerRequest.FreeBuffer (buffer);
+ HandleInitialException (e);
}
}

- void InnerRun (object state)
+ void HandleInitialException (Exception e)
{
- requestId = -1;
- broker = null;
-
- if (remoteEP == null)
- return;
+ //bool ignore = ((e is RequestLineException) || (e is IOException));
+ //if (!ignore)
+ // Console.WriteLine (e);

- InitialWorkerRequest ir = new InitialWorkerRequest (stream);
try {
- ir.ReadRequestData ();
- } catch (Exception ex) {
- if (ir.GotSomeInput) {
- byte [] badReq = HttpErrors.BadRequest ();
- Write (badReq, 0, badReq.Length);
+ if (initial != null && initial.GotSomeInput && sock.Connected) {
+ byte [] error = HttpErrors.ServerError ();
+ Write (error, 0, error.Length);
}
+ } catch {}

- ir.FreeBuffer ();
+ try {
+ Close ();
+ } catch {}

- throw ex;
- }
+ if (broker != null && requestId != -1)
+ broker.UnregisterRequest (requestId);
+ }

- RequestData rdata = ir.RequestData;
+ void RunInternal (object state)
+ {
+ RequestData rdata = initial.RequestData;
+ initial.FreeBuffer ();
string vhost = null; // TODO: read the headers in InitialWorkerRequest
int port = ((IPEndPoint) localEP).Port;

@@ -414,23 +422,23 @@
rdata.Protocol, rdata.InputBuffer, redirect, sock.Handle, ssl);
}

- public int Read (byte[] buffer, int position, int size)
+ public override int Read (byte[] buffer, int position, int size)
{
int n = stream.Read (buffer, position, size);
return (n >= 0) ? n : -1;
}

- public void Write (byte[] buffer, int position, int size)
+ public override void Write (byte[] buffer, int position, int size)
{
try {
stream.Write (buffer, position, size);
- } catch (Exception e) {
+ } catch (Exception) {
Close ();
throw;
}
}

- public void Close ()
+ public override void Close ()
{
Close (false);
}
@@ -439,10 +447,12 @@
{
if (!keepAlive || !IsConnected ()) {
stream.Close ();
- if (stream != netStream)
+ if (stream != netStream) {
netStream.Close ();
+ } else if (false == netStream.OwnsSocket) {
+ try { sock.Close (); } catch {}
+ }

- server.CloseSocket (sock);
return;
}

@@ -451,21 +461,21 @@
if (stream != netStream)
netStream.Close ();

- server.ReuseSocket (sock);
+ server.ReuseSocket (sock, reuses + 1);
}

- public bool IsConnected ()
+ public override bool IsConnected ()
{
return netStream.Connected;
}

- public void Flush ()
+ public override void Flush ()
{
if (stream != netStream)
stream.Flush ();
}

- private bool ClientCertificateValidation (X509Certificate certificate, int[] certificateErrors)
+ bool ClientCertificateValidation (X509Certificate certificate, int [] certificateErrors)
{
if (certificate != null)
ssl.RawClientCertificate = certificate.GetRawCertData (); // to avoid serialization
@@ -473,8 +483,8 @@
// right now we're accepting any client certificate - i.e. it's up to the
// web application to check if the certificate is valid (HttpClientCertificate.IsValid)
ssl.ClientCertificateValid = (certificateErrors.Length == 0);
-
return ssl.RequireClientCertificate ? (certificate != null) : true;
}
}
}
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/src/Mono.WebServer/XSPWorkerRequest.cs new/xsp-1.1.16.1/src/Mono.WebServer/XSPWorkerRequest.cs
--- old/xsp-1.1.13.7/src/Mono.WebServer/XSPWorkerRequest.cs 2006-04-26 02:12:39.000000000 +0200
+++ new/xsp-1.1.16.1/src/Mono.WebServer/XSPWorkerRequest.cs 2006-07-06 00:27:10.000000000 +0200
@@ -106,7 +106,11 @@
server_software = String.Format ("{0}/{1}", title, version);
serverHeader = String.Format ("Server: {0} {1}\r\n", server_software, plat);

+#if NET_2_0
+ string indexes = ConfigurationManager.AppSettings ["MonoServerDefaultIndexFiles"];
+#else
string indexes = ConfigurationSettings.AppSettings ["MonoServerDefaultIndexFiles"];
+#endif
SetDefaultIndexFiles (indexes);
}

@@ -117,10 +121,11 @@

bool is_linux = false;
try {
- Stream st = File.OpenRead ("/proc/sys/kernel/ostype");
- StreamReader sr = new StreamReader (st);
- string os = sr.ReadToEnd ();
- sr.Close ();
+ string os = "";
+ using (Stream st = File.OpenRead ("/proc/sys/kernel/ostype")) {
+ StreamReader sr = new StreamReader (st);
+ os = sr.ReadToEnd ();
+ }
is_linux = os.StartsWith ("Linux");
} catch {
}
@@ -190,6 +195,9 @@
keepAlive = false;
}

+ if (secure)
+ keepAlive = false; //FIXME: until the NetworkStream don't own the socket for ssl streams.
+
responseHeaders = new StringBuilder ();
responseHeaders.Append (serverHeader);
status = protocol + " 200 OK\r\n";
@@ -278,7 +286,7 @@
string value = line.Substring (colon + 1).Trim ();
headers [key] = value;
}
- } catch (IOException ioe) {
+ } catch (IOException) {
throw;
} catch (Exception e) {
throw new Exception ("Error reading headers.", e);
@@ -337,7 +345,7 @@

if (finalFlush)
CloseConnection ();
- } catch (Exception e) {
+ } catch (Exception) {
CloseConnection ();
}
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/src/server.cs new/xsp-1.1.16.1/src/server.cs
--- old/xsp-1.1.13.7/src/server.cs 2006-04-26 02:12:39.000000000 +0200
+++ new/xsp-1.1.16.1/src/server.cs 2006-07-06 00:27:10.000000000 +0200
@@ -29,6 +29,7 @@

using System;
using System.Configuration;
+using System.Collections.Specialized;
using System.Diagnostics;
using System.IO;
using System.Net;
@@ -226,26 +227,36 @@
}
#endif

+ static NameValueCollection AppSettings {
+ get {
+#if NET_2_0
+ return ConfigurationManager.AppSettings;
+#else
+ return ConfigurationSettings.AppSettings;
+#endif
+ }
+ }
+
public static int Main (string [] args)
{
SecurityConfiguration security = new SecurityConfiguration ();
bool nonstop = false;
bool verbose = false;
Trace.Listeners.Add (new TextWriterTraceListener (Console.Out));
- string apps = ConfigurationSettings.AppSettings ["MonoApplications"];
- string appConfigDir = ConfigurationSettings.AppSettings ["MonoApplicationsConfigDir"];
- string appConfigFile = ConfigurationSettings.AppSettings ["MonoApplicationsConfigFile"];
- string rootDir = ConfigurationSettings.AppSettings ["MonoServerRootDir"];
+ string apps = AppSettings ["MonoApplications"];
+ string appConfigDir = AppSettings ["MonoApplicationsConfigDir"];
+ string appConfigFile = AppSettings ["MonoApplicationsConfigFile"];
+ string rootDir = AppSettings ["MonoServerRootDir"];
object oport;
- string ip = ConfigurationSettings.AppSettings ["MonoServerAddress"];
+ string ip = AppSettings ["MonoServerAddress"];
bool master = false;
#if MODMONO_SERVER
- string filename = ConfigurationSettings.AppSettings ["MonoUnixSocket"];
+ string filename = AppSettings ["MonoUnixSocket"];
#endif
if (ip == "" || ip == null)
ip = "0.0.0.0";

- oport = ConfigurationSettings.AppSettings ["MonoServerPort"];
+ oport = AppSettings ["MonoServerPort"];
if (oport == null)
oport = 8080;

@@ -394,7 +405,7 @@

rootDir = Directory.GetCurrentDirectory ();

- IWebSource webSource;
+ WebSource webSource;
#if MODMONO_SERVER
if (useTCP) {
webSource = new ModMonoTCPWebSource (ipaddr, port, lockfile);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/test/2.0/menu/menu1.aspx new/xsp-1.1.16.1/test/2.0/menu/menu1.aspx
--- old/xsp-1.1.13.7/test/2.0/menu/menu1.aspx 2006-04-26 02:12:39.000000000 +0200
+++ new/xsp-1.1.16.1/test/2.0/menu/menu1.aspx 2006-07-06 00:27:09.000000000 +0200
@@ -4,7 +4,6 @@
void Menu1_MenuItemClick(Object s, System.Web.UI.WebControls.MenuEventArgs e)
{
Label1.Text = "You selected " + e.Item.Text;
- Page.Header.Metadata ["un"] = "dos";
Page.Header.Title = "You selected " + e.Item.Text;
}

diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/tools/asp_state/asp-state.exe.config new/xsp-1.1.16.1/tools/asp_state/asp-state.exe.config
--- old/xsp-1.1.13.7/tools/asp_state/asp-state.exe.config 2006-04-07 22:29:55.000000000 +0200
+++ new/xsp-1.1.16.1/tools/asp_state/asp-state.exe.config 2006-07-06 00:27:10.000000000 +0200
@@ -4,7 +4,7 @@
<application name="ASP.NET State Server">
<service>
<wellknown mode="Singleton"
- type="System.Web.SessionState.RemoteStateServer, System.Web"
+ type="System.Web.SessionState.RemoteStateServer, System.Web,Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
objectUri="StateServer" />
</service>
<channels>
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/tools/asp_state/asp-state2.exe.config new/xsp-1.1.16.1/tools/asp_state/asp-state2.exe.config
--- old/xsp-1.1.13.7/tools/asp_state/asp-state2.exe.config 2006-04-07 22:29:55.000000000 +0200
+++ new/xsp-1.1.16.1/tools/asp_state/asp-state2.exe.config 2006-07-06 00:27:10.000000000 +0200
@@ -4,7 +4,7 @@
<application name="ASP.NET State Server">
<service>
<wellknown mode="Singleton"
- type="System.Web.SessionState.RemoteStateServer, System.Web"
+ type="System.Web.SessionState.RemoteStateServer, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
objectUri="StateServer" />
</service>
<channels>
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/tools/dbsessmgr/dbsessmgr.cs new/xsp-1.1.16.1/tools/dbsessmgr/dbsessmgr.cs
--- old/xsp-1.1.13.7/tools/dbsessmgr/dbsessmgr.cs 2006-04-26 02:12:39.000000000 +0200
+++ new/xsp-1.1.16.1/tools/dbsessmgr/dbsessmgr.cs 2006-07-06 00:27:10.000000000 +0200
@@ -17,6 +17,8 @@

internal sealed class DbSession {

+ static string paramPrefix;
+
private delegate void DbSessionCommand (IDbConnection conn);

private static int Main (string [] args)
@@ -42,10 +44,10 @@
using (IDbCommand command = conn.CreateCommand ()) {
IDataParameterCollection param;

- command.CommandText = "DELETE FROM ASPStateTempSessions WHERE Expires < :Now";
+ command.CommandText = "DELETE FROM ASPStateTempSessions WHERE Expires < " + paramPrefix + "Now";

param = command.Parameters;
- param.Add (CreateParam (command, DbType.DateTime, ":Now", DateTime.Now));
+ param.Add (CreateParam (command, DbType.DateTime, "Now", DateTime.Now));

command.ExecuteNonQuery ();
}
@@ -70,7 +72,7 @@
Console.WriteLine ();

using (IDbCommand command = conn.CreateCommand ()) {
- command.CommandText = "SELECT * from aspstatetempsessions";
+ command.CommandText = "SELECT * FROM ASPStateTempSessions";

using (IDataReader reader = command.ExecuteReader ()) {
while (reader.Read ()) {
@@ -102,7 +104,7 @@
string asm, type, conn_str;
IDbConnection conn;

- GetConnectionData (out asm, out type, out conn_str);
+ GetConnectionData (out asm, out type, out conn_str, out paramPrefix);

Assembly dbAssembly = Assembly.LoadWithPartialName (asm);
Type cnc_type = dbAssembly.GetType (type, true);
@@ -118,23 +120,20 @@
}

private static void GetConnectionData (out string asm,
- out string type, out string conn_str)
+ out string type, out string conn_str,
+ out string param_prefix)
{
asm = null;
type = null;
conn_str = null;
+ param_prefix = null;

- NameValueCollection config = ConfigurationSettings.AppSettings as NameValueCollection;
+ NameValueCollection config = ConfigurationSettings.AppSettings;
if (config != null) {
- foreach (string s in config.Keys) {
- if (0 == String.Compare ("DBProviderAssembly", s, true)) {
- asm = config [s];
- } else if (0 == String.Compare ("DBConnectionType", s, true)) {
- type = config [s];
- } else if (0 == String.Compare ("DBConnectionString", s, true)) {
- conn_str = config [s];
- }
- }
+ asm = config ["DBProviderAssembly"];
+ type = config ["DBConnectionType"];
+ conn_str = config ["DBConnectionString"];
+ param_prefix = config ["DBParamPrefix"];
}

if (asm == null || asm == String.Empty)
@@ -145,6 +144,9 @@

if (conn_str == null || conn_str == String.Empty)
conn_str = "SERVER=127.0.0.1;USER ID=monostate;PASSWORD=monostate;dbname=monostate";
+
+ if (param_prefix == null || param_prefix == String.Empty)
+ param_prefix = ":";
}

private static DbSessionCommand GetCommand (string [] args)
@@ -178,7 +180,7 @@
{
IDataParameter result = command.CreateParameter ();
result.DbType = type;
- result.ParameterName = name;
+ result.ParameterName = paramPrefix + name;
result.Value = value;
return result;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xsp-1.1.13.7/tools/dbsessmgr/dbsessmgr.exe.config new/xsp-1.1.16.1/tools/dbsessmgr/dbsessmgr.exe.config
--- old/xsp-1.1.13.7/tools/dbsessmgr/dbsessmgr.exe.config 2006-04-26 02:12:39.000000000 +0200
+++ new/xsp-1.1.16.1/tools/dbsessmgr/dbsessmgr.exe.config 2006-07-06 00:27:10.000000000 +0200
@@ -7,6 +7,8 @@
value="Npgsql.NpgsqlConnection"/>
<add key="DBConnectionString"
value="SERVER=127.0.0.1;USER ID=monostate;PASSWORD=monostate;dbname=monostate"/>
+ <add key="DBParamPrefix"
+ value=":" />
</appSettings>
</configuration>



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...


< Previous Next >
This Thread