[Mono-bugs] [Bug 75886][Cri] Changed - Remoting Configuration Win32-Client Mono-server

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Sep 9 12:33:53 EDT 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by yngve.zackrisson at mobila-kontoret.se.

http://bugzilla.ximian.com/show_bug.cgi?id=75886

--- shadow/75886	2005-08-30 13:45:16.000000000 -0400
+++ shadow/75886.tmp.8916	2005-09-09 12:33:53.000000000 -0400
@@ -196,6 +196,107 @@
 if I have the --trace=none option on.
 
 To summarise: The main problem seems to be in 
 RemotingConfiguration.Configure(..);
 
 
+
+------- Additional Comments From yngve.zackrisson at mobila-kontoret.se  2005-09-09 12:33 -------
+Hi again! 
+
+(1) I think I have found the source to the: 
+
+'400 : Bad request'
+
+In my custom SecureChannel the is additional custom headers 
+named like sc_TransactionType etc that is added 
+to the http request's ITransportHeaders.
+(See: the SecureChannel's Messages.cs internal class CommonHeaders
+for the exact names).
+
+The additional custom header's become something like : 
+
+sc_TransactionType 10
+
+In Mono:s System.Runtime.Remoting.Channels.Http 
+source HttpServer.cs 
+the request is processed and the 
+bool ParseHeader (...) 
+method is executed.
+In this method the custom header is of course not found 
+in ReqMessageParser.ParseHeaderField(...) .
+
+When the ReqMessageParser.IsCustomHeader(...) 
+is executed the abowe custom header is not allowed, 
+causing a : 
+SendResponse (reqArg, 400, null, null);
+hence the '400 : Bad request' i quess.
+
+The question now is whether this is right?.
+In MS .NET i get no '400 : Bad request' 
+using the same custom SecureChannel.
+
+Diving deeper into the IsCustomHeader(...) 
+i found that a Regex was used.
+
+The regular expression goes like this: 
+
+"^(?<header>\\S+)(\\s*:\\s*)(?<field>\\S+(\\s|\\S)*\\S)(\\s*)"
+
+Never having beeing exposed to regular expressions 
+I tryed a number of custom heder strings against 
+this regular expression in my CSharpDevelop on Windows.
+For instance: 
+
+sc_TransactionType 10
+scTransactionType 10
+ sc_TransactionType 10
+ scTransactionType 10
+scTransactionType10
+scTransactionType
+
+All of these tests failed.
+
+When studying .NET regular expressions I could not find 
+any reference to the ( : ) group construct.
+Since I could not understand the (\\s*:\\s*) construct 
+I changed that to simply (\\s*)
+getting the regular expression : 
+
+"^(?<header>\\S+)(\\s*)(?<field>\\S+(\\s|\\S)*\\S)(\\s*)"
+
+After that the test 
+
+sc_TransactionType 10
+
+went ok
+All of the other tests failed.
+
+Maybe the regular expression should be changed?. 
+If not, how should it be possible to add custom headers 
+to a http request?.
+
+------------------------------------------------------------------
+
+(2) EXCEPTION handling: FormatException
+
+During my run of my test app with --trace=none 
+I got FormatException's (se abowe for more on this).
+
+After digging into this I found that the cause for this 
+exception was that the HttpServerChannel property "machineName" 
+was not added, hence the FormatException.
+
+The exception is thrown in : 
+namespace: System.Runtime.Remoting.Channels.Http 
+class: HttpServerChannel 
+method: void SetupMachineName()
+
+AFAIK, this causes no problem to mee. Only the belief there is one.
+
+-------------------------------------------------------------------
+
+Regards 
+
+
+Yngve Zackrisson.
+


More information about the mono-bugs mailing list