Re: [Mono-dev] TCP Async

2012-08-16 Thread Gonzalo Paniagua Javier
On Thu, Aug 9, 2012 at 11:57 AM, Greg Young gregoryyou...@gmail.com wrote:
 This would be a good one to get into trunk
 https://github.com/ysw/mono-socket-problem/blob/master/Patches/cb_fix.patch

Rodrigo, I did the patch above and it seems to make things better for
Greg. I can't push it right now, can you?

-Gonzalo
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] ConcurrentStack with value type in 2.10

2012-07-22 Thread Gonzalo Paniagua Javier
I have added bug #6229 with this information:
https://bugzilla.xamarin.com/show_bug.cgi?id=6229

-Gonzalo

On Sun, Jul 22, 2012 at 4:10 AM, Yuriy Solodkyy yu...@couldbedone.com wrote:
 Hi,

 It looks like the ConcurrentStack does not work with big enough
 structures anymore.  12 bytes struct is enough to reproduce the
 problem occasionally, 16 bytes structure to reproduce it immediately.
 It worked fine in mono 2.8.  The following code shows that we may pop
 inconsistent structure from the stack from time to time.

 using System;
 using System.Collections.Concurrent;
 namespace CocurrentTest {
 class MainClass {
 struct Data {
 public int A; public int B; public int C; public int 
 D;
 public Data(int v) {
 A = v; B = -v; C = v; D = -v;
 }
 }

 public static void Main (string[] args) {
 Console.WriteLine (Hello World!);
 var data = new byte[1024 * 1024];
 var stack = new ConcurrentStackData ();

 for (var i = 0; i  50; i++) {

 var thread = new System.Threading.Thread (v 
 = {

 var rnd = new Random ();
 while (true) {
 int pushCount = rnd.Next (50);
 int popCount = rnd.Next (50);

 for (var k = 0; k 
 pushCount; k++) {


 var sample =
 new Data (rnd.Next(Int32.MaxValue));
 CheckSample (sample);

 stack.Push (sample);
 }

 for (var k = 0; k 
 popCount; k++) {
 Data
 retrievedSample = new Data();
 if
 (stack.TryPop (out retrievedSample)) {

 CheckSample (retrievedSample);
 }
 }
 }
 }
 );

 thread.Start ();
 }
 }

 static void CheckSample (Data sample){
 if (sample.A != -sample.B || sample.A !=
 sample.C || sample.B != sample.D)
 throw new Exception (string.Format
 (Invalid sample detected));
 }
 }
 }


 --
 Yuriy Solodkyy
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] TCP Async

2012-07-21 Thread Gonzalo Paniagua Javier
On Tue, Jul 17, 2012 at 7:49 AM, Greg Young gregoryyou...@gmail.com wrote:
 Hey all.

 As this is a big issue for us and I feel a huge problem for mono in general
 at this point as it means sockets basically dont work which is a strong
 point of unix environments, I would like to propose something I have done in
 the past. I am willing to offer a bounty (personally) for a working fix to
 this section of code of $500 usd (more if done quickly).

 Acceptance criteria is the included test working in a stable fashion in
 Linux / bsd but just Linux is acceptable as well,

Hi Greg.

I have the test working with a tiny little change in mono master
(applies cleanly to mono-2-10) *and* a change in your test code to
avoid using ConcurrentQueue (I keep getting array index out of bounds
here).
The change to your test code is here: https://gist.github.com/3158357

Last line before I interrupted the test (server):
# Total connections: 100. Out:   3778.3kb/s  In:   3549.7kb.s  Pending
Send: 0  In Send: 0  Pending Received: 0

Last line before I interrupted the test (client):
# Total connections: 100. Out:   3548.5kb/s  In:   3851.7kb.s  Pending
Send: 10278  In Send: 45359  Pending Received: 0

Can you make the payment through Paypal? :-)

-Gonzalo
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] TCP Async

2012-06-28 Thread Gonzalo Paniagua Javier
On Wed, Jun 27, 2012 at 9:23 AM, Greg Young gregoryyou...@gmail.com wrote:
 Trying to get it into a testcase has been very difficult unfortunately
 we only really see it at saturation levels and not commonly. Seems
 like some kind of internal race condtion.

 Are the begin/end calls more stable and preferable at this time?

You don't say which version of Mono you are using. IF you are not
using the latest release in the 2.10.x series or build from sources
(master), you should update.
The *Async calls end up being similar internally, only that some
objects are reused.

-Gonzalo
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Potential security problem on EndPointManager.cs

2012-03-24 Thread Gonzalo Paniagua Javier
On Sat, Mar 24, 2012 at 9:38 AM, 정연운(Jung, Yeonwoon) flo...@gmail.com wrote:
[...]

 As you might know, this could be a potential vulnerability in term of
 network security. If someone opens port on their machine with multiple
 network interfaces combined with public/private IPs, even the person
 restricted biding for private network on purpose, mono runtime doesn't bind
 IP address as expected. As a result, the port is available on public network
 as well.

 i already sent a request of pulling on github, pls review and take it.

Done. Thanks.

-Gonzalo
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Performance counters are not working under linux mono platform

2012-02-10 Thread Gonzalo Paniagua Javier
On Fri, Feb 10, 2012 at 2:55 AM, Gonzalo Paniagua Javier
gonzalo.m...@gmail.com wrote:
 On Fri, Feb 10, 2012 at 12:43 AM, balaji bala...@amiindia.co.in wrote:
 Hi,

 Does anyone know why Performance counters return zero value in the code
 below when executing under linux mono platform.

                  (OR)

 How to get a process performance counters like CPU,Memory,Thread
 count,Handle Count and other resource utilization of a machine,when the
 process is running in a remote machine?

Oh, and as for reading from a remote machine, there are no builtin
capabilities. We did that once by using ssh to run a small C# program
that read the performance counters of the Mono process we were
interested in.

-Gonzalo
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Performance counters are not working under linux mono platform

2012-02-10 Thread Gonzalo Paniagua Javier
On Fri, Feb 10, 2012 at 5:55 AM, balaji bala...@amiindia.co.in wrote:


 HI Gonzalo ,

   Thanks for the info..

 Can you clarify the following

Is there any possibility to get performance counter values for non-mono
 specific processes of a linux machine through C# program.

  i have tried to get performance counter values for a mono processsome
 how i was successful but not for other processes
  running under linux.

 In mono release note under performance counters they mention that

 performance counters will work only with in the mono process but not across
 the processes what is it mean?

It means that only mono processes are able to produce the performance
counters. If you provide a PID of another process, everything will be
0. However, you could see how Mono generates some of those performance
counters (number of threads, memory) and do the same. Some of that
data comes from /proc/[PID] or similar.

-Gonzalo
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Test

2012-01-13 Thread Gonzalo Paniagua Javier
This is a test.

-Gonzalo
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Test

2012-01-13 Thread Gonzalo Paniagua Javier
Ignore.

-Gonzalo
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] StackOverflow on System.Delegate.Equals

2011-04-04 Thread Gonzalo Paniagua Javier
On Mon, 2011-04-04 at 20:48 +0100, Alan wrote:
 Aren't event handler methods emitted with a [synchronized] attribute
 by default which would prevent this issue? You can check by
 disassembling the IL and seeing if its there. 

They are synchronized as long as you don't replace the default
add/remove with your own code.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] System.Windows.Forms.Mime: Use freedesktop.org only on Unix platforms.

2011-03-29 Thread Gonzalo Paniagua Javier
On Tue, 2011-03-29 at 14:02 -0500, Vincent Povirk wrote:
 This shouldn't be used in an environment like Wine, where the FDO mime
 files of a real Windows system can be accessed.

Applied to mono-2-10 and master.

Thanks!

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] threadpool win32 breakage, getting worse

2011-03-18 Thread Gonzalo Paniagua Javier
On Tue, 2011-03-15 at 19:15 +0900, Atsushi Eno wrote:
 Gonzalo,
 
 Can you please fix Windows threadpool issue first before it becomes
 worse than the previous state that we could only revert it to 32b3b31?
 
 Now we cannot even revert it to that revision:
 
 threadpool.c:2025: error: too few arguments to function
 `mono_thread_create_internal'
 threadpool.c:2027: error: too few arguments to function
 `mono_thread_create_internal'
 threadpool.c: In function
 `ves_icall_System_Threading_ThreadPool_SetMaxThreads':
 
 threadpool.c:2048: warning: passing arg 1 of `InterlockedExchange' from
 incompatible pointer type
 threadpool.c:2049: warning: passing arg 1 of `InterlockedExchange' from
 incompatible pointer type
 make[3]: *** [libmonoruntime_la-threadpool.lo] Error 1
 make[3]: Leaving directory `/home/atsushi/svn/mono/mono/metadata'

This is fixed now in master.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] Replace ENABLE_COREE with a runtime switch.

2011-03-17 Thread Gonzalo Paniagua Javier
On Mon, 2011-03-07 at 14:11 -0600, Vincent Povirk wrote:
 This patch mostly reverts 666d37829304e85f72969c44e92bc11ca167a272,
 which put Mono's mixed-mode support in #ifdef ENABLE_COREE, disabling
 it by default on Windows.
 
 It was disabled because it broke the verifier, and it still does.
 
 Since most of the new behavior is dependent on whether coree has been
 hooked, or whether a particular image has been loaded using the OS
 loader, skipping the hook step effectively disables coree at runtime.
 So this patch moves that step out of mono_init_internal and into
 mono_main, where it is dependent on a runtime switch.
 
 Even if this didn't break the verifier, I think it's an intrusive,
 hacky change to how Mono loads things that almost no one needs, and so
 having it default off makes sense. Also, (my real motive) it's a step
 towards my goal of getting Wine's builtin mscoree.dll to use Mono's
 mixed-mode support without indirectly causing itself to be hooked.

Anyone? If nobody complains, I'll check this in...

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCHES] Improve process exit/wait handling

2011-03-16 Thread Gonzalo Paniagua Javier
Awesome patches. Comments below.

On Thu, 2011-03-17 at 00:26 +0100, Rolf Bjarne Kvinge wrote:
[...]
 4) Improve waiting on processes a lot
 
Here are all the juicy bits: I changed process waiting to use
a SIGCHLD handler and automatically wait on all processes.
This fixes #668867. I also added a semaphore, so waits are now
properly handled by using that semaphore instead of polling
every 100ms.

In mono_sigchld_signal_handler(), there's this line:

