Re: [Mono-list] Setting up mod_mono/Apache2

2004-08-28 Thread Simon Ask Ulsnes
Thanks for the help, I'll see if it works.
Gonzalo Paniagua Javier wrote:
If instead of ranting you provide more details on how you configure
apache, you might even get some help.
 

Yeah, but that's really hard if you have no idea what's wrong and what 
details are missing or relevant because the logs are empty and the docs 
(those I could find in /usr/share/doc/xsp-1.0/) are vague at best.
By the way, I use mod_mono in a fairly standard Apache2 Gentoo-style 
setup. It is configured exactly according to the docs.

And I would like to note that I don't mean to sound negative - I'm 
extremely grateful for the very impressive work the Mono team et al has 
done. It's simply amazing that it works so flawlessly, which is why I 
get really frustrated when it doesn't... ;-)

- Simon
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Setting up mod_mono/Apache2

2004-08-26 Thread Simon Ask Ulsnes
Hi there!
I've been battling mod_mono for a few days now, and I'm close to giving up.
I really miss _thorough_ instructions on how to set up mod_mono for 
Apache 2 on Linux! For instance, where are .webapp files supposed to be 
placed? Where is xsp.exe.config supposed to be? What the hell is going on?

Currently, I managed to get mod_mono to partly respond to .aspx files - 
every Apache hits an .aspx-file, mod_mono gives me good ol' 404 (XSP's 
404 page, not Apache's).

This doesn't happen with XSP - which is why I think it is config 
related, and is why I miss some updated documentation!
(everything I can find on Google is about mod_mono <= 0.7, and 
apparently a lot of things changed since then)

- Simon
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] About gtk#

2004-08-02 Thread Simon Ask Ulsnes
Hi,
lamyae Benabdeljalil wrote:
I am sorry for the stupid question, but, does gtk# work with KDE?

Yeah, just like every other GTK+-application. ;-)
It probably won't blend in perfectly (unless you change both your KDE 
theme and GTK+/Gnome theme to something similar, like Bluecurve or 
QtCurve), but it will certainly work without problems.

- Simon
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] WEB SITE DOWN???

2004-06-30 Thread Simon Ask Ulsnes
Hi,
ted leslie wrote:
www.mono-project.com is up but all links to download software go to 
go-mono.com (the old site)
and this is unreachable,
is there a DNS change in the works and I am cached, or is it down 
because of everyone and their uncle downloading new release?

-tl

I think it is primarily due to the /.ing. Furthermore, the Gentoo 
community had ebuilds out half an hour before the announcement, so every 
Gentoo user and their uncle doing a system update is hitting on the 
server too...

I actually just managed to get through, now let's see how the download 
goes... ^_^

- Simon
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] The website(s)

2004-06-29 Thread Simon Ask Ulsnes
Hi,
When are someone going to update go-mono.com and more urgently 
mono-project.com?

- Simon
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Mono GStreamer library

2004-06-07 Thread Simon Ask Ulsnes
Hi,
Is there a GStreamer interface for Mono? If not, I'd start writing one, 
you see... ;-)

Google seemed to think there was something on gotmono.com, but there is 
only C examples on how to initialise the framework, nothing regarding Mono.

- Simon
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Generic-enabled ArrayList

2004-06-06 Thread Simon Ask Ulsnes
John Luke wrote:
On Sun, 2004-06-06 at 23:31 +0200, Simon Ask Ulsnes wrote:
 

Hi there!
Is there such a thing as a Generic-enabled ArrayList in Mono? I've been 
looking through the docs, I couldn't seem to find anything.

I did a little test case to see the performance difference between 
generics and boxing myself, and the difference was enormous! Especially 
with primitive classes like Int32 etc. (String wasn't quite as fast).

   

List in Systems.Collections.Generics?
 

Thanks!
Why isn't this documented? It should be, or at least if Mono was 
compiled with Generics support.

- Simon
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Generic-enabled ArrayList

2004-06-06 Thread Simon Ask Ulsnes
Hi there!
Is there such a thing as a Generic-enabled ArrayList in Mono? I've been 
looking through the docs, I couldn't seem to find anything.

I did a little test case to see the performance difference between 
generics and boxing myself, and the difference was enormous! Especially 
with primitive classes like Int32 etc. (String wasn't quite as fast).

- Simon
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] mcs cannot compile on NFS shares due to Win32 locks

2004-06-02 Thread Simon Ask Ulsnes
Simon Ask Ulsnes wrote:
Andrew Arnott wrote:
I am running Mono on Gentoo Linux, in a perfectly normal environment.
To get the error message, I only have to cd to an NFS share and 
execute mcs on a C# file...
  

Are you mounting the directory as a samba share?  Or are you using 
nfsmount?
 

nfsmount. Samba uses smbfs, not NFS.
I'm using NFS Protocol version 3, nfs-utils version 1.0.6 and 
2.6.x-kernels on both client and server.

- Simon
Maybe I didn't make it clear enough, no Windows machines are involved 
here. That's why the whole Win32 locks thing is a bit odd.

- Simon
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] mcs cannot compile on NFS shares due to Win32 locks

2004-06-02 Thread Simon Ask Ulsnes
Andrew Arnott wrote:
I am running Mono on Gentoo Linux, in a perfectly normal environment.
To get the error message, I only have to cd to an NFS share and execute 
mcs on a C# file...
   


Are you mounting the directory as a samba share?  Or are you using nfsmount?
 

nfsmount. Samba uses smbfs, not NFS.
I'm using NFS Protocol version 3, nfs-utils version 1.0.6 and 
2.6.x-kernels on both client and server.

- Simon
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] mcs cannot compile on NFS shares due to Win32 locks

2004-06-02 Thread Simon Ask Ulsnes
I am running Mono on Gentoo Linux, in a perfectly normal environment.
To get the error message, I only have to cd to an NFS share and execute 
mcs on a C# file...

This is very much a Mono problem.
- Simon
Andrew Arnott wrote:
I assume you are running Mono on Cygwin.  I think this is related to a
problem with IIS serving ASP.NET pages up from NFS shares.  For some reason,
file locking is buggy.  I never did figure it out.  But my guess is that it
is not a Mono problem.
Andrew
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Simon Ask Ulsnes
Sent: Wednesday, June 02, 2004 6:31 AM
To: mono
Subject: [Mono-list] mcs cannot compile on NFS shares due to Win32 locks
Hi!
I have all my work stored on NFS shares from my server, including 
programming projects. I just installed Beta 2, and found that 
compilation for some reason always failed. I then found out that it only 
happens when I compile a project stored in a NFS share, not if I compile 
it locally.

The error message:
error CS0016: Could not write to file `io.exe', cause: Win32 IO returned 
ERROR_LOCK_VIOLATION. Path: ./io.exe
Compilation failed: 1 error(s), 0 warnings

- Simon
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list
 

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] mcs cannot compile on NFS shares due to Win32 locks

2004-06-02 Thread Simon Ask Ulsnes
Hi!
I have all my work stored on NFS shares from my server, including 
programming projects. I just installed Beta 2, and found that 
compilation for some reason always failed. I then found out that it only 
happens when I compile a project stored in a NFS share, not if I compile 
it locally.

The error message:
error CS0016: Could not write to file `io.exe', cause: Win32 IO returned 
ERROR_LOCK_VIOLATION. Path: ./io.exe
Compilation failed: 1 error(s), 0 warnings

- Simon
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] using gdi+ with gtk#

2004-05-31 Thread Simon Ask Ulsnes
Miguel de Icaza wrote:
Hello,
 

Im making a little html renderer with gdi+
(http://www.compona.com/xhtmlrender10.gif)
Now I want to try to host this renderer in gtk#
so I wonder if its possible to display a gdi+ image on a gtk#
container?
   

Yes, it is possible.
We should get this into a library, but for now this will do it:
Compile like this:
mcs -r:System.Drawing -pkg:gtk-sharp DrawingSample.cs sysdraw.cs
Miguel
 

Are there any plans to actually get this into a library? It seems pretty 
handy to me (though I can't get your code to work, I simply get a blank 
window).

- Simon
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Using System.Drawing/Art/Mono.Cairo to draw widgets

2004-05-29 Thread Simon Ask Ulsnes
Hi there!
I'd like to experiment a bit with vector-style drawing using Mono. On 
Windows, this was easily done with System.Drawing on a 
System.Windows.Forms.Control base.

I'd prefer to keep using System.Drawing. But I don't know what base I 
should use? It would probably be a GTK# widget, but which supports 
System.Drawing, and how do I do?

Thanks.
- Simon
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Catching C-callbacks through InteropServices

2004-05-28 Thread Simon Ask Ulsnes
Hi there!
I'm writing a GnuPG interface for Mono/.NET using GPGME (GnuPG Made 
Easy, which is the C API applications use for connecting with gpg).