while ((pid = waitpid (-1, status, WNOHANG))  0) {

You need to handle EINTR. Also info-si_pid has the PID of the process
that triggered the signal so you could avoid doing a 'while' and call
waitpid() like waitpid (info-si_pid, 

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] FileSystemWatcher on Windows (compared to .NET4)

2011-02-09 Thread Gonzalo Paniagua Javier
On Mon, 2011-02-07 at 14:28 -0800, kpfaulkner wrote:
 Hi
 
 I've noticed that the results for renamed and delete events on mono
 (2.8.2) and native .NET 4 are different.
 
 If I rename a directory for example I get:
 
  - mono  I get a bunch of delete and create's...  which is fairly useful.
  - .NET 4 I get a simple renamed event for the parent directory. No
 information about the contents.
 
 Although I find monos results far more useful (means I dont have to code up
 the subdir listing to get filenames myself) I'm thinking that
 compatibility/consistency with real .NET is more important.
 
 Could someone tell me if this is an intentional difference, or whether this
 is simply a bug that I need to register.

On Windows, Mono uses the default backend for monitoring files, which
does not use any OS APIs. That backend has no way of knowing the
difference between a rename and a delete|create.

On linux, we use inotify and the events will defer (you can make Mono
the default backend if that's what you want. Check out the mono(1)
manual page).

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Finalizers in CriticalHandle

2011-01-21 Thread Gonzalo Paniagua Javier
On Thu, 2011-01-20 at 16:15 +, Dick Porter wrote:
 On 17 Jan 2011, at 6:00PM, Rodrigo Kumpera wrote:
  I'm not sure what the defined behavior is on this case, MSDN is not  
  always accurate and we
  need to be as compatible with MS as possible.
 
  Could you please write a test case, and if the behavior you suggest  
  is correct, send a patch
  which includes both the fix and the test case so we can move forward?
 
 Please see attached test case and diff.

I think a more correct patch would be the one attached. Avoids having
'if (Invalid) return;' followed by 'if (!Invalid)...'.

-Gonzalo

diff --git a/mcs/class/corlib/System.Runtime.InteropServices/CriticalHandle.cs b/mcs/class/corlib/System.Runtime.InteropServices/CriticalHandle.cs
index 479dc44..ce50aff 100644
--- a/mcs/class/corlib/System.Runtime.InteropServices/CriticalHandle.cs
+++ b/mcs/class/corlib/System.Runtime.InteropServices/CriticalHandle.cs
@@ -47,17 +47,14 @@ namespace System.Runtime.InteropServices
 			if (_disposed)
 return;
 
-			_disposed = true;
-			if (IsInvalid)
-return;
-
-			if (disposing == true  !IsInvalid){
-if (!ReleaseHandle ()) {
+			if (!IsInvalid){
+if (!_disposed  !ReleaseHandle ()) {
 	GC.SuppressFinalize (this);
 } else {
 	// Failed in release...
 }
 			}
+			_disposed = true;
 		}
 
 		[ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Bug in System.Web.Caching.Get() / Timer.Change() ?

2010-11-23 Thread Gonzalo Paniagua Javier
On Mon, 2010-11-22 at 15:05 +0100, jriepsh...@ujam.com wrote:
 Dear all,
 
 on running Stress Test on our program, we encountered following exception:
 
 System.ArgumentException: Key 'System.Threading.Timer' already exists in list.
   at System.Collections.SortedList.PutImpl (System.Object key, System.Object 
 value, Boolean overwrite) [0x0] in filename unknown:0 
   at System.Collections.SortedList.Add (System.Object key, System.Object 
 value) [0x0] in filename unknown:0 
   at System.Threading.Timer+Scheduler.Add (System.Threading.Timer timer) 
 [0x0] in filename unknown:0 
   at System.Threading.Timer+Scheduler.Change (System.Threading.Timer timer, 
 Int64 new_next_run) [0x0] in filename unknown:0 
   at System.Threading.Timer.Change (Int64 dueTime, Int64 period, Boolean 
 first) [0x0] in filename unknown:0 
   at System.Threading.Timer.Change (Int64 dueTime, Int64 period) [0x0] in 
 filename unknown:0 
   at (wrapper remoting-invoke-with-check) System.Threading.Timer:Change 
 (long,long)
   at System.Web.Caching.Cache.Get (System.String key) [0x0] in filename 
 unknown:0 
 
 
 This happens when we look something up in the Caching object

What version are you running on? There have been recent changes in both
the sys.web cache and Timer that should fix this problem.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Problem building mono-2.8.1

2010-11-23 Thread Gonzalo Paniagua Javier
On Tue, 2010-11-23 at 13:31 +, Paul F. Johnson wrote:
 Hi,
 
 Just working through the latest tarballs and have found I can't build
 due to the following
 
 /home/paul/rpmbuild/BUILD/mono-2.8.1/mcs/class/lib/moonlight_raw/System.dll 
 (Location of the symbol related to previous warning)
 ../System/System.Net.Sockets/Socket_2_1.cs(488,69): error CS0117:
 `System.Net.Sockets.SocketType' does not contain a definition for
 `Dgram'
 System.Net.Sockets/SocketType_2_1.cs(27,21): (Location of the symbol
 related to previous error)
 ../System/System.Net.Sockets/Socket_2_1.cs(519,55): error CS0117:
 `System.Net.Sockets.SocketType' does not contain a definition for
 `Dgram'
 System.Net.Sockets/SocketType_2_1.cs(27,21): (Location of the symbol
 related to previous error)
 
 Is there a patch to fix this?

I just pushed one: mono-2-8 79d5f2e

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] XSP: FastCGI Backend should handle unmanaged socket error 10038 on close

2010-11-04 Thread Gonzalo Paniagua Javier
On Sat, 2010-02-20 at 15:30 -0600, Tiaan Geldenhuys wrote:
 [Reposting -- should have done it earlier. The mailing-list servers were
 weird over new-year's weekend, since it told me I was sending emails from
 the future; now actually being in the future, I hope that resending emails
 from the past is okay.]
 
 
 The attached patch prevents the following error from showing up in the XSP
 FastCGI Backend's error log, which seems to be harmless but it happens on
 every web request since 2.6 when using the UnmanagedSocket implementation:
Failed to process connection. Reason: The descriptor is not a socket
 These errors happen after the requests are completely handled, so they don't
 really interfere too much except maybe for slowing things down with the
 extra exception processing and the growing log file.

Finally applied this patch to the mono-2-8 branch and master.
Thanks. Better late than never ;-)

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] High Traffic Site (for Harry Potter 7) is crashing!

2010-10-26 Thread Gonzalo Paniagua Javier
On Tue, 2010-10-26 at 13:59 -0700, Matthew Urbano wrote:
 I've created a site for the new Harry Potter movie which is expected
 to get a high volume of traffic, and on launch day we are now
 crashing.

 We are getting the following errors on the webservers due to traffic:
 
 Maximum number of concurrent mod_mono requests
 to /tmp/mod_mono_dashboard_default_2.lock reached (20 active, 20
 waiting). Request dropped.
 
 I have the following config:
 
 User nobody
 
 Group nobody
 
 include /etc/httpd/conf/mod_mono.conf
 
 MonoSetEnv MONO_THREADS_PER_CPU=500

 And have also added this: 
 
 MonoMaxActiveRequests 0
 
 MonoMaxWaitingRequests 0

These settings should get rid of the warning after an apache restart.
Make sure there are no mod-mono-server processes around after you stop
apache.

If they don't work, try adding the optional server alias like this:
MonoMaxActiveRequests default 0
MonoMaxWaitingRequests default 0

Also add the server alias to MonoSetEnv.

 These settings do not seem to be taking affect.  What other steps
 should we take to allow mono to handle the traffic?

The real fix would be to upgrade to Mono 2.8. Those 3 settings were
recommended prior to mono 2.8 to be able to deal with high traffic due
to limitations in our thread pool implementation.

Mono 2.8+ has a new thread pool implementation and mod_mono 2.8+
defaults to 0 for those two MonoMax* directives (which should be
obsoleted soon).

Let us know if either adding the server alias or upgrading to mono 2.8
fixes your problem.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] High Traffic Site (for Harry Potter 7) is crashing!

2010-10-26 Thread Gonzalo Paniagua Javier
Oh, forgot another small detail.
What does 'ulimit -n' report in that server?

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [Patch] Fix bug where HttpWebRequest.BeginResponse never completes

2010-10-04 Thread Gonzalo Paniagua Javier
On Thu, 2010-09-30 at 20:16 -0400, Bassam Tabbara wrote:
 We are seeing a case where HttpWebRequest.BeginResponse never
 completes even through there is a response outstanding on the
 connection. We see this with mono 2.6.7. I’ve traces this down to the
 HttpWebRequest.SetResponseData method. Attached is a patch that fixes
 the problem. 

Patch applied to mono-2-6 and master.

Thanks.

-Gonzalo



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] HttpListener https bug?

2010-09-09 Thread Gonzalo Paniagua Javier
On Wed, 2010-09-08 at 18:10 -0700, salar2k wrote:
 Guess it doesn't needed because the issue occurs even with your peace of
 program.
 
 And yes i'm working on kind of proxy software. (is that important?)

Yes. The way the browser tries to set up a https connection through the
proxy is by using the CONNECT method over an unencrypted connection that
is later turned into an encrypted one (tunneled through the proxy).
HttpListener is expecting a TLS connection and the browser is sending
plain text data... That's why the connection is being reset.

You would need to listen with http://*:9667/ and then handle the CONNECT
method appropriately.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] HttpListener https bug?

2010-09-08 Thread Gonzalo Paniagua Javier
On Tue, 2010-09-07 at 22:56 -0700, salar2k wrote:
 Thanks for the reply.
 
 I've done the way you did and it works. But that was not my issue. 
 
 Try to set browser's proxy to localhost:9667 and browse
 https://mail.google.com/mail/ .
 You will see it doesn't work and connection resets.
 
 This happens only when you're using https in listener.
 Change l.Prefixes.Add (https://*:9667/;);  to l.Prefixes.Add
 (http://*:9667/;);  and browse http://www.google.com
 it works as expected with a message Hello world!.

You didn't mention any proxy before. Why don't you send the code of your
listener?

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] HttpListener https bug?

2010-09-07 Thread Gonzalo Paniagua Javier
I've followed the steps in
http://www.mono-project.com/UsingClientCertificatesWithXSP to create a
root certificate and a client certificate (instead of generating a .p12,
I created a .pvk and a .cer) and then used the client certificate as
my server's.

Then I created a small program (attached hl.cs) and run **Mono's**
httpcfg to associate the certificate with port 9667. Everything worked
just fine with Mono (and on .NET, since I didn't use their httpcfg, you
get a connection reset error.

See the screenshot at http://gonzalo.name/tmp/httplistener2.png

-Gonzalo


On Sun, 2010-09-05 at 22:11 -0700, salar2k wrote:
 I'm trying to use Mono HttpListener but after some test I'm running into an
 issue with HttpS.
 The project works well with simple http requests but just doesn't serve
 https.
 
 Here is what I've done to use it (win7), first try to create certificate
 files:
 
 makecert -r -pe -n CN=SALARPC -b 01/01/2000 -e 01/01/2040 -eku
 1.3.6.1.5.5.7.3.1 -ss my -sr localMachine -sky exchange -sp Microsoft RSA
 SChannel Cryptographic Provider -sy 12 -sv local.pvk local.cer
 
 (this is microsoft makecert application)
 
 I've create certifications without password.
 and registration of files to the port:
 
 httpcfg -add -port 9667 -pvk local.pvk -cert local.cer
 
 All is done successfully.
 Unfortunately it doesn't response to https port.
 (note: actually httpcfg copies cer and pvk files for port 9667 to here:
 C:\Users\USERNAME\AppData\Roaming\.mono\httplistener)
 
 Second try with openssl and pvktool:
 
 openssl genrsa -des3 -out localhost.pem 2048
 openssl rsa -in localhost.pem -out localhost.pem.nopass
 openssl req -new -key localhost.pem.nopass -out localhost.csr
 
 pvk -in localhost.pem.nopass -topvk -nocrypt -out localhost.pvk
 
 httpcfg -del -port 9667
 httpcfg -add -port 9667 -pvk localhost.pvk -cert localhost.crt
 
 Still no luck with httplistener and https!
 
 Debugging the mono code I realize that it throws internally an exception
 during reading the request (HttpConnection.cs) which says The
 authentication or decryption has failed.:
 
 System.IO.IOException was caught
   Message=The authentication or decryption has failed.
   Source=Mono.HttpListener
   StackTrace:
at Mono.Security.Protocol.Tls.SslStreamBase.EndRead(IAsyncResult
 asyncResult)
at Mono.Net.HttpConnection.OnRead(IAsyncResult ares)
   InnerException: Mono.Security.Protocol.Tls.TlsException
Message=A message could not be decoded because some field was out
 of the specified range or the length of the message was incorrect.
Source=Mono.HttpListener
 
 Am I doing something wrong! What's the problem?
 Or this is a bug?
 [Mono-2.6.7 - windows 7]
 

using System;
using System.IO;
using System.Net;

namespace ConsoleApplication1 {
	class Class1 {
		static void Main ()
		{
			HttpListener l = new HttpListener ();
			l.Prefixes.Add (https://*:9667/;);
			l.Start ();
			l.BeginGetContext (OnGetContext, l);
			Console.ReadLine ();
		}

		static void OnGetContext (IAsyncResult ares)
		{
			HttpListener l = ares.AsyncState as HttpListener;
			if (l == null)
return;

			try {
HttpListenerContext ctx = l.EndGetContext (ares);
Console.WriteLine (Got request);
l.BeginGetContext (OnGetContext, l);
using (StreamWriter writer = new StreamWriter (ctx.Response.OutputStream)) 
	writer.Write (Hello world!);
ctx.Response.Close ();
Console.WriteLine (Sent request);
			} catch (Exception e) {
Console.WriteLine (e);
Environment.Exit (1);
			}
		}
	}
}

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Cannot get UrlRewriter.net to work with Mono 2.6.7

2010-08-25 Thread Gonzalo Paniagua Javier
On Mon, 2010-08-23 at 19:02 -0700, Matthew Urbano wrote:
 I'm trying to rewrite some URLs using Intelligencia.UrlRewriter.dll
 from UrlRewriter.net.  I have added the reference to the dll, placed
 the dll in the site's bin folder, and added the following lines to my
 web.config
[...] 
 
 Am I missing something on my remote server?  I really don't know what
 I need to do in order to get this working.

I don't remember the details, but either you have to pass *all* the
requests to mod_mono (use SetHandler instead of AddHandler) or, worst
case, use apache's mod_rewrite and convert all your
rewriter.../rewriter rules.

-Gonzalo



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [patch] exception while loading configuration

2010-08-05 Thread Gonzalo Paniagua Javier
On Thu, 2010-08-05 at 16:50 +0200, Jb Evain wrote:
 Hey,
 
 While investigating an issue and running with
 MONO_ENV_OPTIONS=--trace=E:all I noticed that when we're loading the
 current configuration, we throw and immediately swallow an exception
 when there's no .config file for the current executable.
 
 The attached patch makes our internal implementation return null
 instead of throwing.
 
 Comments?

I think I did something like that some time ago and a few applications
broke. Check the history for that file and you'll see.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Migration to GitHub completed!

2010-07-22 Thread Gonzalo Paniagua Javier
Hello,

Our migration to GitHub is now completed.

See http://mono-project.com/GitFAQ for more details.

svn+ssh://mono-cvs.ximian.com/source will be kept alive in read-only
mode.

Happy hacking!

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] [IMPORTANT] Save the date: Migration to git on Thursday July 22nd

2010-07-19 Thread Gonzalo Paniagua Javier
We are moving our source code repository to GitHub.

On July 22nd ~9am EDT (1300 GMT) the subversion repository at svn
+ssh://mono-cvs.ximian.com/source will be set to read-only mode and
kept that way forever.

We estimate that the process of migrating all the projects and moving
them to GitHub will take more than 3 and less than 8 hours. Once it is
completed we will send an email to this list with URLs to the new
repositories, FAQs,...

Thanks.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Migration to git: testing

2010-07-16 Thread Gonzalo Paniagua Javier
Hello,

We are testing the svn to git migration of all (or most of) the projects
in Mono's subversion repository. GitHub is kindly providing their
servers to host the new git repositories.

By now, there are three projects uploaded that can be cloned from the
following URLs:

git://github.com/mono/mono.git
git://github.com/mono/mcs.git
git://github.com/mono/monodevelop.git

Feel free to check them out and report any problem you might find.

If a user is not linked to his id in GitHub it means that he has not
reported his GitHub user name. In this case, go to [1] and enter your
subversion user name (i.e. 'gonzalo') and your GitHub user name (i.e.
'gonzalop'). Then make sure that you add an email account to your GitHub
account.

Enjoy.

-Gonzalo

[1]:
http://spreadsheets.google.com/viewform?hl=enformkey=dEdpdTFoNHBwUUI0clVLRFJtTC02N0E6MQ#gid=0




___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] Implement System.Net.WebClient.set_CachePolicy.

2010-07-16 Thread Gonzalo Paniagua Javier
On Tue, 2010-07-06 at 14:50 -0500, Vincent Povirk wrote:
 The value is currently ignored, but that is a problem for WebRequest.

This is now in svn.
Thanks!

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Test Suite Failures, Revision 2

2010-04-05 Thread Gonzalo Paniagua Javier
On Mon, 2010-04-05 at 14:28 +0900, Atsushi Eno wrote:
  -- test-System_ServiceModel --
  6 sporadic timeouts
  started in r154243 (Gonzalo)
  http://build.mono-project.com/GetFile.aspx?id=2257888
 
 Gonzalo, tell me if you got some fixes. I'll stick to r154237 so far 
 (after updating my repo it was blocking nunit test run there, so I have 
 reverted to older version).

These is fixed now.

I'm attaching a patch for HttpRequestChannel.cs that avoids creating the
ManualResetEvent when nobody needs it. Ok to commit?

-Gonzalo

Index: HttpRequestChannel.cs
===
--- HttpRequestChannel.cs	(revision 154794)
+++ HttpRequestChannel.cs	(working copy)
@@ -317,16 +317,15 @@
 			AsyncCallback callback;
 			ManualResetEvent wait;
 			Exception error;
+			object locker = new object ();
+			bool is_completed;
 
 			public HttpChannelRequestAsyncResult (Message message, TimeSpan timeout, AsyncCallback callback, object state)
 			{
-CompletedSynchronously = true;
 Message = message;
 Timeout = timeout;
 this.callback = callback;
 AsyncState = state;
-
-wait = new ManualResetEvent (false);
 			}
 
 			public Message Response {
@@ -334,7 +333,13 @@
 			}
 
 			public WaitHandle AsyncWaitHandle {
-get { return wait; }
+get {
+	lock (locker) {
+		if (wait == null)
+			wait = new ManualResetEvent (is_completed);
+	}
+	return wait;
+}
 			}
 
 			public object AsyncState {
@@ -355,7 +360,6 @@
 error = error ?? ex;
 
 IsCompleted = true;
-wait.Set ();
 if (callback != null)
 	callback (this);
 			}
@@ -365,7 +369,14 @@
 			}
 
 			public bool IsCompleted {
-get; private set;
+get { return is_completed; }
+set {
+	is_completed = value;
+	lock (locker) {
+		if (is_completed  wait != null)
+			wait.Set ();
+	}
+}
 			}
 
 			public void WaitEnd ()