So far, it works fine, I can retrieve keys and encrypt/sign. However, 
the GPGME API is constructed in such a way that in order to retrieve a 
passphrase for use with decryption, you have to give it a callback 
function returning the passphrase as a const char*.

What I would do is to make a property in my GnuPGEngine class (which 
manages communication with the C layer through InteropServices) which 
will then be given to the real GnuPG engine (a GpgmeCtx, which means a 
GPGME Context object) through an internal callback.

How is this best done?
The API syntax in C for setting the callback function for the context is:
gpgme_set_passphrase(ctx, &get_passphrase, NULL);
where get_passphrase:
static const char* get_passphrase(void *HOOK, const char *DESC, void 
**R_HD);

With the above, the get_passphrase function never gets called. What to do?
- Simon
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] InteropServices: DllNotFoundException...?

2004-05-23 Thread Simon Ask Ulsnes
Thank you, that seems good.
Having always programmed Managed, I'm not really used to C-style memory 
management (or memory management at all, actually). ;-)

This will certainly help.
- Simon
Jonathan Pryor wrote:
On Sun, 2004-05-23 at 11:37, Simon Ask Ulsnes wrote:
 

*sigh*
Hooray for Managed Code! ;-)
Could you please give a short example of a C++ library function that 
returns a string for use in a managed application? (with proper memory 
hygiene ;-)
   

Sure.  I haven't tried to compile any of this, but it's the right
idea...
//
// Unmanaged C++ code
//
#include 
#include 
   /** 
* To minimize library differences, this function should be used
* by "external" code (managed code, other 3rd party code) to 
* free memory allocated within this library.
*
* This is particularly important on any platform that has 
* multiple runtime libraries which each export "free" (say, 
* Windows, with MSVCRT, GCC, Borland, and lots of other C 
* runtime library implementations, all of which are 
* mutually incompatible).
*/
   extern "C" void
   mylib_free (void* mem)
   {
   	free (mem);
   }
   
   /**
* This is a function which returns a newly allocated string.
* Callers *must* use mylib_free() to free the returned memory.
*/
   extern "C" char*
   mylib_get_string ()
   {
   	std::string s ("this is my string");
   	// manipulate `s' to fill its contents
   
   	// paranoia: check for integer overflow in buffer size 
   	// calculation.  Consider if s.size() is = 0x.
   	// 0x + 1 = 0, which is too small to hold the 
   	// required string; any attempt to fill the buffer would
   	// result in memory corruption.
   	// Yes, this is likely absurd, as your app would likely
   	// have crashed by now if it had a string that big, but
   	// better safe than sorry.
   	// For more information, see:
   	// http://msdn.microsoft.com/security/securecode/columns/default.aspx?pull=/library/en-us/dncode/html/secure04102003.asp 
   	std::string::size_type size = s.size();
   	if (size + 1 <= size) return NULL;
   	size += 1;
   
   	// return newly allocated string.
   	char *r = (char*) malloc (size);
   	if (!r) return NULL;
   	strcpy (r, s.c_str());
   	return r;
   }
   
   //
   // Managed code
   //
   
   using System;
   using System.Runtime.InteropServices;
   
   class Mylib {
   	[DllImport ("mylib")]
   	private static extern void mylib_free (IntPtr r);
   
   	[DllImport ("mylib")]
   	private static extern IntPtr mylib_get_string ();
   
   	public static string GetString ()
   	{
   		IntPtr r = mylib_get_string ();
   		if (r == IntPtr.Zero) return null;
   		string s = null;
   		try {
   			s = Marshal.PtrToStringAnsi (r);
   		}
   		finally {
   			mylib_free (r);
   		}
   		return s;
   	}
   }

- Jon

 

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] InteropServices: DllNotFoundException...?

2004-05-23 Thread Simon Ask Ulsnes
*sigh*
Hooray for Managed Code! ;-)
Could you please give a short example of a C++ library function that 
returns a string for use in a managed application? (with proper memory 
hygiene ;-)

- Simon
Jonathan Pryor wrote:
Inline...
On Sun, 2004-05-23 at 10:56, Simon Ask Ulsnes wrote:

 

Furthermore, if you do something like this:
const char*
get_my_string()
{
std::string s ("this is my string");
return s.c_str();
}
You're *asking* for trouble, as the std::string destructor will free the
memory used to hold the string, so the string returned by
get_my_string() will be pointing to invalid memory.
 

 
And guess what, that's actually what I'm doing (basically) - so far, it 
works, I haven't detected any memory leaks (haven't checked very 
thoroughly, though).
But you say using marshalling and IntPtr's is the best way to do it?
   

The above situation isn't a memory leak, so it won't be detected as a
memory leak.  It's instead a "use after free".  It's akin to doing this:
char *mem = malloc (20); // allocate
strcpy(mem, "some string");  // initialize
free (mem);  // free
printf ("this is my string: %s\n", mem); // use?!  bad.
It's not safe to use memory after it's freed.  Especially in a
multi-threaded environment -- the memory could have been re-allocated by
another thread and initialized with different data.
So this isn't a memory corruption bug or a memory leak, it's just bad
memory hygiene.
- Jon
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list
 

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] InteropServices: DllNotFoundException...?

2004-05-23 Thread Simon Ask Ulsnes
(in-text)
Jonathan Pryor wrote:
Converting from char* to string seems to work great, could you elaborate 
on the memory issues that it might create?
   

That's because Mono, last I knew, was slightly buggy -- it doesn't
properly free the memory.  .NET does.
The deal is that class types such as System.String (as opposed to
structure types) are always heap allocated.  As such, to prevent memory
leaks when a class type is used as the return type of a function, two
things are done: 

 1: the data is marshaled from unmanaged to managed memory 
("marshaled" == "copied, with some potential data transformation 
applied", such as converting Ansi strings to Unicode strings).

 2: the unmanaged memory is freed.
The problem is (2).  What memory manager is used?  If one memory manager
allocates memory and another memory manager frees it, the heap could
become corrupted.  This is bad.
.NET uses CoTaskMemAlloc() and CoTaskMemFree() as the memory manager
which crosses the managed/unmanaged boundary.  Mono will likely use
g_malloc() and g_free(), but last I knew memory wasn't actually being
freed.  This is probably why you're not seeing memory corruption. 
Instead, you'd be seeing memory leaks.

Again, see http://www.jprl.com/~jon/interop.html for more information.
 

Ah, I see. Thanks for the explanation.
(I ended up using C++ simply because of the brilliant stream model, 
which makes handling of strings (with stringstream) so much more 
intuitive and easy).
Luckily, string.c_str() converts from string to char*... ;-)
   

Unfortunately, no.  std::string::c_str() converts to a "const char*". 
Notice the "const"?  Furthermore, the memory returned by
std::string::c_str() is managed by the std::string instance.  So if you
attempted to manually free this memory (such as when the runtime
marshals the returned string...), you'd get *at best* a double delete,
and *at worst* heap corruption.

Furthermore, if you do something like this:
const char*
get_my_string()
{
std::string s ("this is my string");
return s.c_str();
}
You're *asking* for trouble, as the std::string destructor will free the
memory used to hold the string, so the string returned by
get_my_string() will be pointing to invalid memory.
 

And guess what, that's actually what I'm doing (basically) - so far, it 
works, I haven't detected any memory leaks (haven't checked very 
thoroughly, though).
But you say using marshalling and IntPtr's is the best way to do it?

 

But yes, I hope this is something that will be improved. Currently, it 
is extremely cumbersome to debug a C/C++ library through managed 
applications.
   