@@ -376,9 +387,9 @@
 	// exception to the Complete () method and allow the result to complete 'normally'.
 #if NET_2_1
 	// neither Moonlight nor MonoTouch supports contexts (WaitOne default to false)
-	bool result = wait.WaitOne (Timeout);
+	bool result = AsyncWaitHandle.WaitOne (Timeout);
 #else
-	bool result = wait.WaitOne (Timeout, true);
+	bool result = AsyncWaitHandle.WaitOne (Timeout, true);
 #endif
 	if (!result)
 		throw new TimeoutException ();
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] UdpClient.Receive returns invalid IPv6 address.

2010-04-02 Thread Gonzalo Paniagua Javier
On Fri, 2010-04-02 at 17:13 +0400, lost wrote:
 Hello.
 
 I'm using Debian 5 with Mono 2.4.2.3 from backports.org
 I have simple reply application written in F#:

Can you enter this information in bugzila.novell.com (see
mono-project.com/Bugs)?

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] Improve System.Net.WebClient's CreateUri(Uri address) query string handling

2010-03-21 Thread Gonzalo Paniagua Javier
I have checked in a fix in trunk:
http://lists.ximian.com/pipermail/mono-patches/2010-March/168726.html

It should fix the issues you are reporting. If you need this fix in the
2.6/2.4 branches, feel free to backport it.

Thanks.

-Gonzalo

On Sat, 2010-03-20 at 20:50 -0700, Jon Herron wrote:
 With my patch calling DownloadString with either a string or Uri fails the 
 same way under the scenario you describe, where as before they failed in 
 different ways.  With the updated test:
 
 using System;
 using System.Collections.Specialized;
 using System.Net;
 
 public class TestWebClientBug
 {
   public static void Main(string[] args)
   {
 NameValueCollection qs = new NameValueCollection();
 String url = http://localhost/?var1=ok and more text 
 alsovar2=4var3=caribou;
 WebClient wc = new WebClient();
 Uri uri = new Uri(url);
 
 qs.Add(qs_a, 1);
 qs.Add(qs_b, some var);
 qs.Add(qs_c, another);
 
 wc.QueryString = qs;
 
 wc.DownloadString(url);
 wc.DownloadString(uri);
 
 Console.WriteLine(uri.IsAbsoluteUri);
 Console.WriteLine(uri.Query);
 Console.WriteLine(uri.ToString());
   }
 }
 
 2.6.1 yields:
 
 127.0.0.1 - - [20/Mar/2010:19:03:39 -0400] GET /?var1=ok and more text 
 alsovar2=4var3=caribou?qs_a=1qs_b=some+varqs_c=another HTTP/1.1 200 3662
 127.0.0.1 - - [20/Mar/2010:19:03:39 -0400] GET /?var1=ok and more text 
 alsovar2=4var3=caribou?var1=ok%20and%20more%20text%20alsovar2=4var3=caribou
  HTTP/1.1 200 3662
 
 And trunk with my patch yields:
 
 127.0.0.1 - - [20/Mar/2010:19:04:03 -0400] GET /?var1=ok and more text 
 alsovar2=4var3=caribou?qs_a=1qs_b=some+varqs_c=another HTTP/1.1 200 3662
 127.0.0.1 - - [20/Mar/2010:19:04:03 -0400] GET /?var1=ok and more text 
 alsovar2=4var3=caribou?qs_a=1qs_b=some+varqs_c=another HTTP/1.1 200 3662
 
 Granted the second question mark is a problem, but it is consistent - however 
 one could argue a new bug is worse than an existing bug I suppose.  
 
 I'll look at fixing the issue you describe as well, looks like it will need 
 to be fixed for calling the CreateUri with a string or Uri.  Is it safe to 
 assume that the patch won't get committed until this issue is resolved?
 
 Jon
 
 
 --- On Sat, 3/20/10, Gonzalo Paniagua Javier gonzalo.m...@gmail.com wrote:
 
  From: Gonzalo Paniagua Javier gonzalo.m...@gmail.com
  Subject: Re: [Mono-dev] [PATCH] Improve System.Net.WebClient's 
  CreateUri(Uri address) query string handling
  To: mono-devel-list@lists.ximian.com
  Date: Saturday, March 20, 2010, 4:35 AM
  On Fri, 2010-03-19 at 21:08 -0700,
  Jon Herron wrote:
   This patch fixes an issue I ran into when passing a
  Uri to WebClient's
   DownloadString method that contains a query string -
  CreateUri would
   re-append the query string to the end of the
  uri.  This makes
   CreateUri work similar to MakeUri.  I didn't see
  a great way to make a
   test for this, however for this sample app:
   
   using System;
   using System.Net;
   
   public class TestWebClientBug
   {
 public static void Main(string[]
  args)
 {
   String url = http://localhost/?var1=ok and more text
  alsovar2=4var3=caribou;
   WebClient wc = new
  WebClient();
   Uri uri = new Uri(url);
   
   wc.DownloadString(url);
   wc.DownloadString(uri);
 }
   }
   
   In my access logs with mono 2.6.1 I see:
   
   127.0.0.1 - - [19/Mar/2010:19:50:11 -0400] GET
  /?var1=ok%20and%20more%20text%20alsovar2=4var3=caribou
  HTTP/1.1 200 3662
   127.0.0.1 - - [19/Mar/2010:19:50:11 -0400] GET
  /?var1=ok and more text
  alsovar2=4var3=caribou?var1=ok%20and%20more%20text%20alsovar2=4var3=caribou
  HTTP/1.1 200 3662
   
   With this patch applied to trunk:
   
   127.0.0.1 - - [19/Mar/2010:19:50:33 -0400] GET
  /?var1=ok%20and%20more%20text%20alsovar2=4var3=caribou
  HTTP/1.1 200 3662
   127.0.0.1 - - [19/Mar/2010:19:50:33 -0400] GET
  /?var1=ok%20and%20more%20text%20alsovar2=4var3=caribou
  HTTP/1.1 200 3662
  
  I'm afraid your patch might be hiding another issue: can
  you try your
  URL + setting some values in wc.QueryString? What the
  resulting url in
  that case?
  
  -Gonzalo
  
  
  ___
  Mono-devel-list mailing list
  Mono-devel-list@lists.ximian.com
  http://lists.ximian.com/mailman/listinfo/mono-devel-list
  
 
 
   


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [Mono-patches] r153961 - trunk/mono/mono/metadata

2010-03-21 Thread Gonzalo Paniagua Javier
Andreas,

I would just #ifdef out the entire case statement so if that protocol is
used by any program and is not supported, the program will get the
appropriate exception.

-Gonzalo

On Sun, 2010-03-21 at 14:55 -0400, Andreas Färber
(andreas.faer...@web.de) wrote:
 Author: afaerber
 Date: 2010-03-21 14:55:50 -0400 (Sun, 21 Mar 2010)
 New Revision: 153961
 
 Modified:
trunk/mono/mono/metadata/ChangeLog
trunk/mono/mono/metadata/socket-io.c
 Log:
 Handle absence of socket constants
 
 AF_SNA, AF_DECnet and SOCK_RDM are not part of POSIX, and Haiku does not
 supply them.
 Check for their presence before using them, as already done for AF_IPX.
 
 2010-03-21  Andreas Faerber  andreas.faer...@web.de
 
   * socket-io.c: Don't depend on AF_SNA, AF_DECnet,
   SOCK_RDM.
 
 This commit is licensed under the MIT X11 license.
 
 Modified: trunk/mono/mono/metadata/ChangeLog
 ===
 --- trunk/mono/mono/metadata/ChangeLog2010-03-21 18:06:56 UTC (rev 
 153960)
 +++ trunk/mono/mono/metadata/ChangeLog2010-03-21 18:55:50 UTC (rev 
 153961)
 @@ -1,3 +1,10 @@
 +2010-03-21  Andreas Färber  andreas.faer...@web.de
 +
 + * socket-io.c: Don't depend on AF_SNA, AF_DECnet,
 + SOCK_RDM.
 + 
 + Code is contributed under MIT/X11 license.
 +
  2010-03-20  Sanjoy Das san...@playingwithpointers.com
  
   * sgen-gc.c (mono_gc_get_write_barrier): Handle non-aligned
 
 Modified: trunk/mono/mono/metadata/socket-io.c
 ===
 --- trunk/mono/mono/metadata/socket-io.c  2010-03-21 18:06:56 UTC (rev 
 153960)
 +++ trunk/mono/mono/metadata/socket-io.c  2010-03-21 18:55:50 UTC (rev 
 153961)
 @@ -141,11 +141,15 @@
   break;
   
   case AddressFamily_Sna:
 +#ifdef AF_SNA
   family=AF_SNA;
 +#endif
   break;
   
   case AddressFamily_DecNet:
 +#ifdef AF_DECnet
   family=AF_DECnet;
 +#endif
   break;
   
   case AddressFamily_AppleTalk:
 @@ -192,13 +196,17 @@
   break;
  #endif
   
 +#ifdef AF_SNA
   case AF_SNA:
   family=AddressFamily_Sna;
   break;
 +#endif
   
 +#ifdef AF_DECnet
   case AF_DECnet:
   family=AddressFamily_DecNet;
   break;
 +#endif
   
   case AF_APPLETALK:
   family=AddressFamily_AppleTalk;
 @@ -240,7 +248,9 @@
   break;
  
   case SocketType_Rdm:
 +#ifdef SOCK_RDM
   type=SOCK_RDM;
 +#endif
   break;
  
   case SocketType_Seqpacket:
 
 ___
 Mono-patches maillist  -  mono-patc...@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-patches


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [Mono-patches] r153961 - trunk/mono/mono/metadata

2010-03-21 Thread Gonzalo Paniagua Javier
On Sun, 2010-03-21 at 23:54 +0100, Andreas Färber wrote:
 Hi Gonzalo,
 
 Am 21.03.2010 um 23:30 schrieb Gonzalo Paniagua Javier:
 
  I would just #ifdef out the entire case statement so if that  
  protocol is
  used by any program and is not supported, the program will get the
  appropriate exception.
 
 family is assigned the default value of -1. This will happen either way.
 The difference is that this way this happens silently, while  
 #ifdef'ing out the whole case will jump into the default section and  
 print a g_warning about an unknown value.

Oh, then that -1 should already be enough.
Thanks.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] Improve System.Net.WebClient's CreateUri(Uri address) query string handling

2010-03-21 Thread Gonzalo Paniagua Javier
On Sun, 2010-03-21 at 21:34 -0700, Jon Herron wrote:
 Thanks for the commit, there still seems to be an issue when
 WebClient's QueryString property is set - it appears to be ignoring it
 if the address has a query string as well, instead of appending it to
 address' query string.  I've included a patch that works with my test
 case below, any feedback is welcome.

When I tested that, MS ignored WebClient.QueryString in presence of a
query string in the actual URL...

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] Improve System.Net.WebClient's CreateUri(Uri address) query string handling

2010-03-19 Thread Gonzalo Paniagua Javier
On Fri, 2010-03-19 at 21:08 -0700, Jon Herron wrote:
 This patch fixes an issue I ran into when passing a Uri to WebClient's
 DownloadString method that contains a query string - CreateUri would
 re-append the query string to the end of the uri.  This makes
 CreateUri work similar to MakeUri.  I didn't see a great way to make a
 test for this, however for this sample app:
 
 using System;
 using System.Net;
 
 public class TestWebClientBug
 {
   public static void Main(string[] args)
   {
 String url = http://localhost/?var1=ok and more text 
 alsovar2=4var3=caribou;
 WebClient wc = new WebClient();
 Uri uri = new Uri(url);
 
 wc.DownloadString(url);
 wc.DownloadString(uri);
   }
 }
 
 In my access logs with mono 2.6.1 I see:
 
 127.0.0.1 - - [19/Mar/2010:19:50:11 -0400] GET 
 /?var1=ok%20and%20more%20text%20alsovar2=4var3=caribou HTTP/1.1 200 3662
 127.0.0.1 - - [19/Mar/2010:19:50:11 -0400] GET /?var1=ok and more text 
 alsovar2=4var3=caribou?var1=ok%20and%20more%20text%20alsovar2=4var3=caribou
  HTTP/1.1 200 3662
 
 With this patch applied to trunk:
 
 127.0.0.1 - - [19/Mar/2010:19:50:33 -0400] GET 
 /?var1=ok%20and%20more%20text%20alsovar2=4var3=caribou HTTP/1.1 200 3662
 127.0.0.1 - - [19/Mar/2010:19:50:33 -0400] GET 
 /?var1=ok%20and%20more%20text%20alsovar2=4var3=caribou HTTP/1.1 200 3662

I'm afraid your patch might be hiding another issue: can you try your
URL + setting some values in wc.QueryString? What the resulting url in
that case?

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Heads up: building System in trunka and mono-2-6

2010-03-10 Thread Gonzalo Paniagua Javier
If you see any error when compiling System in trunk or 2-6 related to a
type mismatch or similar (System.Net), it means that you need to either
'make clean' or 'make  make install' in Mono.Security before building
System.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Here's a patch for /dev/shm/mono.pid's piling up on Linux

2010-03-03 Thread Gonzalo Paniagua Javier
On Wed, 2010-03-03 at 05:54 -0800, cpMon wrote:
 Here's a patch you should consider for mono-2.6.1. Specifically, I noticed
 that /dev/shm/mono.pid files were piling up and not being cleaned up as they
 should have been. mono-mmap.c tries to get rid of stale ones with a kill but
 they don't check for ENOMEM return which causes the cleanup to fail.
 Additionally, every other time I tried to start mono, it would just quit.
 
 Here's the patch:
 
 470c470
  if (curpid != pid  kill (pid, SIGCONT) == -1  (errno == ESRCH || errno
 == ENOMEM) ) {
 ---
  if (curpid != pid  kill (pid, SIGCONT) == -1  errno == ESRCH) {
 
 This has been tested on various 2.6 Linux boxes successfully.
 
 Cal Page 

I've checked in your change and also changed SIGCONT to 0 (from the
manual page: If  sig  is 0, then no signal is sent, but error checking
is still performed; this can be used to check for the existence of a
process ID or process group ID.). It's in the mono-2-6 branch and
trunk.

Thanks.

-Gonzalo



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Removing Obsolete Code from Mono 2.8

2010-03-01 Thread Gonzalo Paniagua Javier
On Mon, 2010-03-01 at 10:13 -0800, Daniel Morgan wrote:
 Obsolete Types in .NET 4.0
 http://msdn.microsoft.com/en-us/library/ee461503%28VS.100%29.aspx
 
 Here's my 2 cents.
 
 Remove Mono.Data.dll which has been superceded by the provider factory added 
 to System.Data.dll in .NET 2.0.  The Mono.Data.dll assembly has had the 
 Obsolete attributes on it for a long time. 
 
 There are many different versions of the SQLite provider.  However, Mono has 
 a couple of different versions: Mono.Data.SqliteClient which is 1.1 only.  It 
 will not work with NET_2_0 profile unless someone fixes it.  Mono.Data.Sqlite 
 - the 2.0 parts - is based on System.Data.Sqlite.  
 
 Remove Mono.Data.TdsClient since no one uses this.  This assembly is for 
 older Sybase ASE and Microsoft SQL Server databases  version 7.0)
 
 Keep Mono.Data.Tds which is required by System.Data.SqlClient in System.Data 
 assembly and Mono.Data.SybaseClient assembly.
 
 I am okay with old Npgsql, ByteFX, and Firebird being removed.  People should 
 go to the respective project to get the provider.
 
 I am also okay if fxjr adds Npgsql2 to Mono to be distributed with Mono -- 
 only Npgsql2 is maintained in Mono. 
 
 Even though System.Data.OracleClient is considered obsolete in .net 4.0, I 
 think we should keep it for those who need it. 
 
 If no one ones IBM.Data and Mono.Data.SybaseClient, these two can be removed 
 too because they can use System.Data.Obdc to connect to these and other 
 databases.

I agree with Daniel on everything he says here, but for the IBM.Data.
This has to be kept and, if possible, improved to be fully managed.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Making MONO_DISABLE_SHM the default for 2.8 ?

2010-02-25 Thread Gonzalo Paniagua Javier
On Fri, 2010-02-26 at 01:45 +0100, Zoltan Varga wrote:
 
   Mono currently implements a shared handle mechanism to support .net
 applications which share handles between processes, a
 windows feature. This requires sharing state between mono processes,
 which is very problematic, so I would suggest making it opt in mono
 2.8, i.e. introduce a MONO_ENABLE_SHM env variable or a
 --enable-shared-handles command line option for the minority of
 applications which need this.

+1

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Mono servers maintenance: 11am-noon EST Saturday Feb. 20th

2010-02-19 Thread Gonzalo Paniagua Javier
We have just been informed that tomorrow, Saturday 20th, some of the
Mono servers will be shutdown and restarted at some point between 11am
and noon.

This will affect the following servers:
* go-mono.com
* mono-cvs.ximian.com
* mono.ximian.com
* the download and activation servers for MonoTouch and MonoVS.
* wrench.mono-project.com
* forums.monotouch.net

If you experience any glitch during that time, sit back and relax. If
anything happens after that time, let us know as soon as possible and we
will address any issue immediately.

Thanks.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] Fix HashSetT when used with nulls and non-default comparer

2010-02-13 Thread Gonzalo Paniagua Javier
On Sat, 2010-02-13 at 17:39 +0100, Jb Evain wrote:
 Hey Tiaan,
 
 On Fri, Feb 12, 2010 at 3:39 AM, Tiaan Geldenhuys tag...@gmail.com wrote:
  Please review carefully before committing.  (I hope those long expressions
  are right -- they seem to be though.)
 
 Could you please file a bug and attach the patches? Unit tests would
 be extra nice!

For the record,
Tiaan filed https://bugzilla.novell.com/show_bug.cgi?id=579791 and his
patches are now in svn.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] mono 2.6+ : Garbage added to BinaryWriter/GZipStream output?

2010-01-31 Thread Gonzalo Paniagua Javier
On Sun, 2010-01-31 at 13:29 -0500, Miguel de Icaza wrote:
 Hello Hin-Tak,
 
 There was a bug in Mono 2.6 that got fixed in a service release (2.6.1).
 
 Could you confirm which Mono version you are running?   Use: mono 
 --version on the command line.

I applied the patch that Hin-Tak sent in another email to the list a few
days ago.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] poor compression with mono 2.6 (Re: mono 2.6+ : Garbage added to BinaryWriter/GZipStream output?)

2010-01-27 Thread Gonzalo Paniagua Javier
On Thu, 2010-01-28 at 03:19 +, Hin-Tak Leung wrote:
 sorry, attached the wrong patch in the previous e-mail. (ReadStream probably 
 should use NO_FLUSH For performance as well?).
 
 File the issue as Bug 574597 , since mono 2.4 behaves much better (and better 
 than MS .Net), mono 2.6's behavior is probably considered a regression.

Hi there.

Your patch looks good. I'm going to check it in right now into all the
branches where the change is needed.

Could you provide a small test case to be added to our test suite?

Thanks!

-Gonzalo




___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Why not build official site on ASP.NET? Mono should enhance server performance and stability!

2009-12-07 Thread Gonzalo Paniagua Javier
On Mon, 2009-12-07 at 07:57 +0800, Laser Lu wrote:
 I was just wondering, why the mono official site was not built on
 ASP.NET/C#? That would be a good demonstration. 
 
 Currently, I’m developing a Web IM program, and it works fine on
 Windows/.NET. However, the same code had a poor performance on
 Linux/Mono, and seems very unstable.

I don't know what you're doing in your program or what version of Mono
you're using. If you have any kind of problem, you should file a bug
report in bugzilla.novell.com or email to this list providing all the
necessary information for us to address any issue.

-Gonzalo



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Why not build official site on ASP.NET? Mono should enhance server performance and stability!

2009-12-07 Thread Gonzalo Paniagua Javier
On Mon, 2009-12-07 at 07:57 +0800, Laser Lu wrote:
[...]
 So I doubt whether Mono is suitable for developing server programs
 which should be able to handle a huge amount of concurrent requests.

quote [1]I doubt you know what you're talking about/quote [1]
because Mono XSP and a fairly large part of the class libraries have
been tested in environments that are far for demanding than an IM
client.

 I wish the Mono team would pay much more attentions to server
 applications, and enhance the server stability or just concentrate on
 server applications, not just catching up with Microsoft’s new cool
 features. Because Linux/Unix is used as server under 90%
 circumstances, performance and stability is the most import thing!