So don't. :-)
Debug the unmanaged library in an unmanaged test application, and make
sure the unmanaged part *actually works*.  Once that works, *then*
introduce managed code.  To do otherwise is to greatly complicate your
life, as you won't know where the problem is occurring.
I would also suggest using valgrind, to help find memory leaks and
memory corruption in your unmanaged code.
- Jon
_
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list
 

Probably a good idea. ^_^
Yours,
Simon
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] InteropServices: DllNotFoundException...?

2004-05-23 Thread Simon Ask Ulsnes
(sorry for top-posting, but)
Thanks for your reply!
As it turned out, I was calling a non-existant function in the GPGME API 
that was referenced in the GPGME Info-pages, but was called something 
else in gpgme.h.

Converting from char* to string seems to work great, could you elaborate 
on the memory issues that it might create?

Also, Mono apparently can't convert from the C++ STL string to .NET 
System.String - probably because Mono is written in C...
(I ended up using C++ simply because of the brilliant stream model, 
which makes handling of strings (with stringstream) so much more 
intuitive and easy).
Luckily, string.c_str() converts from string to char*... ;-)

But yes, I hope this is something that will be improved. Currently, it 
is extremely cumbersome to debug a C/C++ library through managed 
applications.

- Simon
Jonathan Pryor wrote:
On Thu, 2004-05-20 at 17:47, Simon Ask Ulsnes wrote:

 

Of course, I'm using InteropServices to interact with a C library. I 
made a few wrapper functions in the library, and the basic ones (such as 
checking the library version and such) work well. But after I added the 
latest (GetKeyNames and GetKeyXML), loading the library starts shouting 
Exceptions - namely DllNotFoundException. Yes, the library is in place.
   

So, it worked at one point, but when you wrapped GetKeyNames and
GetKeyXML, *then* it started to fail?  Is this correct?
What's possible is that you're encountering the mix of two issues.  The
first issue is that, IIRC, when DllNotFoundException is thrown it only
contains the *initial* library that the runtime attempted to load, *not*
the actual library which couldn't found.
Meaning if libA.so depends on libB.so, libA.so is present but libB.so
isn't, DllNotFoundException will give the error stating that libA.so
couldn't be found.
I believe this will be fixed in the next release of Mono.
The second issue is basically the first: one of the dependent libraries
likely can't be found.
Run "ldd libsector.so", and make sure that *all* dependent libraries can
be found.
 

I'm think I'm making a mistake in writing the C library part properly, 
but what exactly is it I'm doing wrong?
   

I'm not entirely sure why you're seeing DllNotFoundException; see above
for a possible explanation.
However, there is another issue present: strings.  Your DllImport
declarations specify that System.String is the return type.  This will
cause the runtime to attempt to free the strings returned by those
functions.  IIRC, Mono will use g_free() to free that memory.  If those
strings weren't allocated by g_malloc(), this could lead to heap
corruption.
Even worse, it's not portable.  .NET uses CoTaskMemAlloc() and
CoTaskMemFree() to handle memory returned in this fashion, which I
assume GPGME won't be using.
The solution is simple: don't use strings.  Use System.IntPtr and use
System.Runtime.InteropServices.Marshal.PtrToStringAnsi():
[DllImport("libsecstor.so")]
private static extern IntPtr GetKeyNames();
private static string RealGetKeyNames ()
{
IntPtr r = GetKeyNames ();
string s = Marshal.PtrToStringAnsi (r);
// Free `r' as appropriate
}
If the string returned by GetKeyNames() is in UTF-8, you may need
alternate processing.  Seeing how Gtk# does this would be useful.
See http://www.jprl.com/~jon/interop.html for more information.
- Jon
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list
 

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] InteropServices: DllNotFoundException...?

2004-05-20 Thread Simon Ask Ulsnes
Hi there!
I'm trying to write a Mono wrapper for GPGME (GnuPG Made Easy, an 
application wrapper to GPG).
It's becoming wrapper around wrapper around wrapper, but what the 
heck... ;-)

Of course, I'm using InteropServices to interact with a C library. I 
made a few wrapper functions in the library, and the basic ones (such as 
checking the library version and such) work well. But after I added the 
latest (GetKeyNames and GetKeyXML), loading the library starts shouting 
Exceptions - namely DllNotFoundException. Yes, the library is in place.

I'm think I'm making a mistake in writing the C library part properly, 
but what exactly is it I'm doing wrong?

Attached is the source code, along with a small compile script I use for 
smaller test projects (simply chmod +x and run to compile).

Yours,
Simon
using System;
using System.Runtime.InteropServices;

namespace SecureStorage
{
	public class InterfaceTest
	{
		public static void Main(string[] args)
		{
			new InterfaceTest();
		}

		[DllImport("./libsecstor.so")] private static extern bool CheckEngine();
		[DllImport("./libsecstor.so")] private static extern string GetEngineInfoXML();
		[DllImport("./libsecstor.so")] private static extern string GetKeyNames();
		[DllImport("./libsecstor.so")] private static extern string GetKeyXML(string keyname);

		public InterfaceTest()
		{
			if (CheckEngine())
			{
Console.WriteLine("Engine OK\n");

string[] keys = GetKeyNames().Split(',');
foreach (string s in keys)
{
	Console.WriteLine(s);
}
			}
			else
			{
Console.WriteLine("Engine error...");
			}
		}
	}
}
#!/bin/sh
gcc -o libsecstor.so -shared `gpgme-config --cflags --libs` *.c
mcs -out:secstor.exe *.cs
#include 

#define bool int
#define true 1
#define false 0

extern bool CheckEngine()
{
	GpgmeError err;
	err = gpgme_engine_check_version(GPGME_PROTOCOL_OpenPGP);
	if (err == GPGME_No_Error)
		return true;
	else
		return false;
}

extern char* GetEngineInfoXML()
{
	return (char*)gpgme_get_engine_info();
}

extern char* GetKeyNames()
{
	GpgmeCtx ctx;
	GpgmeError err = gpgme_new(&ctx);
	GpgmeKey key;
	
	char* ret = "";

	err = gpgme_op_keylist_start(ctx, "", 0);
	while (!err && (err = gpgme_op_keylist_next(ctx, &key)) != GPGME_EOF)
	{
		ret = strcat(ret, ",");
		ret = strcat(ret, (char*)gpgme_key_get_string_attr(key, GPGME_ATTR_KEYID, 0, 0));
		gpgme_release_key(key);
	}
	
	gpgme_release(ctx);

	return ret;
}

extern char* GetKeyXML(char* keyname)
{
	GpgmeCtx ctx;
	GpgmeError err = gpgme_new(&ctx);

	GpgmeKey key;
	
	if (!err)
	{
		err = gpgme_op_keylist_start(ctx, keyname, 0);
		while (!err && (err = gpgme_op_keylist_next(ctx, &key)) != GPGME_EOF)
		{
		}
		gpgme_release(ctx);
	}

	char* ret = gpgme_key_get_as_xml(key);
	gpgme_key_release(key);
	return ret;
}


Re: [Mono-list] Is it Mono safe?

2004-05-20 Thread Simon Ask Ulsnes
Tell me again:
Why doesn't Novell/Ximian contact Microsoft to get it on paper that Mono 
_is_ safe?