See [1] above.

-Gonzalo



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Why not build official site on ASP.NET? Mono should enhance server performance and stability!

2009-12-07 Thread Gonzalo Paniagua Javier
On Mon, 2009-12-07 at 15:12 -0200, Rafael Teixeira wrote:
 You could look at the source of MonoTorrent, and also of XSP that does
 use a separate ThreadPool AFAIR.

XSP does not use and has never had a separate threadpool.

-Gonzalo

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Patch

2009-11-16 Thread Gonzalo Paniagua Javier
On Fri, 2009-11-13 at 12:06 -0500, James P Michels III wrote:
 I would like to submit this patch to correct a minor mistake in the 
 DefaultWatcher.cs source.
 
 The change corrects an instance of unsynchronized access to shared state 
 and is probably the intent of the original code.

The patch has been applied to trunk, mono-2-6 and mono-2-4 branches.
Thanks!

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] HttpOnly and Expires not handled by CookieContainer.SetCookies(Uri, string)

2009-10-25 Thread Gonzalo Paniagua Javier
On Sat, 2009-10-24 at 22:20 -0700, Tom Philpot wrote:
 While troubleshooting a web service authentication problem our app is
 having, I noticed that CookieContainer.SetCookies(Uri, string) has a few
 problems.
 
 1) It assumes that the Set-Cookie header only has one cookie in it, since it
 does not account for several comma separated cookies (as the MSDN docs
 state, and RFC 2109 section 4.2.2)
 
 2) It does not properly set Cookie.Expires or Cookie.HttpOnly (for .NET
 2.0). The current implementation will assume that expires=... specifies a
 new cookie. Similarly, HttpOnly will cause the CookieContainer to throw an
 exception when the cookie is being created since it assumes HttpOnly is a
 cookie name with no value.
 
 3) I also noticed most of the CookieContainer tests are marked as
 NotWorking.
 
 Is CookieContainer really that broken, or am I missing something?

There's only 1 known bug in bugzilla related to CookieContainer plus the
tests that are marked as NotWorking. My guess is that what we have is
enough for most of the people using it. It would help if you open new
bugs and attach simple self-contained tests to them.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [Mono-patches] r144627 - in trunk/mcs/class/corlib: System.Threading Test/System.Threading

2009-10-23 Thread Gonzalo Paniagua Javier
On Thu, 2009-10-22 at 09:53 -0400, Sebastien Pouliot wrote:
 On Thu, 2009-10-22 at 11:38 -0200, Rodrigo Kumpera wrote:
  Hey Sebastien,
  
  If a given test doesn't work under MS, please don't mark it as
  NotWorking since this is used to flag problems
  on mono's side and not on the test itself.
 
 The ChangeLog may be a bit confusing but if you look at the patch itself
 you'll see that the test was modified (so it does not fail on MS
 anymore) *and* marked as NotWorking (since this is a now problem on mono
 side).
 
  If the test is bogus just remove it, no need carry such junk forward.
 
 It's not bogus, nor junk. The fix is simple but don't want to apply it
 before talking to Gonzalo about it (who wrote the original test) since I
 don't know if some of our code depends on this behavior.

Calling Monitor.Exit on an object on which Monitor.Enter wasn't called
didn't fail in MS 1.x and does fail since MS 2.0. Mono's behavior
matches MS 1.x. Lng time ago, I thought of fixing it (the fix is
trivial), but that could wreak havoc in a few areas of the class
libraries that I know of and possible more that I don't know about.

Perhaps now that we're deprecating 1.x in trunk it's time to fix this.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] 2.6 preview 1

2009-10-23 Thread Gonzalo Paniagua Javier
On Thu, 2009-10-22 at 15:06 -0700, Anthony Bowker wrote:
 I haven't seen much chatter (on mono-devel-list) recently about the 2.6
 release.
 
 I wondered, is it would be possible to get a fix for
 https://bugzilla.novell.com/show_bug.cgi?id=495957, a regression from 2.2,
 into the 2.6 release?

I just applied the patch to mono-2-4, mono-2-6 and trunk.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] License compiler for mono (the actual tool)

2009-10-21 Thread Gonzalo Paniagua Javier
On Wed, 2009-10-21 at 09:18 +0200, Carlo Kok wrote:
 On 10/17/2009 12:35 AM, Gonzalo Paniagua Javier wrote:
 
  I'm afraid I have no idea how to do that. I've never created a MAN file.
 
  Use one from mono/man as a template and don't be afraid :-)
 
 
 heh,
 
 attached is an lc.1 file that contains the man page for lc. Also 
 attached is a patch for trunk to support the resourceAssembly parameter 
 for runtime license.

The formatting of the patch is a little bit off. Can you fix it and
check the patch into mono-2-4, mono-2-6 and trunk?

I already checked in the man page.

Thanks!

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] License compiler for mono (the actual tool)

2009-10-16 Thread Gonzalo Paniagua Javier
On Fri, 2009-10-16 at 10:15 +0200, Carlo Kok wrote:
 On 10/16/2009 5:20 AM, Gonzalo Paniagua Javier wrote:
  On Tue, 2009-10-13 at 15:43 +0200, Carlo Kok wrote:
  attached to this mail is a (working) license compiler for mono (converts
  a licx file to a .licenses file that can be embedded as a resource).
  Works with the patch I sent earlier but also without (has a temporary
  workaround for that). It accepts the same cmdline arguments as the .NET
  lc.exe and makes it possible to compile these files as required for any
  project that uses commercial components that use license files (most do).
 
  The program.cs file contains the actual logic. It uses Options.cs from
  the mono/windows install (ndesk.options) for the command line parsing.
 
  This is now in mcs/tools/lc (trunk and mono-2-6).
 
  Thanks a lot!
 
 Very cool. This will end up as an executable for future binary builds?

Yes.

 
  -Gonzalo
 
  P.S.: btw, care to contribute a manual page for it?
 
 I'm afraid I have no idea how to do that. I've never created a MAN file.

Use one from mono/man as a template and don't be afraid :-)

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [patch] implements RuntimeLicenseContext (Deserialization) design time serialization

2009-10-15 Thread Gonzalo Paniagua Javier
On Tue, 2009-10-13 at 13:49 +0200, Carlo Kok wrote:
 The attached patch implements the loading into the runtime license 
 context to allow pre-compiled websites  applications with licenses to 
 properly run.
 
 It also implements the DesignTimeLicenseContext serialization support so 
 once an LC compiler is written it can actually generate licenses.

This is in svn now (trunk, mono-2-4 and mono-2-6). I had to make 'keys'
internal for the patch to compile...

Thanks!

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] License compiler for mono (the actual tool)

2009-10-15 Thread Gonzalo Paniagua Javier
On Tue, 2009-10-13 at 15:43 +0200, Carlo Kok wrote:
 attached to this mail is a (working) license compiler for mono (converts 
 a licx file to a .licenses file that can be embedded as a resource). 
 Works with the patch I sent earlier but also without (has a temporary 
 workaround for that). It accepts the same cmdline arguments as the .NET 
 lc.exe and makes it possible to compile these files as required for any 
 project that uses commercial components that use license files (most do).
 
 The program.cs file contains the actual logic. It uses Options.cs from 
 the mono/windows install (ndesk.options) for the command line parsing.

This is now in mcs/tools/lc (trunk and mono-2-6).

Thanks a lot!

-Gonzalo

P.S.: btw, care to contribute a manual page for it?

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] asp.net application accessible via http and https

2009-10-13 Thread Gonzalo Paniagua Javier
On Tue, 2009-10-13 at 10:18 +0200, Cyrille Colin wrote:
 hi all,
 i would like to run an asp.net application accessible via http and https
 simultaneously on linux and use Request.IsSecureConnection to know
 protocol that have been used.
 Is there a way to configure mod-mono or apache to have this beahavior ?
 thanks for help.

Just enable SSL in apache and in the your virtual host in which you run
mono. mod_mono will pass the appropriate variables to mod-mono-server so
that IsSecureConnection will return what you expect.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] Network Performance Counters - V2

2009-10-11 Thread Gonzalo Paniagua Javier
On Sat, 2009-10-10 at 17:17 -0400, Joel Reed wrote:
 This is version 2 of my network performance counters patch. I rebased it 
 onto the 20091009 daily tarball.
 
 Per Gonzalo's comments seen here: 
 http://www.mail-archive.com/mono-devel-list@lists.ximian.com/msg22135.html, 
 I've:
 
 1) Modified where I free the values returned by 
 mono_networkinterface_list().
 
 2) Moved mono_networkinterface_list() to utils/mono-networkinterfaces.c

Joel, non-trivial contributions to the runtime require that you either
state that the code is licensed under a MIT/X11 license or that you do
some paperwork with Novell.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] Network Performance Counters - V2

2009-10-11 Thread Gonzalo Paniagua Javier
On Sun, 2009-10-11 at 20:36 -0400, Joel Reed wrote:
 I can do paper work if u like.
 
 I hereby state this patch to be released under the MIT/X11 license.

The patch is in svn trunk and mono-2-6 now. I made a small change in
network_cleanup because narg-name was not being freed.

Thanks!

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Ping throwing exception

2009-09-29 Thread Gonzalo Paniagua Javier
On Mon, 2009-09-28 at 12:22 -0400, Gladish, Jacob wrote:
 I'm getting an exception from an application that is repeatedly running 
 pings. The Ping class looks like it'll switch between invoking /bin/ping and 
 sending an ICMP directly depending on the user. I'm running as a 
 non-privileged user, therefore, its exec'ing ping. Every once in a while I 
 get an unknown response, and have tracked it back to Ping.cs -- the code 
 snippet below. The only way I can see this failing is if 
 WaitForSingleObjectEx is broken for processes. The timeout being used is 
 4000, which is the default.

 Does anyone know if there are any outstanding issues with 
 WaitForSingleObjectEx and processes.
 System.InvalidOperationException: The process must exit before getting the 
 requested information.
   at System.Diagnostics.Process.get_ExitCode () [0x0]
   at (wrapper remoting-invoke-with-check) 
 System.Diagnostics.Process:get_ExitCode ()
   at MassPinger.Ping.SendUnprivileged (System.Net.IPAddress address, Int32 
 timeout, System.Byte[] buffer, MassPinger.PingOptions options) [0x0]
 
 
 Ping.cs:273
 
 if (!ping.WaitForExit (timeout) || ping.ExitCode == 2) {
return new PingReply (address, buffer, options, trip_time, 
 System.Net.NetworkInformation.IPStatus.TimedOut);
 }

That code was wrong. I have just fixed this in svn in the mono-2-4,
mono-2-6 branches and trunk.

If you are a regular user and are going to do a lot of pings, I'd
recommend setting the 'cap_net_raw' capability for the mono exeutable.
You might want to set it for a copy of 'mono' that only your user can
run.

sudo setcap cap_net_raw=+ep /opt/mono/bin/mono

That will use ICMP packets instead of shelling out and running 'ping'.

-Gonzalo



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] Network Performance Counters

2009-09-29 Thread Gonzalo Paniagua Javier
On Mon, 2009-09-28 at 22:11 -0400, Joel Reed wrote:
 The attached patch implements 3 Network Interface performance category 
 counters. The counters are Bytes Received/sec, Bytes Sent/sec, and 
 Bytes Total/sec. A sample program using these counters and sample 
 output is attached as well.
 
 This information is obtained by reading /proc/net/dev.

The value returned by mono_networkinterface_list() is not freed
properly. In get_networkinterface_instance() you do:
g_free (buf);
but it should be something like:
for (i = 0; i  count; i++)
g_free (buf [i]);

I would make mono_networkinterface_list() return a null-terminated array
and then use g_strfreev () on it.

As for mono_networkinterface_list(), I think it belongs somewhere else
perhaps utils/mono-networkinterfaces.c or in io-layer. If you want to go
the io-layer route:
mono_networkinterface_list = WSAIoctl(SIO_GET_INTERFACE_LIST_EX)
mono_network_get_data = GetIfTable() from Iphlpapi.dll