(and if Microsoft refuses, can we actually be sure it is safe?)
- Simon
[EMAIL PROTECTED] wrote:
I think one of the greatest barriers to adoption of mono by influential
developers will always be the MS issue. Miguel has explained the legal
situation over and over, but there are some linux users who will argue over
the smallest detail wherever MS is concerned with a technology.
It is unfortunate that the community will negate the fantastic success of the
mono development guys through FUD and miscommunication.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Melinda
Sent: Thursday, May 20, 2004 6:40 AM
To: Mono List
Subject: [Mono-list] Is it Mono safe?
Look over here:
http://www.gnome.org/~seth/blog/mono
and here:
http://www.osnews.com/comment.php?news_id=7094
This is bad news :(
How do you convince somebody to programming in Mono if he already read that
news?
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


This email may contain information which is privileged or confidential. If you are not 
the intended recipient of this email, please notify the sender immediately and delete 
it without reading, copying, storing, forwarding or disclosing its contents to any 
other person
Thank you
Check us out at http://www.btsyntegra.com

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list
 

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Xsp in standalone amd mod_mono

2004-05-18 Thread Simon Ask Ulsnes
You probably have to recompile XSP. It looks like it was compiled with 
Mono pre-GAC.

- Simon
Shawn Vose wrote:
For some reason I am not able to service aspx pages in my apache 2.0. I
have the conf file configured correctly but I think the problem is with
xsp as I am having a problem getting xsp to service request.
Specifically it is returning a 500 error
to start xsp I am using the following command
$ mono /usr/local/bin/xsp.exe --port 8080 --root .
Listening on port: 8080
Listening on address: 0.0.0.0
Root directory: /usr/share/doc/xsp/test
Hit Return to stop the server.
Compat mode: the request from /usr/share/doc/xsp/test/bin/extensions.dll to load 
System.Web.Services was remapped (http://www.go-mono.com/remap.html)
Then when I request index.aspx I get the following
System.TypeLoadException: Cannot load type
'Mono.Http.Modules.AcceptEncodingModule, Mono.Http'
in (unmanaged) /usr/lib/libmono.so.0(mono_raise_exception+0x20) [0x400bcad8]
in (unmanaged) /usr/lib/libmono.so.0 [0x400c0352]
in <0x00054> System.Type:GetType (string,bool)
in <0x0002c> System.Web.Configuration.ModuleItem:.ctor (string,string)
in <0x002f2> System.Web.Configuration.HttpModulesConfigurationHandler:Create 
(object,object,System.Xml.XmlNode)
in <0x001c0> System.Web.Configuration.ConfigurationData:GetConfigInternal 
(string,System.Web.HttpContext,bool)
in <0x0008b> System.Web.Configuration.ConfigurationData:GetConfigOptLocation 
(string,System.Web.HttpContext,bool)
in <0x002fe> System.Web.Configuration.ConfigurationData:GetConfig 
(string,System.Web.HttpContext)
in <0x00125> System.Web.Configuration.ConfigurationData:GetConfigInternal 
(string,System.Web.HttpContext,bool)
in <0x0008b> System.Web.Configuration.ConfigurationData:GetConfigOptLocation 
(string,System.Web.HttpContext,bool)
in <0x002fe> System.Web.Configuration.ConfigurationData:GetConfig 
(string,System.Web.HttpContext)
in <0x00079> System.Web.Configuration.WebDefaultConfig:GetConfig 
(string,System.Web.HttpContext)
in <0x00030> System.Web.Configuration.WebDefaultConfig:GetConfig (string)
in <0x00016> System.Web.Configuration.WebConfigurationSettings:GetConfig (string)
in <0xb> System.Web.HttpContext:GetAppConfig (string)
in <0x00025> System.Web.HttpApplication:InitModules ()
in <0x00054> System.Web.HttpApplication:Startup 
(System.Web.HttpContext,System.Web.HttpApplicationState)
in <0x0007e> System.Web.HttpApplicationFactory:InitializeFactory 
(System.Web.HttpContext)
in <0x00073> System.Web.HttpApplicationFactory:GetInstance (System.Web.HttpContext)
in <0x00132> System.Web.HttpRuntime:InternalExecuteRequest 
(System.Web.HttpWorkerRequest)
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list
 

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] The handle daemon didnt start up properly

2004-05-16 Thread Simon Ask Ulsnes
rm -rf ~/.wapi
Did it for me... ;-)
- Simon
bender wrote:
Hi!
All of a sudden i get these warnings whenever i try to start a mono
application:
** (test.exe:14610): WARNING **: The handle daemon didnt start up
properly
** (test.exe:14610): WARNING **: Failed to attach shared memory! Falling
back to non-shared handles
Everything seems to work, but much slower than expected. Anyone that
knows how to fix this?
BR
.b
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list
 

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Handle daemon?

2004-05-08 Thread Simon Ask Ulsnes
Oh my! It worked! Thank you so much!

Maybe this should be included in the documentation somewhere? A lot of 
people will be upgrading from previous alpha/beta versions, and might 
run into the same problem.

Yours,
Simon
Jaroslaw Kowalski wrote:

Delete ".wapi" - it will be recreated next time you run mono.

Jarek

- Original Message - 
From: "Simon Ask Ulsnes" <[EMAIL PROTECTED]>
To: "Dick Porter" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, May 07, 2004 5:20 PM
Subject: Re: [Mono-list] Handle daemon?

 

Set a+wrX on ~/.wapi and it's files - still the same.

Yours,
Simon
Dick Porter wrote:

   

On Fri, 2004-05-07 at 13:24, Simon Ask Ulsnes wrote:

 

I noticed something peculiar: It doesn't happen when running mono as
root. Does the handle daemon require access to some specific part of my
system? When I run Mono as root, all is good. Maybe this is kernel
   

related?
 

   

OK, check the ~/.wapi directory and contents.  Maybe there are some
strange permissions preventing it working.
- Dick



___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


 

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list
   

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list
 

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Handle daemon?

2004-05-07 Thread Simon Ask Ulsnes
Set a+wrX on ~/.wapi and it's files - still the same.

Yours,
Simon
Dick Porter wrote:

On Fri, 2004-05-07 at 13:24, Simon Ask Ulsnes wrote:
 

I noticed something peculiar: It doesn't happen when running mono as 
root. Does the handle daemon require access to some specific part of my 
system? When I run Mono as root, all is good. Maybe this is kernel related?
   

OK, check the ~/.wapi directory and contents.  Maybe there are some
strange permissions preventing it working.
- Dick



___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list
 

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Handle daemon?

2004-05-07 Thread Simon Ask Ulsnes
My CFLAGS weren't extreme, only -march=pentium4 -O2 
-fomit-frame-pointers and -fprefetch-loop-arrays.

I noticed something peculiar: It doesn't happen when running mono as 
root. Does the handle daemon require access to some specific part of my 
system? When I run Mono as root, all is good. Maybe this is kernel related?

I can also set the environment variable MONO_DISABLE_SHM=1, but that 
causes MonoDevelop and other apps to randomly segfault.

Thanks for helping...

Yours,
Simon
Dick Porter wrote:

On Thu, 2004-05-06 at 18:34, Simon Ask Ulsnes wrote:
 

Hi there...
Every time I run a Mono app with the new Beta 1, I get the following 
command-line output:

** (test.exe:7227): WARNING **: The handle daemon didnt start up properly

** (test.exe:7227): WARNING **: Failed to attach shared memory! Falling 
back to non-shared handles

What's that all about? I never heard of any handle daemon?
   

It manages cross-process shared data, amongst other things.

When a mono process starts it tries to look up the daemon, or starts one
if there isn't one currently running.
 

Mono stalls for about 5 seconds before showing these messages, which is 
really annoying.

Library versions:
GLib: 2.4.1
GLIBC: 2.3.3 (20040420)
GCC: 3.4 (system compiled with 3.4, Mono with 3.3.3 because of strange 
errors)

Mono was compiled with support for NPTL. I'm running Gentoo with a 2.6.4 
kernel.
   

I usually ignore Gentoo bugs because there is no hope of reproducing the
build environment.  "Strange errors" seems to be the norm.  However,
I've recently tweaked the daemon startup code to fix a race condition,
so I'll make an exception in this case.
First thing to do is to turn down the gcc optimisation level, if its set
to anything higher than -O2.
If that doesn't cure it, turn on the DEBUG define at the top of
io-layer/daemon.c and send me any output off-list.
- Dick

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list
 

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Handle daemon?

2004-05-06 Thread Simon Ask Ulsnes
Hi there...
Every time I run a Mono app with the new Beta 1, I get the following 
command-line output:

** (test.exe:7227): WARNING **: The handle daemon didnt start up properly

** (test.exe:7227): WARNING **: Failed to attach shared memory! Falling 
back to non-shared handles

What's that all about? I never heard of any handle daemon?
Mono stalls for about 5 seconds before showing these messages, which is 
really annoying.

Library versions:
GLib: 2.4.1
GLIBC: 2.3.3 (20040420)
GCC: 3.4 (system compiled with 3.4, Mono with 3.3.3 because of strange 
errors)

Mono was compiled with support for NPTL. I'm running Gentoo with a 2.6.4 
kernel.

Suggestions?

- Simon
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list