This way it would work in windows and linux by now and future additions
should stick to the same interface.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] HttpContext.cs, The type or namespace name `Assembly' could not be found.

2009-09-29 Thread Gonzalo Paniagua Javier
On Tue, 2009-09-29 at 18:09 +0900, KISHIMOTO, Makoto wrote:
 Hello,
 
 Mono SVN trunk build broken, in my FreeBSD RELENG_8.
 
 ...(snip)
 gmake[8]: Entering directory `/export/home/ksmakoto/Mono/mcs/class/System.Web'
 MCS [net_1_1] System.Web.dll
 System.Web/HttpContext.cs(59,24): error CS0246: The type or namespace name 
 `Assembly' could not be found. Are you missing a using directive or an 
 assembly reference?

Fixed. Thanks for the heads up.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Patch for HttpRuntime and HttpServerUtility to bring API in sync with .NET 2.0 SP2

2009-09-29 Thread Gonzalo Paniagua Javier
On Tue, 2009-09-29 at 17:07 -0400, Nick Berardi wrote:
 Hi guys,
 
 I looked in to this more and there are a couple issues that popped up
 when trying to implement the following method:
 
 public void TransferRequest(string path, bool preserveForm, string
 method, NameValueCollection headers)
 
 My major hurdle that I wasn't able to over come is the following,
 probably because I don't know how the actual server was implemented.
 
 TransferRequest is suppose to kick off a new request in the
 application life cycle, which means that it needs to create a new
 request which runs all the way through from BeginRequest to EndRequest
 in the HttpApplication, after it has killed off the current request. 
 
 I don't know how I can do this in the Mono code base, because
 everytime I called Response.End() the request was transmitted back to
 the client.  Which is by design of Response.End(), however I need a
 way to end the current request life cycle and start a new one giving
 the path, headers, method, and content body, and not have it transmit
 back to the client until this second request is done.

Take a look at HttpServerUtility.cs. It already has the 2.0 and 1.x
methods to transfer a request in place. As for the events, if you are
sure that all of them are executed in the new request, you could create
an internal method in HttpRuntime that takes the HttpWorkerRequest
object of the current request and calls 'Process (httpworkerrequest)'
and then do a Response.End ().

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Assembly loader load several times the same dll

2009-09-21 Thread Gonzalo Paniagua Javier
On Mon, 2009-09-21 at 14:06 +0200, APS wrote:
 No hints?

Each assembly is loaded once per application domain and each asp.net
application runs in its own domain...

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] web.config Assembly binding not working

2009-09-21 Thread Gonzalo Paniagua Javier
On Mon, 2009-09-21 at 14:06 +0200, APS wrote:
 No hints?

We should probably copy that sectin when making a shadow copy of the
assembly. Do you mind entering a bug report? (see
http://mono-project.com/Bugs)

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [Mono-patches] r142362 - in trunk/gtk-sharp: . glib

2009-09-21 Thread Gonzalo Paniagua Javier
Brad,

When explicitly calling Dispose(), Remove() and Source.Remove () are
called. Both will acquire a lock to access the same table and attempt to
remove the same ID...

-Gonzalo

On Mon, 2009-09-21 at 22:19 -0400, Brad Taylor (b...@getcoded.net)
wrote:
 Author: btaylor
 Date: 2009-09-21 22:19:50 -0400 (Mon, 21 Sep 2009)
 New Revision: 142362
 
 Modified:
trunk/gtk-sharp/ChangeLog
trunk/gtk-sharp/glib/Idle.cs
trunk/gtk-sharp/glib/Timeout.cs
 Log:
 2009-09-22  Brad Taylor  b...@getcoded.net
 
   * glib/Idle.cs: 
   * glib/Timeout.cs: Make sure to remove the unmanaged reference to the
   delegate when we're disposed or finalized.  In particular, this fixes a
   problem where GLib.Object's PerformQueuedUnrefs was being called after
   both the object and the handler had been GC'ed, resulting in a
   segfault.
[...]
 + protected virtual void Dispose (bool disposing)
 + {
 + if (disposing)
 + Remove ();
 + 
 + Source.Remove (ID);
 + }
 +
[...]

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] BinaryReader does not reset decoder

2009-09-19 Thread Gonzalo Paniagua Javier
On Wed, 2009-09-09 at 16:31 +0200, Martin Dvořák wrote:
 Hi,
 While looking at the source code of System.IO.BinaryReader [1] I
 noticed it reuses char decoder and I'm just wondering whether it is ok
 that the BinaryReader does not reset its internal state before the
 loop in ReadString method. What if the code fails e.g. on line 498
 (sb.Append...) while the decoder contains fallback data. Next time
 ReadString is called, it will fail because decoder will try to use
 fallback data from previous call to ReadString. Or am I missing
 something here?

Yes. You're missing a test case ;-)

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Windows Eglib Build Broken

2009-09-03 Thread Gonzalo Paniagua Javier
On Wed, 2009-09-02 at 14:56 -0500, Jonathan Pobst wrote:
 Hey guys,
 
 The Windows Eglib (MSVC) build is broken.  The error is this:
 
 C:\mono-workspace\mono\msvc\mono.sln (default target) (1) -
 (Libraries\monoposixhelper target) -
c:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(358): 
 error C3163: '_vsnprintf': attributes inconsistent with previous declaration

This should be fixed now.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] Re: Patch to fix comparison of DateTime objects in Mono.Data.SqlExpressions

2009-08-31 Thread Gonzalo Paniagua Javier
On Sat, 2009-08-15 at 00:41 -0700, Adam Wendt wrote:
 It would be nice to get this patch in SVN so that it can make its way
 into one of the next few releases. Is there something holding this up?

This has been applied in trunk.

Thanks!

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Memory usage on Mono remoting

2009-07-15 Thread Gonzalo Paniagua Javier
On Wed, 2009-07-15 at 13:29 +0200, pablosantosl...@terra.es wrote:
[...]
  Your guess is wrong. Those asynchronous calls from Socket are treated as
  if they were a WorkItem for a ThreadPool, only that when they are made,
  the socket is added to an epoll fd (if you're on linux with support for
  epoll). And when there's an event in the socket, there's a dedicated IO
  threadpool to take care of reading/writing data and invoking the
  callbacks. The advantages: if you have 10k connections, you don't need
  10k threads, threads are reused (no creation overhead), ...
 

 Ok, of course. Well, when I said launching a thread I really meant
 launching a thread on a thread pool.
 
 Well, I'll try to use the ansync sockets then, but I guess to get the
 best out of them I'll need not only to use them during accept, but also
 read data asynchronously, right?

Correct. If possible, Write should also be asynchronous, but as long as
the OS buffers everything, there should be no problem.
[...]
  Coupled with asynchronous I/O, it will make better use of the resources
  available. There's no need to create 100 threads for 100 client or
  having 1 threadpool thread blocking on a socket asynchronous
  operation,... Also, if you're thinking of reusing buffers, this helps
  too, as the number of buffers will be bound to the maximum number of
  threads in the threadpool, ...

 Good, so, whenever I wait for a read or a write using async, the thread
 should be able to work on another request?

Correct. In fact, you don't 'wait' for an asynchronous read or write.
For instance, when you call BeginRead, the socket is added to an epoll
fd and you BeginRead call returns immediately. The callback you
provided, if any, will be called from a different thread as soon as new
data is available. Just don't spoil it by doing something like
socket.EndRead (socket.BeginRead (...)))   ;-)

 I think this is the way it's implemented on Windows, but I can tell you
 it is still created a huge number of threads, almost 1-1 with clients
 under the most overloaded scenarios.

The number of threads in the current threadpool can be configured using
MONO_THREADS_PER_CPU (see mono(1)) and SetMaxThreads. I don't remember
the numbers, but if you have a dual-quad core, it means ~140 threads. I
would adjust the maximum number of threads until the performance is more
or less the same than if you add a few more threads, but this may vary
depending on what the threads are doing...

-Gonzalo





___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] status of System.Messaging in Mono

2009-07-15 Thread Gonzalo Paniagua Javier
On Wed, 2009-07-15 at 22:47 +0100, Michael Barker wrote:
  Is this info anywhere in the wiki? It would be nice if the
  System.Messaging page was updated... (and no, I'm not volunteering ;-).
 
 Some updates made, I'll endeavour to keep it up to date as my work progresses.
 
 http://mono-project.com/SystemMessaging

Nice. Thanks a lot!

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Memory usage on Mono remoting

2009-07-14 Thread Gonzalo Paniagua Javier
On Tue, 2009-07-14 at 11:12 +0200, pablosantosl...@terra.es wrote:
 Hi Gonzalo,
 
  Testing PlasticSCM under really heavy load (hundreds of clients against
  a single server delivering hundreds of Gb over the network).
  
 
  So no profiling...
 

 Comparing the same code, the same hardware and the same test under Linux
 and Windows. On Windows we run under .NET, and the test passes successfully.

Oh, when I said profiling I meant the mono --profile=stat or similar
that can tell you what and where is being allocated.
[...]
  It's HttpResponseStream.cs all the *Bucket classes that then use an
  IntPtrStream.
 
  I still don't think that allocating MemoryStream (256 bytes by default)
  is hurting that bad. 
 Considering Boehm GC seems to have really hard times releasing memory
 and we're delivering GBs of data... it could be.

Delivering GBs of data and having hundreds of connections should not be
a problem. Years ago, when testing iFolder under those conditions
everything worked just fine. But it was mod-mono-server/apache.

 I'm not 100% sure, but it seems reusing buffers could be a very good idea.

Xsp does it too and it's much better than allocating 32kB for every
request every time.

  A wild guess is that the BufferedStream wrapping
  the NetworkStream is allocating much more memory (4kB by default). But
  if the code is rewritten following what xsp does, this should not be a
  problem any more.

 Ok, I'm not familiar with xsp, I'll take a look.
 
 I've just noticed that you use send from libc instead of the socket
 functions... I guess it is due to performance reasons, right?

That's because I wanted to use the TCP_CORK option to avoid sending
headers and the beginning of the content in separate packets.

 Also, you mentioned in a previous email that the TcpChannel should be
 changed so it uses Asynch sockets. I've seen you use AsyncCallBack on XSP.
 
 My question is: I guess AsynchCallback will use a thread underneath,
 won't it? If so: what's the advantage over launching threads to accept
 calls?

Your guess is wrong. Those asynchronous calls from Socket are treated as
if they were a WorkItem for a ThreadPool, only that when they are made,
the socket is added to an epoll fd (if you're on linux with support for
epoll). And when there's an event in the socket, there's a dedicated IO
threadpool to take care of reading/writing data and invoking the
callbacks. The advantages: if you have 10k connections, you don't need
10k threads, threads are reused (no creation overhead), ...

 You mentioned it is better to use the default ThreadPool instead of the
 internal one in the TcpChannel, why is it going to be better?

Coupled with asynchronous I/O, it will make better use of the resources
available. There's no need to create 100 threads for 100 client or
having 1 threadpool thread blocking on a socket asynchronous
operation,... Also, if you're thinking of reusing buffers, this helps
too, as the number of buffers will be bound to the maximum number of
threads in the threadpool, ...

-Gonzalo



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] sending smtp email under SSL

2009-07-14 Thread Gonzalo Paniagua Javier
Try setting the certificate validation callback.

If you're running mono from HEAD (if you don't know what this is, you
are not):

---
// This will trust *any* certificate
ServicePointManager.ServerCertificateValidationCallback +=
delegate(object sender, X509Certificate certificate, X509Chain
chain, SslPolicyErrors sslPolicyErrors)
{
return true;
}
-

If you're running mono 2.4.2.1 or earlier check out
http://www.mono-project.com/UsingTrustedRootsRespectfully and here's the
sample:

public class NoCheckCertificatePolicy : ICertificatePolicy {
public bool CheckValidationResult (ServicePoint a, X509Certificate
b, WebRequest c, int d)
{
  return true;
}
}
...
ServicePointManager.CertificatePolicy = new NoCheckCertificatePolicy ();
--


-Gonzalo


On Thu, 2009-07-09 at 18:56 -0700, _KD_ wrote:
 
 
 gedw99 wrote:
  
  Hey,
   
  i am trying to send an email using a gmail account.
  According to the docs, Network Credentials does not support SSL.
  http://www.go-mono.com/docs/index.aspx?link=T%3ASystem.Net.NetworkCredential%2F*
   
  I am using the latest mono 1.2, and XPS2 !
  Is there an alternative way to send email under SSL 
   
  Code and error below
   
   
  SmtpClient mailClient = new SmtpClient();
  mailClient.EnableSsl = true;
  mailClient.DeliveryMethod = SmtpDeliveryMethod.Network;
  mailClient.Host = smtp.gmail.com;
  mailClient.Port = 587;
  mailClient.Credentials = new NetworkCredential(Config.GMAIL_UserName,
  Config.GMAIL_PassWord);
  mailClient.Send(this._from, this._to, this._subject, this._body);
[...]



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Performance of TextWriter.ReadToEnd()

2009-07-14 Thread Gonzalo Paniagua Javier
On Tue, 2009-07-14 at 18:06 -0500, Jimmy Tang wrote:
 I'm playing around with some of the language shootout game benchmarks
 at http://shootout.alioth.debian.org,
 and I noticed a striking performance issue;
 
 I'm testing on mono 2.4 build 6 / vista64 vs .NET 3.5 sp1. Test code:
 
 static void Main() {
 var sequence = Console.In.ReadToEnd();
 Console.WriteLine(sequence.Length);
 }
 
 test input is a 50MB file.
 
 results.
 
 $ time ./test.exe  ../fasta5M.in.txt
 real0m1.352s
 user0m0.015s
 sys 0m0.000s
 
 $ time mono test.exe  ../fasta5M.in.txt
 real0m18.154s
 user0m0.015s
 sys 0m0.000s
 
 I see the ReadToEnd() is implemented along the lines of
 char[] buffer;
 while(Read(buffer)  0)
 stringbuilder.append(buffer)
 
 Just as a rudimentarytest using a temp string instead of char[]:
 string buffer;
 while((buffer = ReadLine()) != null)
 stringbuilder.Append(buffer)

That must be a Mono on windows issue. I tried this:

gonz...@laptop:/tmp$ ls -l output2 output3
-rw-r--r-- 1 gonzalo gonzalo 5132004 2009-07-14 20:06 output2
-rw-r--r-- 1 gonzalo gonzalo 596 2009-07-14 20:07 output3
gonz...@laptop:/tmp$ time -p mono rl.exe  output2
5132004
real 0.43
user 0.36
sys 0.05
gonz...@laptop:/tmp$ time -p mono rl.exe  output3
596
real 0.41
user 0.35
sys 0.08
---
output2 has ~800k lines with a number.
output3 is almost the same but with everything in one single line.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] 2 Small fixes in the System.Web Namespace

2009-07-14 Thread Gonzalo Paniagua Javier
This is now in mono-2-4 and HEAD.
Thanks.

-Gonzalo

On Wed, 2009-07-08 at 16:17 +, Daniel Gagne wrote:
 This patch contains 2 small midfications in the System.Web namespace:
 
 ParserErrorCollection - Added Setter
 enum ApplicationShutdownReason - Added new 3.5 type
 
 danny
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] TcpServerChannel loosing connections under heavy load

2009-07-13 Thread Gonzalo Paniagua Javier
On Mon, 2009-07-13 at 19:36 +0200, pablosantosl...@terra.es wrote:
[...]
  That should be modified to make use of the .NET ThreadPool and use
  asynchronous operations for accept, read and write (this last one is not
  mandatory). There's code in xsp that illustrates the way it should be
  done.
 

 Which ThreadPool exactly should be used?

The .NET Threadpool is the one in System.Threading.ThreadPool. It is
used by asynchronous delegates.

 Could you point me to the right code in xsp?

A simple grep 'Accept' yields
xsp/src/Mono.WebServer/ApplicationServer.cs.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Memory usage on Mono remoting

2009-07-13 Thread Gonzalo Paniagua Javier
On Mon, 2009-07-13 at 19:39 +0200, pablosantosl...@terra.es wrote:
 Hi all,
 
 On BinaryServerFormatterSink.cs, a new MemoryStream is being created to
 attend every remoting call.
 
 Under high load conditions it will make the GC work harder than
 required, both decreasing performance and potentially causing memory
 problems.
 
 It should be replaced by some sort of MemoryStream based on preallocated
 memory buffers.

Are you volunteering? Have you profiled the application or is this just
a guess?

 Maybe something like ChunkedMemoryStream in Rotor.
 
 http://www.koders.com/csharp/fid0C95C784238E26C8EAC95C7A852A34A0CE9305BB.aspx?s=chunkedmemorystream

If you look at that code you are not allowed to contribute to mono
anything based on what you saw.

System.Web uses unmanaged chunks of memory together with an unmanaged
memory based stream.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] TcpServerChannel loosing connections under heavy load

2009-07-13 Thread Gonzalo Paniagua Javier
On Sun, 2009-07-12 at 00:11 +0200, pablosantosl...@terra.es wrote:
 Hi,
 
 I'm having issues with Mono remoting under high performance networking
 scenarios. Some clients are rejected since the server is not able to
 handle connections.
 
 Look at the following code inside TcpServerChannel
 (http://anonsvn.mono-project.com/viewvc/trunk/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpServerChannel.cs?revision=110042view=markup)
[...]
 When a high number of threads is managed (about 130 concurrent clients),
 it makes the channel reject remote requests.
 
 Inside the threadPool the following code:
 
  threadDone.WaitOne(PoolGrowDelay, false);
 
 Makes thread creation wait 500ms (I guess just forcing the CPU to switch
 to another one) each time a new thread is created (when the pool is
 growing).
 
 If you remove it, connection problems go away, but I guess it's not the
 right way to implement it.

That should be modified to make use of the .NET ThreadPool and use
asynchronous operations for accept, read and write (this last one is not
mandatory). There's code in xsp that illustrates the way it should be
done.

[...]
 Since NoDelay was set by Robert Jordan to the TcpConnectionPool.
 Question: I see it applies to the client but, wouldn't it be useful for
 the server too?

It depends, but probably yes.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Memory usage on Mono remoting

2009-07-13 Thread Gonzalo Paniagua Javier
On Mon, 2009-07-13 at 19:59 +0200, pablosantosl...@terra.es wrote:
[...]

 
  Are you volunteering? Have you profiled the application or is this just
  a guess?
 

 Testing PlasticSCM under really heavy load (hundreds of clients against
 a single server delivering hundreds of Gb over the network).

So no profiling...

 Yes, I'm volunteering.

The problem is that you can't contribute anything that is related to
that class that you linked before. See
http://mono-project.com/Contributing under 'Important Rules'.

 
  System.Web uses unmanaged chunks of memory together with an unmanaged
  memory based stream.

 That's what I need. Can you point me to the right class?

It's HttpResponseStream.cs all the *Bucket classes that then use an
IntPtrStream.

I still don't think that allocating MemoryStream (256 bytes by default)
is hurting that bad. A wild guess is that the BufferedStream wrapping
the NetworkStream is allocating much more memory (4kB by default). But
if the code is rewritten following what xsp does, this should not be a
problem any more.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] ShellExecuteEx

2009-07-10 Thread Gonzalo Paniagua Javier
On Fri, 2009-07-10 at 17:04 -0400, Bill Holmes wrote:
 Hi,
 
 The attached patch fixes Mono on Windows not respecting the
 WindowStyle property of the start info when calling Process.Start with
 UseShellExecute set to true.

Looks good.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] System.Web ParseError - API Compatibility (added 3 missing members)

2009-07-07 Thread Gonzalo Paniagua Javier
On Mon, 2009-07-06 at 16:15 -0400, Daniel Gagne wrote:
 Hi,
 
 This is my first patch submission, so I decided to attack some low
 hanging fruit to understand the entire build/patch/submission process.

This is now in HEAD and mono-2-4.
Thanks.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Understanding web application loading time

2009-05-14 Thread Gonzalo Paniagua Javier
On Thu, 2009-05-14 at 18:56 +0200, APS wrote:
 Without batch compilation the application starts faster but opening a
 new page results in minutes of waiting.
 
 I tried strace on mod_mono and the only thing that seems to be a
 problem is a long list of
 
 futex(0x829b4e4, FUTEX_WAIT_PRIVATE, 11165, {0, 99270129}) = -1
 ETIMEDOUT (Connection timed out)
 
 this can influence loading time?

I don't think that is the problem. Without knowing what your application
is trying to do, there's not much we can do to help...

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] sql client question

2009-04-27 Thread Gonzalo Paniagua Javier
On Mon, 2009-04-27 at 17:04 -0700, Steve Bjorg wrote:
 Gonzalo,
 
 Thanks.  To clarify, how about the bits that were in 1.9.1?  Were  
 there significant changes since then?

Yes, a lot of changes and fixes since then. Updating to 2.4 is
definitely recommended.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] WebClient.DownloadFile doesn't work on Windows

2009-04-26 Thread Gonzalo Paniagua Javier
On Thu, 2009-04-23 at 12:38 +0200, Andoni Morales wrote:
 I'm trying to implement an updates notifier for my program. It
 downloads an XML file describing to latest version using
 WebClient.DownloadFile and compares the actual version number with
 the one installed
 (https://forja.rediris.es/plugins/scmsvn/viewcvs.php/LongoMatch/trunk/LongoMatch/Updates/Updater.cs?root=csl-longomatchrev=637view=markup).
 On Linux everything works fine, but on Windows I get the following
 exception:
 
 System.Net.WebException: An error occurred performing a WebClient
 request. --- System.NotSupportedException:
 http://www.ylatuya.es/updates/version.xml

That looks like a configuration problem. Perhaps mono is not finding
machine.config or the following lines are not there:

webRequestModules
add prefix=http type=System.Net.HttpRequestCreator, System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 /
add prefix=https type=System.Net.HttpRequestCreator, System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 /
add prefix=file type=System.Net.FileWebRequestCreator, System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 /
add prefix=ftp type=System.Net.FtpRequestCreator, System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 /
/webRequestModules

-Gonzalo



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] GO-MONO.COM is moving

2009-04-15 Thread Gonzalo Paniagua Javier
Folks,

We are in the process of moving go-mono.com to a new machine.

I've tried to make sure all the pages we host there work just fine and
the transition is smooth.

Anyway, if you see anything wrong with the server within the next few
hours, join #mono at irc.gimpnet.org and let me know.

Thanks.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Use eglib as a default for mono 2.6

2009-04-15 Thread Gonzalo Paniagua Javier
On Wed, 2009-04-15 at 22:49 +0200, Andreas Färber wrote:
[...]
 Why not take the same route as GNU libiconv? The eglib headers could  
 #define GLib symbols to have a mono_ prefix, distinguishing them from  
 any real GLib symbols that might get linked in somewhere. Mono's  
 runtime code would then not need to be touched and one could still  
 choose to link against original GLib.

Are you volunteering? :-)

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] get mac address using system.management

2009-04-13 Thread Gonzalo Paniagua Javier
On Mon, 2009-04-13 at 10:50 -0700, tooty wrote:
 hi all,
 i used to get mac address of Ethernet adapter under windows, using the
 following code:
 
 //
 Dim mc As System.Management.ManagementClass
   Dim mo As ManagementObject
   mc = New ManagementClass(Win32_NetworkAdapterConfiguration)
   Dim moc As ManagementObjectCollection = mc.GetInstances()
   For Each mo In moc
  If mo.Item(IPEnabled) = True Then
 ListBox1.Items.Add(MAC address  
 mo.Item(MacAddress).ToString())
  End If
   Next
 //
 now i have to do the same under Linux system.
 
 now, its obvious i wont find  Win32_NetworkAdapterConfiguration under
 managementclass on Linux.
 
 so, can anyone tell me what is the wright method of managementclass that
 will let me get the network adapter properties?

You can use the classes in System.Net.NetworkInformation (see
NetworkInterface.GetPhysicalAddress). This will work on MS.NET too.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Nagle and NoDelay for HttpWebRequest - EnableDnsRoundRobin

2009-04-11 Thread Gonzalo Paniagua Javier
On Sat, 2009-04-11 at 04:16 -0600, M. David Peterson wrote:
[...]
  
 Implementing this ranges from trivial to us doing our own DNS
 query
 library (straightforward, I've done it in a past life).
 
 Interesting. What would be the benefit of going the DNS query library
 route?

The only thing is having access to the TTL. For instance, if your DNS
server is djbdns/dnscache, it will always return a 0 TTL and in that
case the library would know it needs to refresh every time.

 The trivial solution: if the client gets several IPs for the
 server,
 rotate through them until the DnsRefreshTimeout is hit. If
 only one IP
 is returned by the DNS server we're entirely in
 DnsRefreshTimeout hands
 since IPHostEntry does not have an associated TTL.
 
 I'd like to test this on windows and set up a DNS server that
 I can
 control to see if the trivial solution is what they do and
 whether or
 not they query the server again if the TTL is expired. May be
 tomorrow.
 
 If having access to a couple EC2 instances to use for DNS as well as
 performance testing against a highly concurrent web service such as
 SimpleDB would be helpful I'd be happy to start a few up and give you
 root access to them.  I also have a SimpleDB .NET library which has
 been designed for high performance asynchronous operations which would
 make the performance testing trivial.
 
 Let me know if having access to any of the above would be helpful. And
 thanks! :-)

Testing the behavior wrt DNS is easier than that. I can do everything
locally. Thanks anyway.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] New Mono API status pages.

2009-04-11 Thread Gonzalo Paniagua Javier
On Sat, 2009-04-11 at 12:55 -0400, Miguel de Icaza wrote:
[...]
  * argument name mismatches are no longer reported (this will become  
  more
  important as C# 4.0 now supports named parameters too)
 
 Yeah, in the future we will add a new option (just like we now have  
 two modes of comparison) to sort this out.

There is commented out code in the gui-compare 'engine' that checks
parameter names too.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] New Mono API status pages.

2009-04-10 Thread Gonzalo Paniagua Javier
On Fri, 2009-04-10 at 07:44 -0700, Eyal Alaluf wrote:
 Hi, Miguel.
 
 I like the visibility this page provides into how close Mono is to the
 target .Net platform in the various configurations.
 I am missing two things - I'd like to know how many symbols are in the
 .Net assembly (to put things in the right perspective), and for some
 reason in my browser (IE 7, white foreground, black background) I see
 only the numbers and only the tooltip says what they mean. It looks like
 this:
  mscorlib.dll
  47
  20
  9
  494
  419
 I'd think that arranging it in a table or giving titles will make this
 much more readable and easy to use.

It should work fine for IE7 now. Thanks.

About the count... We count anything from an enum field to a class as
one item. For example, if there's a property with a get and set missing,
that counts as 3 missing items (property and 2 methods). For the total
count to make sense we would have to display totals per item type
otherwise we would be giving the same 'weight' to a missing enum value
and a missing .ctor...

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Nagle and NoDelay for HttpWebRequest - EnableDnsRoundRobin

2009-04-10 Thread Gonzalo Paniagua Javier
On Fri, 2009-04-10 at 20:08 -0600, M. David Peterson wrote:
[...]
 While we're on the subject of HttpWebRequest performance, has anyone
 looked into what is required to support
 ServicePointManager.EnableDnsRoundRobin which, the last time I
 checked, throws a NotSupportedException?
[...]

I was actually looking at this last night.

Implementing this ranges from trivial to us doing our own DNS query
library (straightforward, I've done it in a past life).

The trivial solution: if the client gets several IPs for the server,
rotate through them until the DnsRefreshTimeout is hit. If only one IP
is returned by the DNS server we're entirely in DnsRefreshTimeout hands
since IPHostEntry does not have an associated TTL.

I'd like to test this on windows and set up a DNS server that I can
control to see if the trivial solution is what they do and whether or
not they query the server again if the TTL is expired. May be tomorrow.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Nagle and NoDelay for HttpWebRequest

2009-04-09 Thread Gonzalo Paniagua Javier
A couple of months ago, due to performance issues under certain
circumstances (lots of small packets and TLS involved), we started
setting the NoDelay option on all the sockets created for
HttpWebRequest. That code was released as part of 2.4.

In the next release or if you're building from svn sources, the proper
way of avoiding the performance problem is to set this configuration
option for your application/library:
-
configuration
system.net
settings
servicePointManager useNagleAlgorithm=false /
/settings
/system.net
/configuration
-

You can also set it programatically using the ServicePointManager or the
ServicePoint classes.

The Nagle algorithm will be used by default.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] issue with GetHostAddresses on OS X server

2009-04-07 Thread Gonzalo Paniagua Javier
On Tue, 2009-04-07 at 18:19 -0700, Steve Bjorg wrote:
 One of our community members is trying to get MindTouch running on OS
 X server.  In the process, he has run into the following error message
 during startup.
 
 
  02.04.09 10:58:03 com.mindtouch.deki[242] 
  initializing 
  02.04.09 10:58:04 com.mindtouch.deki[242] Unhandled Exception:
  System.Net.Sockets.SocketException: No such host is known 
  02.04.09 10:58:04 com.mindtouch.deki[242]   at
  System.Net.Dns.hostent_to_IPHostEntry (System.String h_name,
  System.String[] h_aliases, System.String[] h_addrlist) [0x0]  
  02.04.09 10:58:04 com.mindtouch.deki[242]   at
  System.Net.Dns.GetHostByName (System.String hostName) [0x0]  
  02.04.09 10:58:04 com.mindtouch.deki[242]   at
  System.Net.Dns.GetHostEntry (System.String hostNameOrAddress)
  [0x0]  
  02.04.09 10:58:04 com.mindtouch.deki[242]   at
  System.Net.Dns.GetHostAddresses (System.String hostNameOrAddress)
  [0x0]  

What's the value of the 'hostNameOrAddress' argument here? Can you
'nslookup' that host name?

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] HttpRuntime.Cache crashing HttpListener in console application

2009-04-01 Thread Gonzalo Paniagua Javier
Do you mind entering this information in https://bugzilla.novell.com ?
Under Mono::class libraries - Sys.Web.

Thanks!

-Gonzalo

On Wed, 2009-04-01 at 09:46 -0700, MemphisWeb wrote:
 If I Cache data using System.Web.Caching in a console application I get an
 exception if I ltry to start a HttpListener object.  It seems that somewhere
 in System.Net it is looking for Cache Settings in a web.config.
 
 This is a bug because the behavior does not exist in the .net runtime.
 
 Is there a workaround? 
 
 
 
 using System;
 using System.Web;
 using System.Web.Caching;
 using System.Net;
 
 namespace TestWeb
 {
   class MainClass
   {
   public static void Main(string[] args)
   {
   /* Uncomment to section to produce error
* 
   Cache cache = HttpRuntime.Cache;
   cache[hello] = world;
   Console.WriteLine(Hello World!);
   
   Cache cacheClone = HttpRuntime.Cache;
   string s = cacheClone[hello] as String;
   Console.Write(s);
   */
   
   System.Net.HttpListener listener = new 
 System.Net.HttpListener();
   listener.Prefixes.Add(http://192.168.1.101:8081/;);
   listener.Start();
   
   Console.WriteLine(listener.IsListening);
   }
   }
 }
 
 Hello World!
 world
 Unhandled Exception: System.TypeInitializationException: An exception was
 thrown by the type initializer for System.Net.Sockets.Socket ---
 System.NullReferenceException: Object reference not set to an instance of an
 object
   at System.Web.Configuration.WebConfigurationManager.GetSectionCacheKey
 (System.String sectionName, System.String path) [0x0] in
 /usr/src/packages/BUILD/mono-2.4/mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationManager.cs:487
  
   at System.Web.Configuration.WebConfigurationManager.GetSection
 (System.String sectionName, System.String path) [0x0] in
 /usr/src/packages/BUILD/mono-2.4/mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationManager.cs:313
  
   at System.Web.Configuration.WebConfigurationManager.GetSection
 (System.String sectionName) [0x0] in
 /usr/src/packages/BUILD/mono-2.4/mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationManager.cs:308
  
   at
 System.Web.Configuration.HttpConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection
 (System.String configKey) [0x0] in
 /usr/src/packages/BUILD/mono-2.4/mcs/class/System.Web/System.Web/UplevelHelper.cs:1
  
   at System.Configuration.ConfigurationManager.GetSection (System.String
 sectionName) [0x0] in
 /usr/src/packages/BUILD/mono-2.4/mcs/class/System.Configuration/System.Configuration/ConfigurationManager.cs:162
  
   at System.Net.Sockets.Socket.CheckProtocolSupport () [0x0003c] in
 /usr/src/packages/BUILD/mono-2.4/mcs/class/System/System.Net.Sockets/Socket.cs:1342
  
   at System.Net.Sockets.Socket..cctor () [0xc] in
 /usr/src/packages/BUILD/mono-2.4/mcs/class/System/System.Net.Sockets/Socket.cs:601
  
   --- End of inner exception stack trace ---
   at System.Net.EndPointListener..ctor (System.Net.IPAddress addr, Int32
 port, Boolean secure) [0x00028] in
 /usr/src/packages/BUILD/mono-2.4/mcs/class/System/System.Net/EndPointListener.cs:58
  
   at System.Net.EndPointManager.GetEPListener (System.Net.IPAddress addr,
 Int32 port, System.Net.HttpListener listener, Boolean secure) [0x00064] in
 /usr/src/packages/BUILD/mono-2.4/mcs/class/System/System.Net/EndPointManager.cs:96
  
   at System.Net.EndPointManager.AddPrefixInternal (System.String p,
 System.Net.HttpListener listener) [0x00050] in
 /usr/src/packages/BUILD/mono-2.4/mcs/class/System/System.Net/EndPointManager.cs:78
  
   at System.Net.EndPointManager.AddListener (System.Net.HttpListener
 listener) [0x0002a] in
 /usr/src/packages/BUILD/mono-2.4/mcs/class/System/System.Net/EndPointManager.cs:49
  

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] MonoMethod.cs

2009-03-23 Thread Gonzalo Paniagua Javier
On Wed, 2009-03-11 at 10:31 -0400, Matthew Metnetsky wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Miguel de Icaza wrote:
  This patch would require both a ChangeLog entry as well as updated
  NUnit test cases to go with it, exposing the intended behavior and the
  buggy behavior.
 
 Gonzalo  Miguel,
 
 The attached patch contains changes for:
  - Test/System.Reflection/ChangeLog
  - Test/System.Reflection/BinderTests.cs
  - System.Reflection/ChangeLog
  - System.Reflection/MonoMethod.cs
 
 The functional difference is that Binder.ChangeType is only called if
 BindingFlags.ExactBindings is not set. Tests have been added to ensure
 this works when set and not. I have also added tests to ensure
 TargetParameterCountException works as there were none previously.

This is now in svn HEAD.
Thanks!

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] SPAM-LOW: Re: [Bug 484244] [Regression] nunit-console.exe requires /noshadow

2009-03-23 Thread Gonzalo Paniagua Javier
On Tue, 2009-03-17 at 02:20 +0900, Atsushi Eno wrote:
[...]
  Also, if something is wrong with NUnit for Mono use, it will
  never be fixed unless somebody pushes a bug upstream. The
  bug would need to be more than we have to use /noshadow 
  of course - but you guys know how to write bugs.
 
 However to my understanding it is not a bug in NUnit itself
 but somewhere in the middle of the mono runtime. Sadly no one
 (including myself) has dug in depth and the issue is left as is.

I fixed the '/noshadow' bug last week (or was it 2 weeks ago?).

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Mono is losing session when cookieless=true

2009-03-23 Thread Gonzalo Paniagua Javier
On Mon, 2009-03-16 at 07:29 -0700, MonoMichal wrote:
 Hi Gonzalo,
 
 I figured out that it is only AjaxPro library which doesn't work on my Mono
 with cookieless session.
 
 I'm using AjaxPro library from:
 http://ajaxpro.info/ in version -- AjaxPro.dll 6.10.6.2
 
 I use mono-version 1.9.1:
 
 I have httpHandler in my web.config:
 httpHandlers
  add verb=* path=ajaxpro/*.ashx type=AjaxPro.AjaxHandlerFactory,
 AjaxPro /
 /httpHandlers
 
 All ajax calls don't have session key attached in url when using mono.
 When running project on IIS 5.1 everything works fine.
 
 So for example: 
 Call to login page /screens/login.aspx looks like (using fiddler - 3 files
 as example - session key same everywhere):
 GET /(8DF33E8940A293E52150B9AA)/Screens/Login.aspx
 GET /(8DF33E8940A293E52150B9AA)/images/user.gif HTTP/1.1
 GET /(8DF33E8940A293E52150B9AA)/scripts/Accordion/rico.js

This sounds familiar. I think I fixed this problem looong time ago for
ajaxpro, so it must be a regression.

Do you mind entering a bug report in bugzilla.novell.com with all this
info?

Thanks!

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Subversion update and checksum error

2009-03-06 Thread Gonzalo Paniagua Javier
Hi there.

If you have access to mono-cvs.ximian.com and when updating mcs you get
a checksum error, just remove the directory in which the file with the
error is and update again.

If you're using git-svn and see this error (I'm using version 1.6.1.3
and didn't have a problem updating), you can apply Geoff's patch if
you're using opensuse 11.1 or do something similar if you have a
different version - http://sublimeintervention.com/git-svn.diff

No idea of what causes the problem, but it seems related to the
'upgrade' of the working copy to the subversion 1.5 format. It's a known
problem but I don't know that it's been fixed yet (as of svn 1.5.6).

Sorry for the inconvenience.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] MonoMethod.cs

2009-03-02 Thread Gonzalo Paniagua Javier
[...]
 So my question is where would you like an ArgumentException thrown (as
 MS does):
 
  1) MonoMethod.cs
  2) icall.c / where the path leads me
 
 Thoughts?

MonoMethod.cs

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


  1   2   3   4   5   >