Compare commits

...
57 Commits
Author SHA1 Message Date
Miguel de Icaza 3f313cb9ec Up
svn path=/branches/mono-1-0/mcs/; revision=37346
2004-12-07 22:09:58 +00:00
Miguel de Icaza 8848992453 Up
svn path=/branches/mono-1-0/mono/; revision=37345
2004-12-07 22:09:52 +00:00
Miguel de Icaza 039469b073 Flush
svn path=/branches/mono-1-0/mcs/; revision=37344
2004-12-07 22:09:09 +00:00
Ben Maurer f5f0faa021 2004-12-07 Ben Maurer <[email protected]>
* threads.c: Interlocked inc and dec for longs were messed up,
	use a KISS based impl for this. Fixes 70234


svn path=/branches/mono-1-0/mono/; revision=37336
2004-12-07 21:55:52 +00:00
Paolo Molaro b8a27ac9db Tue Dec 7 11:44:39 CET 2004 Paolo Molaro <[email protected]>
* mini-ppc.c, objectc.cs: handle large structs passed by value
	(fixes bug #69972).


svn path=/branches/mono-1-0/mono/; revision=37333
2004-12-07 21:45:20 +00:00
Paolo Molaro ebbae7a275 Fri Nov 19 17:29:22 CET 2004 Paolo Molaro <[email protected]>
* ppc/ppc-codegen.h: counter reg decrement branch values
	(patch by Geoff Norton <[email protected]>).


svn path=/branches/mono-1-0/mono/; revision=37331
2004-12-07 21:44:18 +00:00
Gonzalo Paniagua Javier e614a203bf 2004-12-06 Gonzalo Paniagua Javier <[email protected]>
* Process.cs: always pass the same arguments to the runtime.


svn path=/branches/mono-1-0/mcs/; revision=37244
2004-12-06 21:53:04 +00:00
Gonzalo Paniagua Javier 46575c2cbd 2004-12-06 Gonzalo Paniagua Javier <[email protected]>
* process.c: make the patch that handles spaces in file paths work
	on mono/windows too.


svn path=/branches/mono-1-0/mono/; revision=37243
2004-12-06 21:52:24 +00:00
Sebastien Pouliot 28af3a955e 2004-12-06 Sebastien Pouliot <[email protected]>
* RSAManaged.cs: Implement key blinding for RSA decryption with, or
	without, using CRT.


svn path=/branches/mono-1-0/mcs/; revision=37236
2004-12-06 20:22:58 +00:00
Sebastien Pouliot f3447d3f0b 2004-12-06 Sebastien Pouliot <[email protected]>
* RSACryptoServiceProvider.cs: Merge from HEAD.


svn path=/branches/mono-1-0/mcs/; revision=37235
2004-12-06 20:21:03 +00:00
Sebastien Pouliot 3ce5fb0901 2004-12-06 Sebastien Pouliot <[email protected]>
* RSAManaged.cs: Implement key blinding for RSA decryption with, or
	without, using CRT.


svn path=/branches/mono-1-0/mcs/; revision=37234
2004-12-06 20:18:10 +00:00
Miguel de Icaza 59d0d973b7 2004-12-06 Miguel de Icaza <[email protected]>
* FontFamily.cs: Families is static.

svn path=/branches/mono-1-0/mcs/; revision=37233
2004-12-06 20:14:18 +00:00
Atsushi Eno 67986dc51c 2004-12-06 Atsushi Enomoto <[email protected]>
* TextWriter.cs : create CoreNewLine in another .ctor().



svn path=/branches/mono-1-0/mcs/; revision=37165
2004-12-06 04:53:25 +00:00
Gonzalo Paniagua Javier fde8977cf8 updated entry
svn path=/branches/mono-1-0/mcs/; revision=37159
2004-12-05 23:14:40 +00:00
Gonzalo Paniagua Javier f5f748e56d 2004-12-05 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: set the event in Close so that if the queue is
	empty, we won't block forever on next request.


svn path=/branches/mono-1-0/mcs/; revision=37156
2004-12-05 23:03:15 +00:00
Gonzalo Paniagua Javier 28509a9519 2004-12-05 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: readd prevStream. Caused regressions.


svn path=/branches/mono-1-0/mcs/; revision=37150
2004-12-05 21:32:52 +00:00
Zoltan Varga 93602830a2 Merge from HEAD.
svn path=/branches/mono-1-0/mono/; revision=37092
2004-12-04 19:23:19 +00:00
Gonzalo Paniagua Javier 33f67ca6a1 2004-12-04 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: handle errors on chunked streams. Fixes bug #66858.
	* ChunkStream.cs: added error checking all over.

	* HttpWebRequest.cs: throw the exception received in SetResponseError
	if we already have a response.
	(SetRequestData): Don't nest the exception if it's a WebException.


svn path=/branches/mono-1-0/mcs/; revision=37076
2004-12-04 11:53:52 +00:00
Ben Maurer 50640010d6 revert
svn path=/branches/mono-1-0/mcs/; revision=37072
2004-12-04 00:21:18 +00:00
Sebastien Pouliot 60939e21e9 2004-12-03 Sebastien Pouliot <[email protected]>
* BigInteger.cs: Fix issue #70169 in ModPow when modulus is a power of
	two. Also sync other changes with HEAD (mostly removing warnings).


svn path=/branches/mono-1-0/mcs/; revision=37053
2004-12-03 20:18:08 +00:00
Sebastien Pouliot 7a891c80d7 2004-12-03 Sebastien Pouliot <[email protected]>
* BigInteger.cs: Fix issue #70169 in ModPow when modulus is a power of
	two.


svn path=/branches/mono-1-0/mcs/; revision=37052
2004-12-03 20:16:46 +00:00
Gonzalo Paniagua Javier 2c3f55598b 2004-12-03 Gonzalo Paniagua Javier <[email protected]>
* SoapHttpClientProtocol.cs: dispose the StreamReader that wraps the
	response stream.


svn path=/branches/mono-1-0/mcs/; revision=37001
2004-12-03 09:58:00 +00:00
Gonzalo Paniagua Javier cef8cc61f1 2004-12-03 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: remove prevStream and don't set busy to false in
	HandleError. prevStream is not needed any more and setting 'busy' so
	early might let a request skip the queue.
	
	* WebConnectionGroup.cs: decrement the indexer when removing a dead
	reference from the arraylist.

	* WebConnectionStream.cs:
	(ReadAll): call NextRead if it has not been called before even when
	we have completed the request. Reuse the read buffer when reading a
	response of unknown size. Increase the buffer to 8kB.
	(BeginRead): increase pendingReads earlier and even when reading from
	the internal buffer.
	(EndRead): decrease pendingReads later and always.


svn path=/branches/mono-1-0/mcs/; revision=36994
2004-12-03 07:39:19 +00:00
Gonzalo Paniagua Javier 61c7c6b281 2004-12-03 Gonzalo Paniagua Javier <[email protected]>
* NetworkStream.cs: Write should ensure that writes all the contents
	of the buffer. Fixes bug #70123. Besos para Miguelito.


svn path=/branches/mono-1-0/mcs/; revision=36990
2004-12-03 06:26:13 +00:00
Miguel de Icaza 4021c4970d ==> ChangeLog <==
2004-12-01  Miguel de Icaza  <[email protected]>

	* cfold.cs (ConstantFold.DoConstantNumericPromotions): After
	unwrapping the enumeration values, chain to
	DoConstantNumericPromotions again, so we can promote things to the
	fundamental types (takes care of enums that are bytes, sbytes).

	Fixes bug #62054.

2004-11-25  Miguel de Icaza  <[email protected]>

svn path=/branches/mono-1-0/mcs/; revision=36913
2004-12-01 22:08:28 +00:00
Gonzalo Paniagua Javier cbb2e9d974 2004-12-01 Gonzalo Paniagua Javier <[email protected]>
* CookieCollection.cs: reformatted, fixed Add by adding a new method to
	search across the arraylist, as list.IndexOf is not what we want.


svn path=/branches/mono-1-0/mcs/; revision=36909
2004-12-01 18:21:35 +00:00
Gonzalo Paniagua Javier 6917176796 2004-12-01 Gonzalo Paniagua Javier <[email protected]>
* metadata/process.c: (complete_path) return the path quoted
	* io-layer/processes.c: unquote the cmd path, allow for ' or " when
	quoting and pass the quoted program name to the daemon, otherwise the
	call to g_shell_unquote in the daemon will break things up.


svn path=/branches/mono-1-0/mono/; revision=36902
2004-12-01 12:13:22 +00:00
Gonzalo Paniagua Javier 72ffc50a2e 2004-11-30 Gonzalo Paniagua Javier <[email protected]>
* Control.cs: when saving "Visible" into the ViewState, save the value
	for this precise control, as using the Visible property might give us
	Control's parent visibility. Fixes bug #69200.


svn path=/branches/mono-1-0/mcs/; revision=36876
2004-12-01 00:37:31 +00:00
Gonzalo Paniagua Javier 318d4accb4 firefox is here!
svn path=/branches/mono-1-0/mono/; revision=36861
2004-11-30 20:57:15 +00:00
Gonzalo Paniagua Javier 6c44824926 2004-11-30 Gonzalo Paniagua Javier <[email protected]>
* System.Web.SessionState/SessionStateModule.cs: set the path modifier
	when using cookie-less sessions.

	* System.Web/HttpResponse.cs: fixed ApplyAppPathModifier to insert the
	session ID.
	* System.Web.UI/Control.cs: fixed ResolveUrl for relative URLs when
	using cookie-less sessions.

	* System.Web.Util/UrlUtils.cs: made (Insert|Get|Remove)SessionId use
	the appRoot + SessionID + vpath format.

	Fixes the 3 issues reported in bug #66623.


svn path=/branches/mono-1-0/mcs/; revision=36819
2004-11-30 06:36:38 +00:00
Atsushi Eno 1d3031d872 2004-11-30 Atsushi Enomoto <[email protected]>
* DTDReader.cs : Consideration on parameter entity was missing for 
	  attribute default value. Fixed bug #70008.



svn path=/branches/mono-1-0/mcs/; revision=36817
2004-11-30 06:20:41 +00:00
Gonzalo Paniagua Javier eeb4b2e824 2004-11-29 Gonzalo Paniagua Javier <[email protected]>
* HtmlForm.cs: fixed the Action property when running a different
	page than the one requested (Transfer). Closes bug #69318.


svn path=/branches/mono-1-0/mcs/; revision=36813
2004-11-30 03:05:28 +00:00
Gonzalo Paniagua Javier 241d79e8a6 Backported from HEAD:
2004-11-29 Gonzalo Paniagua Javier <[email protected]>

	* System.Text.RegularExpressions/RegexBugs.cs: test case for bug #57274.

2004-07-05  Jackson Harper  <[email protected]>

	* RegexTest.cs: Add some simple tests for debugging/zen building.
	

svn path=/branches/mono-1-0/mcs/; revision=36801
2004-11-30 01:26:13 +00:00
Gonzalo Paniagua Javier a0b22bb06c Backported the following from HEAD:
2004-11-29 Gonzalo Paniagua Javier <[email protected]>

	* regex.cs: use NextMatch to move on to the next match. Fixes bug
	#57274.

2004-11-09  Atsushi Enomoto  <[email protected]>

	* parser.cs : cast.

2004-11-08  Ben Maurer  <[email protected]>

	* replace.cs, parser.cs: Use stringbuilder for allocation sanity.



svn path=/branches/mono-1-0/mcs/; revision=36799
2004-11-30 01:23:28 +00:00
Gonzalo Paniagua Javier ffbda13a58 proper bug fix number
svn path=/branches/mono-1-0/mcs/; revision=36788
2004-11-29 19:26:02 +00:00
Gonzalo Paniagua Javier 87305aaf57 2004-11-29 Gonzalo Paniagua Javier <[email protected]>
* DefaultWatcher.cs: make it work when the FileMask does not have
	wildcards and we're watching a directory.


svn path=/branches/mono-1-0/mcs/; revision=36787
2004-11-29 19:05:09 +00:00
Atsushi Eno e83ddf7ab6 2004-11-29 Atsushi Enomoto <[email protected]>
* GC.cs : Collect(generation) actually does not throw an exception
	  even if generation > MaxGeneration (MS document bug).



svn path=/branches/mono-1-0/mcs/; revision=36783
2004-11-29 16:24:46 +00:00
Zoltan Varga 4e82fecb76 2004-11-29 Zoltan Varga <[email protected]>
* cpu-sparc.md mini-sparc.c (long_conv_to_ovf_i): Fill missing delay slot.
	Fixes #69929.

svn path=/branches/mono-1-0/mono/; revision=36780
2004-11-29 14:07:16 +00:00
Gonzalo Paniagua Javier 6fba96d33d 2004-11-29 Gonzalo Paniagua Javier <[email protected]>
* System.Web.dll.sources: added ReusableMemoryStream.

	* System.Web/ReusableMemoryStream.cs: copied from System.IO.MemoryStream
	and slightly modified to allow expanding the buffer for cases on which
	the regular MemoryStream don't allow it.

	* System.Web/HttpWriter.cs: use the new ReusableMemoryStream and fix
	bug #19841. Otherwise we would have to allocate a new MemoryStream...


svn path=/branches/mono-1-0/mcs/; revision=36758
2004-11-29 05:52:28 +00:00
Gonzalo Paniagua Javier 306c82c3c5 2004-11-28 Gonzalo Paniagua Javier <[email protected]>
* System.Web/HttpApplication.cs: Create() is now GetInstance().
	* System.Web.Configuration/HandlerItem.cs: for reusable items, return
	the same instance always. Fixes bug #69959.


svn path=/branches/mono-1-0/mcs/; revision=36734
2004-11-28 23:48:51 +00:00
Atsushi Eno 5e884040ce 2004-11-28 Atsushi Enomoto <[email protected]>
* XslVariable.cs : Local param might be overriden by XsltArgumentList.
	  (plus some extraneous field cleanup.)



svn path=/branches/mono-1-0/mcs/; revision=36712
2004-11-28 05:47:52 +00:00
Miguel de Icaza 4cf437e20d 2004-11-25 Miguel de Icaza <[email protected]>
* const.cs (Const.ChangeType): Cope with the "0 literal can be
	converted to an enum" here, before we try to change the underlying
	type.  This code exists, but it is a different code path than the
	one used while encoding constants.


svn path=/branches/mono-1-0/mcs/; revision=36572
2004-11-25 23:11:02 +00:00
Ben Maurer 34ad30d1f8 merge from head
svn path=/branches/mono-1-0/mcs/; revision=36571
2004-11-25 21:22:24 +00:00
Gonzalo Paniagua Javier 80c6aad05d 2004-11-24 Gonzalo Paniagua Javier <[email protected]>
* GlobalizationConfigurationHandler.cs: fixed stupid typo (uiculture ->
	uiCulture). Closes bug #69524.


svn path=/branches/mono-1-0/mcs/; revision=36508
2004-11-24 22:20:45 +00:00
Zoltan Varga 67f7345766 2004-11-24 Zoltan Varga <[email protected]>
* mini.c (mono_method_to_ir): Disable inlining for methods containing
	localloc. Fixes #69678.

	* iltests.il (test_0_localloc_inline): Add regression test for #69678.

svn path=/branches/mono-1-0/mono/; revision=36482
2004-11-24 13:28:34 +00:00
Zoltan Varga 3769fa3bf6 2004-11-24 Zoltan Varga <[email protected]>
* reflection.c: Allow all kinds of whitespace, not just ' ' in type
	names. Fixes #69787.

svn path=/branches/mono-1-0/mono/; revision=36479
2004-11-24 13:10:56 +00:00
Sebastien Pouliot 57cb4f1a11 2004-11-23 Sebastien Pouliot <[email protected]>
* RecordProtocol.cs: Fixed ClientHelloV2 support.


svn path=/branches/mono-1-0/mcs/; revision=36447
2004-11-23 20:22:46 +00:00
Sebastien Pouliot 5b2cd03616 2004-11-23 Sebastien Pouliot <[email protected]>
* PKCS1.cs: Merge from HEAD. Fix PKCS#1 v1.5 decryption when the 
	ciphertext isn't exactly the same of the public key and some level 4 
	compiler warnings.


svn path=/branches/mono-1-0/mcs/; revision=36436
2004-11-23 12:49:06 +00:00
Sebastien Pouliot a27026dfbc 2004-11-23 Sebastien Pouliot <[email protected]>
* PKCS1.cs: Merge from HEAD. Fix PKCS#1 v1.5 decryption when the 
	ciphertext isn't exactly the same of the public key and some level 4 
	compiler warnings.


svn path=/branches/mono-1-0/mcs/; revision=36435
2004-11-23 12:48:02 +00:00
Ben Maurer e93e7cbf52 2004-11-22 Ben Maurer <[email protected]>
* DefaultWatcher.cs: Copy the hashtable when we scan for changes
	so that you can make modifications in a handler. Fixes 65966.


svn path=/branches/mono-1-0/mcs/; revision=36404
2004-11-22 22:48:24 +00:00
Zoltan Varga dccf891071 2004-11-22 Zoltan Varga <[email protected]>
* ModuleBuilder.cs: Check that all types inside the module are created.
	Fixes #69780.

svn path=/branches/mono-1-0/mcs/; revision=36392
2004-11-22 14:51:25 +00:00
Daniel Morgan 6578727d5c 2004-11-19 Daniel Morgan <[email protected]>
* Mono.Data/.cvsignore
	* Mono.Data/AssemblyInfo.cs
	* Mono.Data/Makefile
	* Mono.Data/Mono.Data.dll.sources: added files 
	for build of Mono.Data.dll   
	This assembly includes the ProviderFactory

	* Makefile: added Mono.Data.dll to the build
	* Mono.Data/app.config: added providers	and 
	removed obsolete providers to app settings xml file
	
	* Mono.Data/test/Mono.Data.dll
	* Mono.Data/test/test.exe: remove binaries

svn path=/branches/mono-1-0/mcs/; revision=36336
2004-11-20 00:35:17 +00:00
Paolo Molaro 32f56b9dc1 Fri Nov 19 14:54:07 CET 2004 Paolo Molaro <[email protected]>
* mini-ppc.c: adjust initial prolog size (bug #69691).


svn path=/branches/mono-1-0/mono/; revision=36310
2004-11-19 12:39:14 +00:00
Gonzalo Paniagua Javier ffe2445a8e Backported from HEAD:
2004-11-09 Gonzalo Paniagua Javier <[email protected]>

	* Control.cs: unified a few bool fields into an int one.

	* ControlCollection.cs: use an array internally instead of always
	allocating an arraylist. Also added our own enumerator.
	
	* EmptyControlCollection.cs: there's no 'special' ctor now in the base
	class.


svn path=/branches/mono-1-0/mcs/; revision=36300
2004-11-19 07:51:49 +00:00
Gonzalo Paniagua Javier f6b9f3f2b6 Backported the following fixes from HEAD:
2004-11-19 Gonzalo Paniagua Javier <[email protected]>

	* WebConnection.cs: check for FIN or RST on the socket before reusing.
	Fixes bug #69388.

2004-11-09 Gonzalo Paniagua Javier <[email protected]>

	* ChunkStream.cs: simplified condition for WantMore property.

	* WebConnection.cs: in Connect(), finish any pending reads we might
	have for chunked data. Ignore possible blank lines at the very
	beginning of the server response. Honor user set KeepAlive in
	HttpWebRequest for HTTP/1.1 connections. Thanks to Eyal Alayuf for
	his suggestions and code.


svn path=/branches/mono-1-0/mcs/; revision=36299
2004-11-19 07:17:22 +00:00
Zoltan Varga e897489500 Merge from HEAD.
svn path=/branches/mono-1-0/mono/; revision=36286
2004-11-18 21:09:33 +00:00
Miguel de Icaza caf867582f Update helper errors to use the -pkg syntax when needed, patch from [email protected] (Iain McCoy)
svn path=/branches/mono-1-0/mcs/; revision=36190
2004-11-17 03:44:53 +00:00
110 changed files with 2809 additions and 762 deletions

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
AC_INIT(README)
AC_CANONICAL_SYSTEM
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(mono,1.0.4)
AM_INIT_AUTOMAKE(mono,1.0.5)
AM_MAINTAINER_MODE
AC_PROG_LN_S
+371 -68
View File
@@ -1,9 +1,9 @@
;;; Provided courtesy of http://www.GaryKeith.com
;;; Created on October 24, 2004 at 7:22:55 PM GMT
;;; Created on November 14, 2004 at 7:33:06 PM GMT
[GJK_Browscap_Version]
browser=Browscap Version
version=2004-10-24 19:22:55 GMT
version=2004-11-14 19:33:06 GMT
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Alta Vista
@@ -118,6 +118,35 @@ browser=Exalead
parent=Exalead
browser=NG
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Exava
[Exava]
browser=Exava
frames=True
iframes=False
tables=True
cookies=False
backgroundsounds=False
vbscript=False
javascript=False
javaapplets=False
activexcontrols=False
cdf=False
aol=False
beta=False
win16=False
crawler=True
stripper=False
wap=False
netclr=False
[Mozilla/4.7 *([email protected])]
parent=Exava
browser=Exava
[Mozilla/5.0 (compatible; Exabot/2.0; [email protected])]
parent=Exava
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Excite
[Excite]
@@ -660,10 +689,6 @@ stripper=True
parent=Search Engines
browser=WhizBang
[Mozilla/4.7 *([email protected])]
parent=Search Engines
browser=Exava
[Mozilla/5.0 (compatible; CXL-FatAssANT (El Robeiro); http://www.conexcol.com/FatAssANT/; ANTid:alfa; v. 0.5.1)]
parent=Search Engines
browser=Conexcol.com
@@ -716,6 +741,10 @@ browser=Seekbot
parent=Search Engines
browser=Sensis
[SiteSpider (http://www.SiteSpider.com/)]
parent=Search Engines
browser=SiteSpider
[Speedy?Spider (http://www.entireweb.com)]
parent=Search Engines
browser=entireweb.com
@@ -763,6 +792,10 @@ browser=Wotbox
parent=Search Engines
browser=Yandex
[ZipppBot/0.11 (ZipppBot; http://www.zippp.net; [email protected])]
parent=Search Engines
browser=ZipppBot
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Singing Fish
[Singing Fish]
@@ -944,6 +977,32 @@ browser=AvantGo
[Mozilla/4.0 (fuck off; compatible; not MSIE 6.0; not Windows NT 5.1)]
parent=Banned
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Blogs
[Blogs]
browser=Blogs
frames=False
iframes=False
tables=False
cookies=False
backgroundsounds=False
vbscript=False
javascript=False
javaapplets=False
activexcontrols=False
cdf=False
aol=False
beta=False
win16=False
crawler=True
stripper=True
wap=False
netclr=False
[.Text Version 0.958.2004.2001 - http://scottwater.com/blog (Microsoft Windows NT 5.2.3790.0; .NET CLR 1.1.4322.2032)]
parent=Blogs
browser=Scott Watermasysk
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Browscap.ini Version Checkers
[Browscap.ini Version Checkers]
@@ -979,11 +1038,25 @@ browser=Automated Browscap.ini Updater
parent=Browscap.ini Version Checkers
browser=TKC AutoDownloader
[ecsbot/0.1 (?http://www.e-commerce-services.com/gen/ecsbot.html)]
parent=Browscap.ini Version Checkers
browser=ecsbot
frames=True
iframes=True
tables=True
beta=True
stripper=True
[Mono Browser Capabilities Updater*]
parent=Browscap.ini Version Checkers
browser=Mono Browser Capabilities Updater
stripper=True
[SpiderMan]
parent=Browscap.ini Version Checkers
browser=SpiderMan
stripper=True
[UpdateBrowscap*]
parent=Browscap.ini Version Checkers
browser=UpdateBrowscap
@@ -993,6 +1066,10 @@ parent=Browscap.ini Version Checkers
browser=Woko robot
stripper=True
[www.garykeith.com browscap.ini bot*]
parent=Browscap.ini Version Checkers
browser=clarkson.edu
[www.substancia.com AutoHTTPAgent (ver 1.0)]
parent=Browscap.ini Version Checkers
browser=Substncia
@@ -1000,10 +1077,10 @@ version=1.0
majorver=1
minorver=0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Copyright & Plagiarism
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Copyright/Plagiarism
[Copyright & Plagiarism]
browser=Copyright & Plagiarism
[Copyright/Plagiarism]
browser=Copyright/Plagiarism
frames=False
iframes=False
tables=False
@@ -1023,27 +1100,27 @@ wap=False
netclr=False
[CopyRightCheck*]
parent=Copyright & Plagiarism
parent=Copyright/Plagiarism
browser=CopyRightCheck
[FairAd Client*]
parent=Copyright & Plagiarism
parent=Copyright/Plagiarism
browser=FairAd Client
[IPiumBot laurion(dot)com]
parent=Copyright & Plagiarism
parent=Copyright/Plagiarism
browser=IPiumBot
[oBot]
parent=Copyright & Plagiarism
parent=Copyright/Plagiarism
browser=oBot
[SlySearch/*]
parent=Copyright & Plagiarism
parent=Copyright/Plagiarism
browser=SlySearch
[TurnitinBot/*]
parent=Copyright & Plagiarism
parent=Copyright/Plagiarism
browser=TurnitinBot
[Butch__*]
@@ -1373,6 +1450,10 @@ browser=AaronCarter
parent=General Crawlers
browser=Aport
[Argus/1.1 (Nutch; http://www.simpy.com/bot.html; feedback at simpy dot com)]
parent=General Crawlers
browser=Simpy
[Art-Online.com*]
parent=General Crawlers
browser=Art-Online.com
@@ -1557,6 +1638,15 @@ browser=Oracle Ultra Search
parent=General Crawlers
browser=Wayback Machine
[Pajaczek/*]
parent=General Crawlers
browser=Pajaczek
stripper=True
[Patwebbot (http://www.herz-power.de/technik.html)]
parent=General Crawlers
browser=Patwebbot
[Radiation Retriever*]
parent=General Crawlers
browser=Radiation Retriever
@@ -1615,6 +1705,11 @@ stripper=True
parent=General Crawlers
browser=SyncMgr
[Talkro Web-Shot/1.0 (E-mail: [email protected], Home: http://222.122.15.190/webshot)]
parent=General Crawlers
browser=Talkro Web-Shot
stripper=True
[TheInformant*]
parent=General Crawlers
browser=TheInformant
@@ -2980,6 +3075,10 @@ stripper=True
wap=False
netclr=False
[e-SocietyRobot(http://www.yama.info.waseda.ac.jp/~yamana/es/)]
parent=Research Projects
browser=e-SocietyRobot
[inetbot/* (?http://www.inetbot.com/bot.html)]
parent=Research Projects
browser=inetbot
@@ -3125,7 +3224,7 @@ parent=Site Monitors
browser=Netcraft Webserver Survey
stripper=True
[*WebMon 1.*;]
[*WebMon 1.*]
parent=Site Monitors
browser=WebMon
@@ -3237,6 +3336,10 @@ browser=DeepIndexer
parent=Site Rippers
browser=DISCo Pump
[eStyleSearch 4 (compatible; MSIE 6.0; Windows NT 5.0)]
parent=Site Rippers
browser=eStyleSearch
[fetch libfetch/*]
parent=Site Rippers
@@ -3709,6 +3812,10 @@ browser=Expired Domain Sleuth
parent=Unknown
browser=falcon
[httptalker/0.10 (HTTP client sample)]
parent=Unknown
browser=httptalker
[Iria/1.07*]
parent=Unknown
browser=Iria
@@ -3732,10 +3839,23 @@ browser=Plucker/Py
parent=Unknown
browser=ProPowerBot
[Schmozilla/v9.14 Platinum]
parent=Unknown
[sna-0.0.1 ([email protected])]
parent=Unknown
[sna-0.0.1 [email protected]]
parent=Unknown
[SURF]
parent=Unknown
browser=SURF
[Ultraseek]
parent=Unknown
browser=Ultraseek
[VCIKJZDDLS*]
parent=Unknown
@@ -4196,71 +4316,27 @@ stripper=False
wap=False
netclr=False
[*(Spoofed by Amiga-AWeb/*)]
[Amiga-AWeb/3.*]
parent=AWeb
[Amiga-AWeb/3.0*]
parent=AWeb
version=3.0
version=3
majorver=3
minorver=0
[Amiga-AWeb/3.1*]
[AmigaVoyager/1.*]
parent=AWeb
version=3.1
majorver=3
minorver=1
[Amiga-AWeb/3.2*]
parent=AWeb
version=3.2
majorver=3
minorver=2
[Amiga-AWeb/3.3*]
parent=AWeb
version=3.3
majorver=3
minorver=3
[Amiga-AWeb/3.4*]
parent=AWeb
version=3.4
majorver=3
minorver=4
[Amiga-AWeb/3.9*]
parent=AWeb
version=3.9
majorver=3
minorver=9
javascript=True
[AmigaVoyager/1.0]
parent=AWeb
version=1.0
version=1
majorver=1
minorver=0
[AmigaVoyager/2.95 (AmigaOS/MC680x0)]
[AmigaVoyager/2.*]
parent=AWeb
browser=Amiga Voyager
version=2.95
version=2
majorver=2
minorver=95
[AmigaVoyager/3.* (AmigaOS/MC680x0)]
[AmigaVoyager/3.*]
parent=AWeb
browser=Amiga Voyager
version=3.0
version=3
majorver=3
minorver=0
[Mozilla/4.0 (compatible; MSIE 5.5; Amiga-AWeb/3.4APL)]
parent=AWeb
version=3.4
majorver=3
minorver=4
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Cyberdog
@@ -7168,6 +7244,156 @@ platform=FreeBSD
parent=Opera 7.5
platform=Linux
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Opera 7.6
[Opera 7.6]
browser=Opera
version=7.6
majorver=7
minorver=6
css=2
frames=True
iframes=True
tables=True
cookies=True
backgroundsounds=True
vbscript=False
javascript=True
javaapplets=True
activexcontrols=False
cdf=False
aol=False
beta=True
win16=False
crawler=False
stripper=False
wap=False
netclr=False
[Mozilla/?.* (compatible; MSIE ?.*; Linux*) Opera 7.6*]
parent=Opera 7.6
platform=Linux
[Mozilla/?.* (compatible; MSIE ?.*; Windows 2000) Opera 7.6*]
parent=Opera 7.6
platform=Win2000
[Mozilla/?.* (compatible; MSIE ?.*; Windows 95) Opera 7.6*]
parent=Opera 7.6
platform=Win95
[Mozilla/?.* (compatible; MSIE ?.*; Windows 98) Opera 7.6*]
parent=Opera 7.6
platform=Win98
[Mozilla/?.* (compatible; MSIE ?.*; Windows ME) Opera 7.6*]
parent=Opera 7.6
platform=WinME
[Mozilla/?.* (compatible; MSIE ?.*; Windows NT 4.0) Opera 7.6*]
parent=Opera 7.6
platform=WinNT
[Mozilla/?.* (compatible; MSIE ?.*; Windows NT 5.0) Opera 7.6*]
parent=Opera 7.6
platform=Win2000
[Mozilla/?.* (compatible; MSIE ?.*; Windows NT 5.1) Opera 7.6*]
parent=Opera 7.6
platform=WinXP
[Mozilla/?.* (compatible; MSIE ?.*; Windows NT 5.2) Opera 7.6*]
parent=Opera 7.6
platform=WinNET
[Mozilla/?.* (compatible; MSIE ?.*; Windows XP) Opera 7.6*]
parent=Opera 7.6
platform=WinXP
[Mozilla/?.* (compatible; MSIE ?.*; X11; Linux*) Opera 7.6*]
parent=Opera 7.6
platform=Linux
[Mozilla/?.* (Windows 2000; ?) Opera 7.6*]
parent=Opera 7.6
platform=Win2000
[Mozilla/?.* (Windows 95; ?) Opera 7.6*]
parent=Opera 7.6
platform=Win95
[Mozilla/?.* (Windows 98; ?) Opera 7.6*]
parent=Opera 7.6
platform=Win98
[Mozilla/?.* (Windows ME; ?) Opera 7.6*]
parent=Opera 7.6
platform=WinME
[Mozilla/?.* (Windows NT 4.0; U) Opera 7.6*]
parent=Opera 7.6
platform=WinNT
[Mozilla/?.* (Windows NT 5.0; U) Opera 7.6*]
parent=Opera 7.6
platform=Win2000
[Mozilla/?.* (Windows NT 5.1; ?) Opera 7.6*]
parent=Opera 7.6
platform=WinXP
[Mozilla/?.* (Windows NT 5.2; ?) Opera 7.6*]
parent=Opera 7.6
platform=WinNET
[Opera/7.6* (Linux*; ?)*]
parent=Opera 7.6
platform=Linux
[Opera/7.6* (Macintosh; PPC Mac OS X; ?)*]
parent=Opera 7.6
platform=MacPPC
[Opera/7.6* (Windows 95; ?)*]
parent=Opera 7.6
platform=Win95
[Opera/7.6* (Windows 98; ?)*]
parent=Opera 7.6
platform=Win98
[Opera/7.6* (Windows ME; ?)*]
parent=Opera 7.6
platform=WinME
[Opera/7.6* (Windows NT 4.0; ?)*]
parent=Opera 7.6
platform=WinNT
[Opera/7.6* (Windows NT 5.0; ?)*]
parent=Opera 7.6
platform=Win2000
[Opera/7.6* (Windows NT 5.1; ?)*]
parent=Opera 7.6
platform=WinXP
[Opera/7.6* (Windows NT 5.2; ?)*]
parent=Opera 7.6
platform=WinNET
[Opera/7.6* (Windows XP; ?)*]
parent=Opera 7.6
platform=WinXP
[Opera/7.6* (X11; FreeBSD*; ?)*]
parent=Opera 7.6
platform=FreeBSD
[Opera/7.6* (X11; Linux*; ?)*]
parent=Opera 7.6
platform=Linux
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Netscape 2.0
[Netscape 2.0]
@@ -9493,6 +9719,83 @@ platform=SunOS
[Mozilla/5.0 Gecko/* Firefox/0.9*]
parent=Firefox 0.9
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Firefox 1.0
[Firefox 1.0]
browser=Firefox
version=1.0
majorver=1
minorver=0
css=2
frames=True
iframes=True
tables=True
cookies=True
backgroundsounds=False
vbscript=False
javascript=True
javaapplets=True
activexcontrols=False
cdf=False
aol=False
beta=False
win16=False
crawler=False
stripper=False
wap=False
netclr=False
[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X Mach-O; *rv:*) Gecko/* Firefox/1.0*]
parent=Firefox 1.0
platform=MacOSX
[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *rv:*) Gecko/* Firefox/1.0*]
parent=Firefox 1.0
platform=WinME
[Mozilla/5.0 (Windows; ?; Win95; *rv:*) Gecko/* Firefox/1.0*]
parent=Firefox 1.0
platform=Win95
[Mozilla/5.0 (Windows; ?; Win98; *rv:*) Gecko/* Firefox/1.0*]
parent=Firefox 1.0
platform=Win98
[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *rv:*) Gecko/* Firefox/1.0*]
parent=Firefox 1.0
platform=Win2000
[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *rv:*) Gecko/* Firefox/1.0*]
parent=Firefox 1.0
platform=WinXP
[Mozilla/5.0 (Windows; ?; Windows NT 5.2; *rv:*) Gecko/* Firefox/1.0*]
parent=Firefox 1.0
platform=WinNET
[Mozilla/5.0 (Windows; ?; WinNT4.0; *rv:*) Gecko/* Firefox/1.0*]
parent=Firefox 1.0
platform=WinNT
[Mozilla/5.0 (X11; ?; FreeBSD*; *rv:*) Gecko/* Firefox/1.0*]
parent=Firefox 1.0
platform=FreeBSD
[Mozilla/5.0 (X11; ?; Linux*; *rv:*) Gecko/* Firefox/1.0*]
parent=Firefox 1.0
platform=Linux
[Mozilla/5.0 (X11; ?; Linux*rv:*) Gecko/* Firefox/1.0*]
parent=Firefox 1.0
platform=Linux
[Mozilla/5.0 (X11; ?; SunOS sun4u; *rv:*) Gecko/* Firefox/1.0*]
parent=Firefox 1.0
platform=SunOS
[Mozilla/5.0 Gecko/* Firefox/1.0*]
parent=Firefox 1.0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Galeon 0.1
[Galeon 0.1]
+16
View File
@@ -1,3 +1,19 @@
2004-11-19 Daniel Morgan <[email protected]>
* Mono.Data/.cvsignore
* Mono.Data/AssemblyInfo.cs
* Mono.Data/Makefile
* Mono.Data/Mono.Data.dll.sources: added files
for build of Mono.Data.dll
This assembly includes the ProviderFactory
* Makefile: added Mono.Data.dll to the build
* Mono.Data/app.config: added providers and
removed obsolete providers to app settings xml file
* Mono.Data/test/Mono.Data.dll
* Mono.Data/test/test.exe: remove binaries
2004-06-24 Raja R Harinath <[email protected]>
* IBM.Data.DB2/Makefile: Disable for 'net_2_0'.
+1
View File
@@ -16,6 +16,7 @@ SUBDIRS = \
Mono.Data.Tds \
System.Security \
System.Data \
Mono.Data \
Mono.GetOptions \
System.Web \
System.Web.Services \
+3
View File
@@ -0,0 +1,3 @@
.makefrag
.response
library-deps.stamp
+37
View File
@@ -0,0 +1,37 @@
//
// AssemblyInfo.cs
//
// Author:
// Andreas Nahr ([email protected])
//
// (C) 2003 Ximian, Inc. http://www.ximian.com
// (C) 2004 Novell (http://www.novell.com)
//
using System;
using System.Reflection;
using System.Runtime.InteropServices;
#if (NET_1_0)
[assembly: AssemblyVersion ("1.0.3300.0")]
#elif (NET_2_0)
[assembly: AssemblyVersion ("2.0.3600.0")]
#elif (NET_1_1)
[assembly: AssemblyVersion ("1.0.5000.0")]
#endif
/* TODO COMPLETE INFORMATION
[assembly: AssemblyTitle ("")]
[assembly: AssemblyDescription ("")]
[assembly: CLSCompliant (true)]
[assembly: AssemblyFileVersion ("0.0.0.1")]
[assembly: ComVisible (false)]
*/
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../mono.pub")]
+10
View File
@@ -0,0 +1,10 @@
thisdir = class/Mono.Data
SUBDIRS =
include ../../build/rules.make
LIBRARY = Mono.Data.dll
LIB_MCS_FLAGS = /r:$(corlib) /r:System.dll /r:System.Xml.dll \
/r:System.Data.dll
NO_TEST = yes
include ../../build/library.make
+6
View File
@@ -0,0 +1,6 @@
AssemblyInfo.cs
DataTools.cs
Provider.cs
ProviderCollection.cs
ProviderFactory.cs
ProviderSectionHandler.cs
+34 -15
View File
@@ -6,7 +6,11 @@
</sectionGroup>
</configSections>
<appSettings>
<add key="PubsConnStr" value="factory=System.Data.SqlClient;server=speedy;database=pubs;uid=sa;pwd=" />
<add key="PubsConnStr" value="factory=System.Data.SqlClient;server=speedy;database=pubs;uid=sa;pwd=mypassword" />
<add key="OraConnStr" value="factory=System.Data.OracleClient;data source=testdb;user id=scott;password=tiger" />
<add key="PgConnStr" value="factory=Npgsql;Server=localhost;Database=monotest;User ID=monotest;Password=monotest" />
<add key="MyConnStr" value="factory=ByteFX.Data.MySqlClient;Database=test" />
<add key="FireConnStr" value="factory=FirebirdSql.Data.Firebird;Database=E:\FIREBIRD\EXAMPLES\EMPLOYEE.FDB;User=SYSDBA;Password=masterkey;Dialect=3;Server=localhost" />
</appSettings>
<mono.data>
<providers>
@@ -29,42 +33,57 @@
connection="System.Data.Odbc.OdbcConnection"
adapter="System.Data.Odbc.OdbcDataAdapter"
command="System.Data.Odbc.OdbcCommand"
assembly="odbc"
assembly="System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
description="ODBC" />
<provider
name="Mono.Data.TdsClient"
connection="Mono.Data.TdsClient.TdsConnection"
adapter="Mono.Data.TdsClient.TdsDataAdapter"
command="Mono.Data.TdsClient.TdsCommand"
assembly="Mono.Data.TdsClient"
assembly="Mono.Data.TdsClient, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"
description="TDS Generic" />
<provider name="Mono.Data.MySql"
connection="Mono.Data.MySql.MySqlConnection"
adapter="Mono.Data.MySql.MySqlDataAdapter"
command="Mono.Data.MySql.MySqlCommand"
assembly="Mono.Data.MySql"
<provider
name="ByteFX.Data.MySqlClient"
connection="ByteFX.Data.MySqlClient.MySqlConnection"
adapter="ByteFX.Data.MySqlClient.MySqlDataAdapter"
command="ByteFX.Data.MySqlClient.MySqlCommand"
assembly="ByteFX.Data, Version=0.7.6.1, Culture=neutral, PublicKeyToken=0738eb9f132ed756"
description="MySQL" />
<provider
name="Mono.Data.PostgreSqlClient"
connection="Mono.Data.PostgreSqlClient.PgSqlConnection"
adapter="Mono.Data.PostgreSqlClient.PgSqlDataAdapter"
command="Mono.Data.PostgreSqlClient.PgSqlCommand"
assembly="Mono.Data.PostgreSqlClient"
name="Npgsql"
connection="Npgsql.NpgsqlConnection"
adapter="Npgsql.NpgsqlDataAdapter"
command="Npgsql.NpgsqlCommand"
assembly="Npgsql, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7"
description="PostgreSQL" />
<provider
name="Mono.Data.SqliteClient"
connection="Mono.Data.SqliteClient.SqliteConnection"
adapter="Mono.Data.SqliteClient.SqliteDataAdapter"
command="Mono.Data.SqliteClient.SqliteCommand"
assembly="Mono.Data.SqliteClient"
assembly="Mono.Data.SqliteClient, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"
description="SQL Lite" />
<provider
name="Mono.Data.SybaseClient"
connection="Mono.Data.SybaseClient.SybaseConnection"
adapter="Mono.Data.SybaseClient.SybaseDataAdapter"
command="Mono.Data.SybaseClient.SybaseCommand"
assembly="Mono.Data.SybaseClient"
assembly="Mono.Data.SybaseClient, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"
description="Sybase" />
<provider
name="FirebirdSql.Data.Firebird"
connection="FirebirdSql.Data.Firebird.FbConnection"
adapter="FirebirdSql.Data.Firebird.FbDataAdapter"
command="FirebirdSql.Data.Firebird.FbCommand"
assembly="FirebirdSql.Data.Firebird, Version=1.6.3.0, Culture=neutral, PublicKeyToken=e1b4f92304d7b12f"
description="Firebird" />
<provider
name="IBM.Data.DB2"
connection="IBM.Data.DB2.DB2Connection"
adapter="IBM.Data.DB2.DB2DataAdapter"
command="IBM.Data.DB2.DB2Command"
assembly="IBM.Data.DB2, Version=1.0.1728.9997, Culture=neutral, PublicKeyToken=7c307b91aa13d208"
description="IBM DB2 Universal Database" />
</providers>
</mono.data>
</configuration>
Binary file not shown.
Binary file not shown.
+34 -15
View File
@@ -6,7 +6,11 @@
</sectionGroup>
</configSections>
<appSettings>
<add key="PubsConnStr" value="factory=System.Data.SqlClient;server=speedy;database=pubs;uid=sa;pwd=" />
<add key="PubsConnStr" value="factory=System.Data.SqlClient;server=speedy;database=pubs;uid=sa;pwd=mypassword" />
<add key="OraConnStr" value="factory=System.Data.OracleClient;data source=testdb;user id=scott;password=tiger" />
<add key="PgConnStr" value="factory=Npgsql;Server=localhost;Database=monotest;User ID=monotest;Password=monotest" />
<add key="MyConnStr" value="factory=ByteFX.Data.MySqlClient;Database=test" />
<add key="FireConnStr" value="factory=FirebirdSql.Data.Firebird;Database=E:\FIREBIRD\EXAMPLES\EMPLOYEE.FDB;User=SYSDBA;Password=masterkey;Dialect=3;Server=localhost" />
</appSettings>
<mono.data>
<providers>
@@ -29,42 +33,57 @@
connection="System.Data.Odbc.OdbcConnection"
adapter="System.Data.Odbc.OdbcDataAdapter"
command="System.Data.Odbc.OdbcCommand"
assembly="odbc"
assembly="System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
description="ODBC" />
<provider
name="Mono.Data.TdsClient"
connection="Mono.Data.TdsClient.TdsConnection"
adapter="Mono.Data.TdsClient.TdsDataAdapter"
command="Mono.Data.TdsClient.TdsCommand"
assembly="Mono.Data.TdsClient"
assembly="Mono.Data.TdsClient, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"
description="TDS Generic" />
<provider name="Mono.Data.MySql"
connection="Mono.Data.MySql.MySqlConnection"
adapter="Mono.Data.MySql.MySqlDataAdapter"
command="Mono.Data.MySql.MySqlCommand"
assembly="Mono.Data.MySql"
<provider
name="ByteFX.Data.MySqlClient"
connection="ByteFX.Data.MySqlClient.MySqlConnection"
adapter="ByteFX.Data.MySqlClient.MySqlDataAdapter"
command="ByteFX.Data.MySqlClient.MySqlCommand"
assembly="ByteFX.Data, Version=0.7.6.1, Culture=neutral, PublicKeyToken=0738eb9f132ed756"
description="MySQL" />
<provider
name="Mono.Data.PostgreSqlClient"
connection="Mono.Data.PostgreSqlClient.PgSqlConnection"
adapter="Mono.Data.PostgreSqlClient.PgSqlDataAdapter"
command="Mono.Data.PostgreSqlClient.PgSqlCommand"
assembly="Mono.Data.PostgreSqlClient"
name="Npgsql"
connection="Npgsql.NpgsqlConnection"
adapter="Npgsql.NpgsqlDataAdapter"
command="Npgsql.NpgsqlCommand"
assembly="Npgsql, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7"
description="PostgreSQL" />
<provider
name="Mono.Data.SqliteClient"
connection="Mono.Data.SqliteClient.SqliteConnection"
adapter="Mono.Data.SqliteClient.SqliteDataAdapter"
command="Mono.Data.SqliteClient.SqliteCommand"
assembly="Mono.Data.SqliteClient"
assembly="Mono.Data.SqliteClient, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"
description="SQL Lite" />
<provider
name="Mono.Data.SybaseClient"
connection="Mono.Data.SybaseClient.SybaseConnection"
adapter="Mono.Data.SybaseClient.SybaseDataAdapter"
command="Mono.Data.SybaseClient.SybaseCommand"
assembly="Mono.Data.SybaseClient"
assembly="Mono.Data.SybaseClient, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"
description="Sybase" />
<provider
name="FirebirdSql.Data.Firebird"
connection="FirebirdSql.Data.Firebird.FbConnection"
adapter="FirebirdSql.Data.Firebird.FbDataAdapter"
command="FirebirdSql.Data.Firebird.FbCommand"
assembly="FirebirdSql.Data.Firebird, Version=1.6.3.0, Culture=neutral, PublicKeyToken=e1b4f92304d7b12f"
description="Firebird" />
<provider
name="IBM.Data.DB2"
connection="IBM.Data.DB2.DB2Connection"
adapter="IBM.Data.DB2.DB2DataAdapter"
command="IBM.Data.DB2.DB2Command"
assembly="IBM.Data.DB2, Version=1.0.1728.9997, Culture=neutral, PublicKeyToken=7c307b91aa13d208"
description="IBM DB2 Universal Database" />
</providers>
</mono.data>
</configuration>
@@ -84,7 +84,7 @@ namespace Mono.Math {
/// </code>
/// </para>
/// </remarks>
internal static uint [] smallPrimes = {
internal static readonly uint [] smallPrimes = {
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151,
157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233,
@@ -173,7 +173,9 @@ namespace Mono.Math {
this.length = DEFAULT_LEN;
}
#if !INSIDE_CORLIB
[CLSCompliant (false)]
#endif
public BigInteger (Sign sign, uint len)
{
this.data = new uint [len];
@@ -186,7 +188,9 @@ namespace Mono.Math {
this.length = bi.length;
}
#if !INSIDE_CORLIB
[CLSCompliant (false)]
#endif
public BigInteger (BigInteger bi, uint len)
{
@@ -230,7 +234,9 @@ namespace Mono.Math {
this.Normalize ();
}
#if !INSIDE_CORLIB
[CLSCompliant (false)]
#endif
public BigInteger (uint [] inData)
{
length = (uint)inData.Length;
@@ -243,13 +249,17 @@ namespace Mono.Math {
this.Normalize ();
}
#if !INSIDE_CORLIB
[CLSCompliant (false)]
#endif
public BigInteger (uint ui)
{
data = new uint [] {ui};
}
#if !INSIDE_CORLIB
[CLSCompliant (false)]
#endif
public BigInteger (ulong ul)
{
data = new uint [2] { (uint)ul, (uint)(ul >> 32)};
@@ -258,7 +268,9 @@ namespace Mono.Math {
this.Normalize ();
}
#if !INSIDE_CORLIB
[CLSCompliant (false)]
#endif
public static implicit operator BigInteger (uint value)
{
return (new BigInteger (value));
@@ -270,7 +282,9 @@ namespace Mono.Math {
return (new BigInteger ((uint)value));
}
#if !INSIDE_CORLIB
[CLSCompliant (false)]
#endif
public static implicit operator BigInteger (ulong value)
{
return (new BigInteger (value));
@@ -366,7 +380,9 @@ namespace Mono.Math {
return -(int)Kernel.DwordMod (bi, (uint)-i);
}
#if !INSIDE_CORLIB
[CLSCompliant (false)]
#endif
public static uint operator % (BigInteger bi, uint ui)
{
return Kernel.DwordMod (bi, (uint)ui);
@@ -448,7 +464,9 @@ namespace Mono.Math {
return (bi % i);
}
#if !INSIDE_CORLIB
[CLSCompliant (false)]
#endif
public static uint Modulus (BigInteger bi, uint ui)
{
return (bi % ui);
@@ -604,7 +622,9 @@ namespace Mono.Math {
/// </summary>
/// <param name="bitNum">The bit to test. The least significant bit is 0.</param>
/// <returns>True if bitNum is set to 1, else false.</returns>
#if !INSIDE_CORLIB
[CLSCompliant (false)]
#endif
public bool TestBit (uint bitNum)
{
uint bytePos = bitNum >> 5; // divide by 32
@@ -625,19 +645,25 @@ namespace Mono.Math {
return ((this.data [bytePos] | mask) == this.data [bytePos]);
}
#if !INSIDE_CORLIB
[CLSCompliant (false)]
#endif
public void SetBit (uint bitNum)
{
SetBit (bitNum, true);
}
#if !INSIDE_CORLIB
[CLSCompliant (false)]
#endif
public void ClearBit (uint bitNum)
{
SetBit (bitNum, false);
}
#if !INSIDE_CORLIB
[CLSCompliant (false)]
#endif
public void SetBit (uint bitNum, bool value)
{
uint bytePos = bitNum >> 5; // divide by 32
@@ -690,14 +716,18 @@ namespace Mono.Math {
#region Compare
#if !INSIDE_CORLIB
[CLSCompliant (false)]
#endif
public static bool operator == (BigInteger bi1, uint ui)
{
if (bi1.length != 1) bi1.Normalize ();
return bi1.length == 1 && bi1.data [0] == ui;
}
#if !INSIDE_CORLIB
[CLSCompliant (false)]
#endif
public static bool operator != (BigInteger bi1, uint ui)
{
if (bi1.length != 1) bi1.Normalize ();
@@ -753,13 +783,17 @@ namespace Mono.Math {
#region Formatting
#if !INSIDE_CORLIB
[CLSCompliant (false)]
#endif
public string ToString (uint radix)
{
return ToString (radix, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ");
}
#if !INSIDE_CORLIB
[CLSCompliant (false)]
#endif
public string ToString (uint radix, string characterSet)
{
if (characterSet.Length < radix)
@@ -986,7 +1020,7 @@ namespace Mono.Math {
r2.Normalize ();
if (r2 < x) {
if (r2 <= x) {
Kernel.MinusEq (x, r2);
} else {
BigInteger val = new BigInteger (Sign.Positive, kPlusOne + 1);
@@ -1124,7 +1158,9 @@ namespace Mono.Math {
// TODO: Make tests for this, not really needed b/c prime stuff
// checks it, but still would be nice
[CLSCompliant (false)]
#if !INSIDE_CORLIB
[CLSCompliant (false)]
#endif
public BigInteger Pow (uint b, BigInteger exp)
{
// if (b != 2) {
@@ -1141,7 +1177,6 @@ namespace Mono.Math {
}*/
}
[CLSCompliant (false)]
private unsafe BigInteger OddPow (uint b, BigInteger exp)
{
exp.Normalize ();
@@ -1496,7 +1531,6 @@ namespace Mono.Math {
{
}
[CLSCompliant (false)]
public static uint Inverse (uint n)
{
uint y = n, z;
@@ -1516,7 +1550,6 @@ namespace Mono.Math {
return n;
}
[CLSCompliant (false)]
public static unsafe BigInteger Reduce (BigInteger n, BigInteger m, uint mPrime)
{
BigInteger A = n;
@@ -1,3 +1,8 @@
2004-12-03 Sebastien Pouliot <[email protected]>
* BigInteger.cs: Fix issue #70169 in ModPow when modulus is a power of
two. Also sync other changes with HEAD (mostly removing warnings).
2004-10-25 Sebastien Pouliot <[email protected]>
* BigInteger.cs: Fix issue #68452 when Randomize was being called on a
@@ -1,3 +1,14 @@
2004-12-06 Sebastien Pouliot <[email protected]>
* RSAManaged.cs: Implement key blinding for RSA decryption with, or
without, using CRT.
2004-11-23 Sebastien Pouliot <[email protected]>
* PKCS1.cs: Merge from HEAD. Fix PKCS#1 v1.5 decryption when the
ciphertext isn't exactly the same of the public key and some level 4
compiler warnings.
2004-11-10 Sebastien Pouliot <[email protected]>
* RC4.cs: Fixed RC4 for compatibility with .NET 2.0. The algorithm is
@@ -2,11 +2,10 @@
// PKCS1.cs - Implements PKCS#1 primitives.
//
// Author:
// Sebastien Pouliot (spouliot@motus.com)
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -107,7 +106,9 @@ namespace Mono.Security.Cryptography {
public static byte[] OS2IP (byte[] x)
{
int i = 0;
while ((x [i++] == 0x00) && (i < x.Length));
while ((x [i++] == 0x00) && (i < x.Length)) {
// confuse compiler into reporting a warning with {}
}
i--;
if (i > 0) {
byte[] result = new byte [x.Length - i];
@@ -252,8 +253,8 @@ namespace Mono.Security.Cryptography {
// RSAES-PKCS1-V1_5-DECRYPT (K, C)
public static byte[] Decrypt_v15 (RSA rsa, byte[] C)
{
int size = rsa.KeySize / 8;
if ((size < 11) || (C.Length != size))
int size = rsa.KeySize >> 3; // div by 8
if ((size < 11) || (C.Length > size))
throw new CryptographicException ("decryption error");
byte[] c = OS2IP (C);
byte[] m = RSADP (rsa, c);
@@ -7,15 +7,11 @@
//
// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
// Portions (C) 2003 Ben Maurer
// (C) 2004 Novell (http://www.novell.com)
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Key generation translated from Bouncy Castle JCE (http://www.bouncycastle.org/)
// See bouncycastle.txt for license.
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
@@ -38,6 +34,7 @@
using System;
using System.Security.Cryptography;
using System.Text;
using Mono.Math;
@@ -61,6 +58,7 @@ namespace Mono.Security.Cryptography {
private const int defaultKeySize = 1024;
private bool isCRTpossible = false;
private bool keyBlinding = true;
private bool keypairGenerated = false;
private bool m_disposed = false;
@@ -79,9 +77,9 @@ namespace Mono.Security.Cryptography {
public RSAManaged (int keySize)
{
KeySizeValue = keySize;
LegalKeySizesValue = new KeySizes [1];
LegalKeySizesValue [0] = new KeySizes (384, 16384, 8);
base.KeySize = keySize;
}
~RSAManaged ()
@@ -164,7 +162,7 @@ namespace Mono.Security.Cryptography {
}
// note: this property will exist in RSACryptoServiceProvider in
// version 1.2 of the framework
// version 2.0 of the framework
public bool PublicOnly {
get { return ((d == null) || (n == null)); }
}
@@ -183,6 +181,16 @@ namespace Mono.Security.Cryptography {
GenerateKeyPair ();
BigInteger input = new BigInteger (rgb);
BigInteger r = null;
// we use key blinding (by default) against timing attacks
if (keyBlinding) {
// x = (r^e * g) mod n
// *new* random number (so it's timing is also random)
r = BigInteger.GenerateRandom (n.BitCount ());
input = r.ModPow (e, n) * input % n;
}
BigInteger output;
// decrypt (which uses the private key) can be
// optimized by using CRT (Chinese Remainder Theorem)
@@ -196,20 +204,26 @@ namespace Mono.Security.Cryptography {
// thanks to benm!
h = p - ((m2 - m1) * qInv % p);
output = m2 + q * h;
}
else {
} else {
// h = (m1 - m2) * qInv mod p
h = (m1 - m2) * qInv % p;
// m = m2 + q * h;
output = m2 + q * h;
}
}
else {
} else {
// m = c^d mod n
output = input.ModPow (d, n);
}
if (keyBlinding) {
// Complete blinding
// x^e / r mod n
output = output * r.ModInverse (n) % n;
r.Clear ();
}
byte[] result = output.GetBytes ();
// zeroize value
// zeroize values
input.Clear ();
output.Clear ();
return result;
@@ -245,7 +259,7 @@ namespace Mono.Security.Cryptography {
param.Modulus = n.GetBytes ();
if (includePrivateParameters) {
// some parameters are required for exporting the private key
if ((d == null) || (p == null) || (q == null))
if (d == null)
throw new CryptographicException ("Missing private key");
param.D = d.GetBytes ();
// hack for bugzilla #57941 where D wasn't provided
@@ -254,11 +268,11 @@ namespace Mono.Security.Cryptography {
Buffer.BlockCopy (param.D, 0, normalizedD, (normalizedD.Length - param.D.Length), param.D.Length);
param.D = normalizedD;
}
param.P = p.GetBytes ();
param.Q = q.GetBytes ();
// but CRT parameters are optionals
if ((dp != null) && (dq != null) && (qInv != null)) {
if ((p != null) && (q != null) && (dp != null) && (dq != null) && (qInv != null)) {
// and we include them only if we have them all
param.P = p.GetBytes ();
param.Q = q.GetBytes ();
param.DP = dp.GetBytes ();
param.DQ = dq.GetBytes ();
param.InverseQ = qInv.GetBytes ();
@@ -348,5 +362,98 @@ namespace Mono.Security.Cryptography {
public delegate void KeyGeneratedEventHandler (object sender, EventArgs e);
public event KeyGeneratedEventHandler KeyGenerated;
public override string ToXmlString (bool includePrivateParameters)
{
StringBuilder sb = new StringBuilder ();
RSAParameters rsaParams = ExportParameters (includePrivateParameters);
try {
sb.Append ("<RSAKeyValue>");
sb.Append ("<Modulus>");
sb.Append (Convert.ToBase64String (rsaParams.Modulus));
sb.Append ("</Modulus>");
sb.Append ("<Exponent>");
sb.Append (Convert.ToBase64String (rsaParams.Exponent));
sb.Append ("</Exponent>");
if (includePrivateParameters) {
if (rsaParams.P != null) {
sb.Append ("<P>");
sb.Append (Convert.ToBase64String (rsaParams.P));
sb.Append ("</P>");
}
if (rsaParams.Q != null) {
sb.Append ("<Q>");
sb.Append (Convert.ToBase64String (rsaParams.Q));
sb.Append ("</Q>");
}
if (rsaParams.DP != null) {
sb.Append ("<DP>");
sb.Append (Convert.ToBase64String (rsaParams.DP));
sb.Append ("</DP>");
}
if (rsaParams.DQ != null) {
sb.Append ("<DQ>");
sb.Append (Convert.ToBase64String (rsaParams.DQ));
sb.Append ("</DQ>");
}
if (rsaParams.InverseQ != null) {
sb.Append ("<InverseQ>");
sb.Append (Convert.ToBase64String (rsaParams.InverseQ));
sb.Append ("</InverseQ>");
}
sb.Append ("<D>");
sb.Append (Convert.ToBase64String (rsaParams.D));
sb.Append ("</D>");
}
sb.Append ("</RSAKeyValue>");
}
catch {
if (rsaParams.P != null)
Array.Clear (rsaParams.P, 0, rsaParams.P.Length);
if (rsaParams.Q != null)
Array.Clear (rsaParams.Q, 0, rsaParams.Q.Length);
if (rsaParams.DP != null)
Array.Clear (rsaParams.DP, 0, rsaParams.DP.Length);
if (rsaParams.DQ != null)
Array.Clear (rsaParams.DQ, 0, rsaParams.DQ.Length);
if (rsaParams.InverseQ != null)
Array.Clear (rsaParams.InverseQ, 0, rsaParams.InverseQ.Length);
if (rsaParams.D != null)
Array.Clear (rsaParams.D, 0, rsaParams.D.Length);
throw;
}
return sb.ToString ();
}
// internal for Mono 1.0.x in order to preserve public contract
// they are public for Mono 1.1.x (for 1.2) as the API isn't froze ATM
#if NET_2_0
public
#else
internal
#endif
bool UseKeyBlinding {
get { return keyBlinding; }
// you REALLY shoudn't touch this (true is fine ;-)
set { keyBlinding = value; }
}
#if NET_2_0
public
#else
internal
#endif
bool IsCrtPossible {
// either the key pair isn't generated (and will be
// generated with CRT parameters) or CRT is (or isn't)
// possible (in case the key was imported)
get { return (!keypairGenerated || isCRTpossible); }
}
}
}
@@ -1,3 +1,7 @@
2004-11-23 Sebastien Pouliot <[email protected]>
* RecordProtocol.cs: Fixed ClientHelloV2 support.
2004-11-10 Sebastien Pouliot <[email protected]>
* CipherSuiteFactory.cs, Context.cs, RecordProtocol.cs: Merge from
@@ -88,6 +88,9 @@ namespace Mono.Security.Protocol.Tls
return null;
}
// Set last handshake message received to None
this.context.LastHandshakeMsg = HandshakeType.ClientHello;
ContentType contentType = (ContentType)type;
byte[] buffer = this.ReadRecordBuffer(type);
@@ -107,9 +110,6 @@ namespace Mono.Security.Protocol.Tls
}
}
// Set last handshake message received to None
this.context.LastHandshakeMsg = HandshakeType.None;
// Process record
byte[] result = message.ToArray();
@@ -540,9 +540,9 @@ namespace Mono.Security.Protocol.Tls
if (check == 0)
{
// SSL/TLS cipher spec
int index = 0;
short code = codes.ReadInt16();
if ((index = this.Context.SupportedCiphers.IndexOf(code)) != -1)
short code = codes.ReadInt16();
int index = this.Context.SupportedCiphers.IndexOf(code);
if (index != -1)
{
this.Context.Cipher = this.Context.SupportedCiphers[index];
break;
@@ -1,3 +1,7 @@
2004-12-06 Miguel de Icaza <[email protected]>
* FontFamily.cs: Families is static.
2004-11-03 Miguel de Icaza <[email protected]>
* TextureBrush.cs (Clone): While cloning, it is not enough to let
@@ -301,7 +301,7 @@ namespace System.Drawing {
}
public FontFamily[] Families
public static FontFamily[] Families
{
get {
@@ -1,3 +1,8 @@
2004-12-03 Gonzalo Paniagua Javier <[email protected]>
* SoapHttpClientProtocol.cs: dispose the StreamReader that wraps the
response stream.
2004-09-15 Lluis Sanchez Gual <[email protected]>
* Methods.cs: Use the service namespace as the base for the soap action.
@@ -263,13 +263,16 @@ namespace System.Web.Services.Protocols {
// Deserialize the response
StreamReader reader = new StreamReader (stream, encoding, false);
XmlTextReader xml_reader = new XmlTextReader (reader);
SoapHeaderCollection headers;
object content;
WebServiceHelper.ReadSoapMessage (xml_reader, type_info, msi.Use, msi.ResponseSerializer, out content, out headers);
using (StreamReader reader = new StreamReader (stream, encoding, false)) {
XmlTextReader xml_reader = new XmlTextReader (reader);
WebServiceHelper.ReadSoapMessage (xml_reader, type_info, msi.Use, msi.ResponseSerializer,
out content, out headers);
}
if (content is Fault)
{
+7 -3
View File
@@ -1,6 +1,10 @@
2004-06-08 Alon Gazit <along@mainsoft.com>
* System.Web.dll.sources: added ServerVariablesCollection.
2004-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* System.Web.dll.sources: added ReusableMemoryStream.
2004-06-08 Alon Gazit <[email protected]>
* System.Web.dll.sources: added ServerVariablesCollection.
2004-06-08 Gonzalo Paniagua Javier <[email protected]>
@@ -1,3 +1,13 @@
2004-11-28 Gonzalo Paniagua Javier <[email protected]>
* HandlerItem.cs: for reusable items, return the same instance always.
Fixes bug #69959.
2004-11-24 Gonzalo Paniagua Javier <[email protected]>
* GlobalizationConfigurationHandler.cs: fixed stupid typo (uiculture ->
uiCulture). Closes bug #69524.
2004-10-10 Gonzalo Paniagua Javier <[email protected]>
* WebConfigurationSettings.cs: use CurrentExecutionFilePath instead of
@@ -69,9 +69,9 @@ namespace System.Web.Configuration
if (attvalue != null)
config.Culture = GetCulture (section, "culture", attvalue);
attvalue = AttValue ("uiculture", section, true);
attvalue = AttValue ("uiCulture", section, true);
if (attvalue != null)
config.UICulture = GetCulture (section, "uiculture", attvalue);
config.UICulture = GetCulture (section, "uiCulture", attvalue);
if (section.Attributes == null || section.Attributes.Count != 0)
ThrowException ("Unknown attribute(s).", section);
@@ -32,6 +32,7 @@ using System;
using System.Collections;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
namespace System.Web.Configuration
{
@@ -44,6 +45,8 @@ namespace System.Web.Configuration
private Regex requestRegex;
private Regex pathRegex;
static Hashtable regexCache;
object instance;
bool validated;
public HandlerItem (string requestType, string path, string type, bool validate)
{
@@ -56,19 +59,25 @@ namespace System.Web.Configuration
DoValidation ();
}
public object Create ()
public object GetInstance ()
{
if (_type == null)
DoValidation ();
object obj = Interlocked.CompareExchange (ref instance, null, null);
if (obj != null)
return obj;
return HttpRuntime.CreateInternalObject (_type);
DoValidation ();
obj = HttpRuntime.CreateInternalObject (_type);
IHttpHandler hnd = obj as IHttpHandler;
if (hnd != null && hnd.IsReusable)
Interlocked.CompareExchange (ref instance, hnd, null);
return obj;
}
public Type Type
{
get {
if (_type == null)
DoValidation ();
DoValidation ();
return _type;
}
}
@@ -97,7 +106,15 @@ namespace System.Web.Configuration
void DoValidation ()
{
_type = Type.GetType (_typeName, true);
if (validated)
return;
lock (this) {
Type t = Type.GetType (_typeName, true);
_type = t;
validated = true;
}
if (typeof (IHttpHandler).IsAssignableFrom (_type))
return;
@@ -1,3 +1,8 @@
2004-11-30 Gonzalo Paniagua Javier <[email protected]>
* SessionStateModule.cs: set the path modifier when using cookie-less
sessions.
2004-10-06 Gonzalo Paniagua Javier <[email protected]>
* SessionStateModule.cs: use SetCurrentExePath instead of SetFilePath.
@@ -112,6 +112,7 @@ namespace System.Web.SessionState
context.Request.SetCurrentExePath (UrlUtils.RemoveSessionId (base_path,
context.Request.FilePath));
context.Request.SetHeader (HeaderName, id);
context.Response.SetAppPathModifier (String.Format ("({0})", id));
}
void OnReleaseRequestState (object o, EventArgs args)
@@ -1,3 +1,8 @@
2004-11-29 Gonzalo Paniagua Javier <[email protected]>
* HtmlForm.cs: fixed the Action property when running a different
page than the one requested (Transfer). Closes bug #69318.
2004-06-23 Gonzalo Paniagua Javier <[email protected]>
* HtmlForm.cs: disabled smartnavigation as we have no scripts to support
@@ -9,6 +9,7 @@ using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.Util;
namespace System.Web.UI.HtmlControls{
@@ -87,19 +88,18 @@ namespace System.Web.UI.HtmlControls{
Page.RegisterViewStateHandler();
}
internal string Action{
internal string Action {
get{
string executionFilePath = Context.Request.CurrentExecutionFilePath;
string filePath = Context.Request.FilePath;
string attr;
if (String.ReferenceEquals(executionFilePath, filePath) == true){
if (executionFilePath == filePath) {
attr = filePath;
int lastSlash = attr.LastIndexOf('/');
if (lastSlash >= 0)
attr = attr.Substring(lastSlash + 1);
}
else{
attr = System.Web.Util.UrlUtils.MakeRelative(filePath,executionFilePath);
} else {
attr = UrlUtils.MakeRelative (executionFilePath, UrlUtils.GetDirectory (filePath));
}
string queryString = Context.Request.QueryStringRaw;
if (queryString != null && queryString.Length > 0)
@@ -1,3 +1,24 @@
2004-11-30 Gonzalo Paniagua Javier <[email protected]>
* Control.cs: when saving "Visible" into the ViewState, save the value
for this precise control, as using the Visible property might give us
Control's parent visibility. Fixes bug #69200.
2004-11-30 Gonzalo Paniagua Javier <[email protected]>
* Control.cs: fixed ResolveUrl for relative URLs when using cookie-less
sessions.
2004-11-09 Gonzalo Paniagua Javier <[email protected]>
* Control.cs: unified a few bool fields into an int one.
* ControlCollection.cs: use an array internally instead of always
allocating an arraylist. Also added our own enumerator.
* EmptyControlCollection.cs: there's no 'special' ctor now in the base
class.
2004-10-29 Gonzalo Paniagua Javier <[email protected]>
* ControlBuilder.cs: from HEAD.
+256 -221
View File
@@ -44,65 +44,81 @@ namespace System.Web.UI
[DefaultProperty ("ID"), DesignerCategory ("Code"), ToolboxItemFilter ("System.Web.UI", ToolboxItemFilterType.Require)]
[ToolboxItem ("System.Web.UI.Design.WebControlToolboxItem, " + Consts.AssemblySystem_Design)]
[Designer ("System.Web.UI.Design.ControlDesigner, " + Consts.AssemblySystem_Design, typeof (IDesigner))]
[DesignerSerializer ("Microsoft.VSDesigner.WebForms.ControlCodeDomSerializer, " + Consts.AssemblyMicrosoft_VSDesigner, "System.ComponentModel.Design.Serialization.CodeDomSerializer, " + Consts.AssemblySystem_Design)]
[DesignerSerializer ("Microsoft.VSDesigner.WebForms.ControlCodeDomSerializer, " + Consts.AssemblyMicrosoft_VSDesigner,
"System.ComponentModel.Design.Serialization.CodeDomSerializer, " + Consts.AssemblySystem_Design)]
public class Control : IComponent, IDisposable, IParserAccessor, IDataBindingsAccessor
{
private static readonly object DataBindingEvent = new object();
private static readonly object DisposedEvent = new object();
private static readonly object InitEvent = new object();
private static readonly object LoadEvent = new object();
private static readonly object PreRenderEvent = new object();
private static readonly object UnloadEvent = new object();
private string uniqueID;
private string _userId;
private bool id_set;
private ControlCollection _controls;
private bool _enableViewState = true;
private IDictionary _childViewStates;
private bool _isNamingContainer;
private Control _namingContainer;
private Page _page;
private Control _parent;
private ISite _site;
private bool _visible = true;
private bool visibleChanged;
private HttpContext _context;
private bool _childControlsCreated;
private StateBag _viewState;
private bool _trackViewState;
private EventHandlerList _events;
private RenderMethod _renderMethodDelegate;
private bool autoID = true;
private bool creatingControls;
private bool bindingContainer = true;
private bool autoEventWireup = true;
static readonly object DataBindingEvent = new object();
static readonly object DisposedEvent = new object();
static readonly object InitEvent = new object();
static readonly object LoadEvent = new object();
static readonly object PreRenderEvent = new object();
static readonly object UnloadEvent = new object();
static string[] defaultNameArray;
bool inited, initing;
bool viewStateLoaded;
bool loaded;
bool prerendered;
string uniqueID;
string _userId;
ControlCollection _controls;
IDictionary _childViewStates;
Control _namingContainer;
Page _page;
Control _parent;
ISite _site;
HttpContext _context;
StateBag _viewState;
EventHandlerList _events;
RenderMethod _renderMethodDelegate;
int defaultNumberID;
DataBindingCollection dataBindings;
Hashtable pendingVS; // may hold unused viewstate data from child controls
public Control()
{
if (this is INamingContainer) _isNamingContainer = true;
}
/*************/
int stateMask;
const int ENABLE_VIEWSTATE = 1;
const int VISIBLE = 1 << 1;
const int AUTOID = 1 << 2;
const int CREATING_CONTROLS = 1 << 3;
const int BINDING_CONTAINER = 1 << 4;
const int AUTO_EVENT_WIREUP = 1 << 5;
const int IS_NAMING_CONTAINER = 1 << 6;
const int VISIBLE_CHANGED = 1 << 7;
const int TRACK_VIEWSTATE = 1 << 8;
const int CHILD_CONTROLS_CREATED = 1 << 9;
const int ID_SET = 1 << 10;
const int INITED = 1 << 11;
const int INITING = 1 << 12;
const int VIEWSTATE_LOADED = 1 << 13;
const int LOADED = 1 << 14;
const int PRERENDERED = 1 << 15;
/*************/
static Control ()
{
defaultNameArray = new string [100];
for (int i = 0 ; i < 100 ; i++)
defaultNameArray [i] = "_ctrl" + i;
}
public Control()
{
stateMask = ENABLE_VIEWSTATE | VISIBLE | AUTOID | BINDING_CONTAINER | AUTO_EVENT_WIREUP;
if (this is INamingContainer)
stateMask |= IS_NAMING_CONTAINER;
}
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
[EditorBrowsable (EditorBrowsableState.Never), Browsable (false)]
public Control BindingContainer
{
get {
Control container = NamingContainer;
if (!container.bindingContainer)
container = container.BindingContainer;
return container;
}
}
public Control BindingContainer {
get {
Control container = NamingContainer;
if ((container.stateMask & BINDING_CONTAINER) == 0)
container = container.BindingContainer;
return container;
}
}
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
[Browsable (false)]
[WebSysDescription ("An Identification of the control that is rendered.")]
@@ -129,32 +145,25 @@ namespace System.Web.UI
}
}
[DefaultValue (true), WebCategory ("FIXME")]
[DefaultValue (true), WebCategory ("Behavior")]
[WebSysDescription ("An Identification of the control that is rendered.")]
public virtual bool EnableViewState //DIT
{
get
{
return _enableViewState;
}
set
{
_enableViewState = value;
}
}
public virtual bool EnableViewState {
get { return ((stateMask & ENABLE_VIEWSTATE) != 0); }
set { SetMask (ENABLE_VIEWSTATE, value); }
}
[MergableProperty (false), ParenthesizePropertyName (true)]
[WebSysDescription ("The name of the control that is rendered.")]
public virtual string ID {
get {
return (id_set ? _userId : null);
return (((stateMask & ID_SET) != 0) ? _userId : null);
}
set {
if (value == "")
value = null;
id_set = true;
stateMask |= ID_SET;
_userId = value;
NullifyUniqueID ();
}
@@ -163,25 +172,23 @@ namespace System.Web.UI
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
[Browsable (false)]
[WebSysDescription ("The container that this control is part of. The control's name has to be unique within the container.")]
public virtual Control NamingContainer //DIT
{
get
{
if (_namingContainer == null && _parent != null)
{
if (_parent._isNamingContainer == false)
_namingContainer = _parent.NamingContainer;
else
_namingContainer = _parent;
}
return _namingContainer;
public virtual Control NamingContainer {
get {
if (_namingContainer == null && _parent != null) {
if ((_parent.stateMask & IS_NAMING_CONTAINER) == 0)
_namingContainer = _parent.NamingContainer;
else
_namingContainer = _parent;
}
return _namingContainer;
}
}
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
[Browsable (false)]
[WebSysDescription ("The webpage that this control resides on.")]
public virtual Page Page //DIT
public virtual Page Page //DIT
{
get
{
@@ -222,10 +229,10 @@ namespace System.Web.UI
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
[Browsable (false)]
[WebSysDescription ("A virtual directory containing the parent of the control.")]
public virtual string TemplateSourceDirectory {
get { return (_parent == null) ? String.Empty : _parent.TemplateSourceDirectory; }
}
[WebSysDescription ("A virtual directory containing the parent of the control.")]
public virtual string TemplateSourceDirectory {
get { return (_parent == null) ? String.Empty : _parent.TemplateSourceDirectory; }
}
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
[Browsable (false)]
@@ -253,11 +260,19 @@ namespace System.Web.UI
}
}
[DefaultValue (true), Bindable (true), WebCategory ("FIXME")]
void SetMask (int m, bool val)
{
if (val)
stateMask |= m;
else
stateMask &= ~m;
}
[DefaultValue (true), Bindable (true), WebCategory ("Behavior")]
[WebSysDescription ("Visiblity state of the control.")]
public virtual bool Visible {
get {
if (_visible == false)
if ((stateMask & VISIBLE) == 0)
return false;
if (_parent != null)
@@ -267,28 +282,25 @@ namespace System.Web.UI
}
set {
if (value != _visible) {
if ((value && (stateMask & VISIBLE) == 0) ||
(!value && (stateMask & VISIBLE) != 0)) {
if (IsTrackingViewState)
visibleChanged = true;
stateMask |= VISIBLE_CHANGED;
}
_visible = value;
SetMask (VISIBLE, value);
}
}
protected bool ChildControlsCreated //DIT
{
get
{
return _childControlsCreated;
}
set
{
if (value == false && _childControlsCreated == true)
_controls.Clear();
_childControlsCreated = value;
}
}
protected bool ChildControlsCreated {
get { return ((stateMask & CHILD_CONTROLS_CREATED) != 0); }
set {
if (value == false && (stateMask & CHILD_CONTROLS_CREATED) != 0)
Controls.Clear();
SetMask (CHILD_CONTROLS_CREATED, value);
}
}
[Browsable (false)]
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
@@ -326,13 +338,10 @@ namespace System.Web.UI
return true;
}
}
protected bool IsTrackingViewState //DIT
{
get
{
return _trackViewState;
}
}
protected bool IsTrackingViewState {
get { return ((stateMask & TRACK_VIEWSTATE) != 0); }
}
[Browsable (false)]
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
@@ -360,36 +369,42 @@ namespace System.Web.UI
}
}
internal bool AutoEventWireup {
get { return autoEventWireup; }
set { autoEventWireup = value; }
}
internal void SetBindingContainer (bool isBC)
{
bindingContainer = isBC;
}
internal bool AutoEventWireup {
get { return (stateMask & AUTO_EVENT_WIREUP) != 0; }
set { SetMask (AUTO_EVENT_WIREUP, value); }
}
internal void SetBindingContainer (bool isBC)
{
SetMask (BINDING_CONTAINER, isBC);
}
internal void ResetChildNames ()
{
defaultNumberID = 0;
}
string GetDefaultName ()
{
return "_ctrl" + defaultNumberID++;
}
string GetDefaultName ()
{
string defaultName;
if (defaultNumberID > 99) {
defaultName = "_ctrl" + defaultNumberID++;
} else {
defaultName = defaultNameArray [defaultNumberID++];
}
return defaultName;
}
void NullifyUniqueID ()
{
uniqueID = null;
if (_controls == null)
if (!HasControls ())
return;
foreach (Control c in _controls)
c.NullifyUniqueID ();
}
foreach (Control c in Controls)
c.NullifyUniqueID ();
}
protected internal virtual void AddedControl (Control control, int index)
{
/* Ensure the control don't have more than 1 parent */
@@ -398,7 +413,7 @@ namespace System.Web.UI
control._parent = this;
control._page = _page;
Control nc = _isNamingContainer ? this : NamingContainer;
Control nc = ((stateMask & IS_NAMING_CONTAINER) != 0) ? this : NamingContainer;
if (nc != null) {
control._namingContainer = nc;
@@ -406,10 +421,10 @@ namespace System.Web.UI
control._userId = nc.GetDefaultName () + "a";
}
if (initing || inited)
if ((stateMask & (INITING | INITED)) != 0)
control.InitRecursive (nc);
if (viewStateLoaded || loaded) {
if ((stateMask & (VIEWSTATE_LOADED | LOADED)) != 0) {
if (pendingVS != null) {
object vs = pendingVS [index];
if (vs != null) {
@@ -422,10 +437,10 @@ namespace System.Web.UI
}
}
if (loaded)
if ((stateMask & LOADED) != 0)
control.LoadRecursive ();
if (prerendered)
if ((stateMask & PRERENDERED) != 0)
control.PreRenderRecursiveInternal ();
}
@@ -455,25 +470,24 @@ namespace System.Web.UI
return new ControlCollection(this);
}
protected virtual void EnsureChildControls () //DIT
{
if (ChildControlsCreated == false && !creatingControls) {
creatingControls = true;
CreateChildControls();
ChildControlsCreated = true;
creatingControls = false;
}
protected virtual void EnsureChildControls ()
{
if (ChildControlsCreated == false && (stateMask & CREATING_CONTROLS) == 0) {
stateMask |= CREATING_CONTROLS;
CreateChildControls();
ChildControlsCreated = true;
stateMask &= ~CREATING_CONTROLS;
}
}
protected bool IsLiteralContent()
{
if (_controls != null)
if (_controls.Count == 1)
if (_controls[0] is LiteralControl)
return true;
if (HasControls () && Controls.Count == 1 && (Controls [0] is LiteralControl))
return true;
return false;
}
}
public virtual Control FindControl (string id)
{
return FindControl (id, 0);
@@ -481,14 +495,14 @@ namespace System.Web.UI
Control LookForControlByName (string id)
{
if (!HasChildren)
return null;
if (!HasControls ())
return null;
foreach (Control c in _controls) {
foreach (Control c in Controls) {
if (String.Compare (id, c._userId, true) == 0)
return c;
if (!c._isNamingContainer && c.HasChildren) {
if ((c.stateMask & IS_NAMING_CONTAINER) == 0 && c.HasControls ()) {
Control child = c.LookForControlByName (id);
if (child != null)
return child;
@@ -502,7 +516,7 @@ namespace System.Web.UI
{
EnsureChildControls ();
Control namingContainer = null;
if (!_isNamingContainer) {
if ((stateMask & IS_NAMING_CONTAINER) == 0) {
namingContainer = NamingContainer;
if (namingContainer == null)
return null;
@@ -531,8 +545,8 @@ namespace System.Web.UI
ViewState.LoadViewState (savedState);
object o = ViewState ["Visible"];
if (o != null) {
_visible = (bool) o;
visibleChanged = true;
SetMask (VISIBLE, (bool) o);
stateMask |= VISIBLE_CHANGED;
}
}
}
@@ -603,20 +617,24 @@ namespace System.Web.UI
{
RenderChildren(writer);
}
protected virtual void RenderChildren(HtmlTextWriter writer) //DIT
{
if (_renderMethodDelegate != null)
_renderMethodDelegate(writer, this);
else if (_controls != null)
foreach (Control c in _controls)
c.RenderControl(writer);
}
protected virtual void RenderChildren (HtmlTextWriter writer) //DIT
{
if (_renderMethodDelegate != null) {
_renderMethodDelegate (writer, this);
} else if (HasControls ()) {
int len = Controls.Count;
for (int i = 0; i < len; i++) {
Control c = Controls [i];
c.RenderControl (writer);
}
}
}
protected virtual object SaveViewState ()
{
if (visibleChanged) {
ViewState ["Visible"] = Visible;
if ((stateMask & VISIBLE_CHANGED) != 0) {
ViewState ["Visible"] = (stateMask & VISIBLE) != 0;
} else if (_viewState == null) {
return null;
}
@@ -628,7 +646,8 @@ namespace System.Web.UI
{
if (_viewState != null)
_viewState.TrackViewState ();
_trackViewState = true;
stateMask |= TRACK_VIEWSTATE;
}
public virtual void Dispose()
@@ -640,11 +659,6 @@ namespace System.Web.UI
eh(this, EventArgs.Empty);
}
}
internal bool HasChildren
{
get { return (_controls != null && _controls.Count > 0); }
}
[WebCategory ("FIXME")]
[WebSysDescription ("Raised when the contols databound properties are evaluated.")]
@@ -730,7 +744,7 @@ namespace System.Web.UI
#if NET_2_0
bool foundDataItem = false;
if (_isNamingContainer && Page != null) {
if ((stateMask & IS_NAMING_CONTAINER) != 0 && Page != null) {
object o = DataBinder.GetDataItem (this, out foundDataItem);
if (foundDataItem)
Page.PushDataItemContext (o);
@@ -756,11 +770,14 @@ namespace System.Web.UI
void DataBindChildren ()
{
if (_controls == null)
if (!HasControls ())
return;
foreach (Control c in _controls)
c.DataBind();
int len = Controls.Count;
for (int i = 0; i < len; i++) {
Control c = Controls [i];
c.DataBind ();
}
}
@@ -771,7 +788,7 @@ namespace System.Web.UI
public void RenderControl(HtmlTextWriter writer)
{
if (_visible)
if ((stateMask & VISIBLE) != 0)
Render(writer);
}
@@ -790,9 +807,6 @@ namespace System.Web.UI
if (ts == "" || !UrlUtils.IsRelativeUrl (relativeUrl))
return relativeUrl;
if (relativeUrl.IndexOf ('/') == -1 && relativeUrl [0] != '.' && relativeUrl != "..")
return relativeUrl;
HttpResponse resp = Context.Response;
return resp.ApplyAppPathModifier (UrlUtils.Combine (ts, relativeUrl));
}
@@ -806,18 +820,26 @@ namespace System.Web.UI
internal void LoadRecursive()
{
OnLoad (EventArgs.Empty);
if (_controls != null) {
foreach (Control c in _controls)
if (HasControls ()) {
int len = Controls.Count;
for (int i=0;i<len;i++)
{
Control c = Controls[i];
c.LoadRecursive ();
}
}
loaded = true;
stateMask |= LOADED;
}
internal void UnloadRecursive(Boolean dispose)
{
if (_controls != null) {
foreach (Control c in _controls)
if (HasControls ()) {
int len = Controls.Count;
for (int i=0;i<len;i++)
{
Control c = Controls[i];
c.UnloadRecursive (dispose);
}
}
OnUnload (EventArgs.Empty);
@@ -827,44 +849,50 @@ namespace System.Web.UI
internal void PreRenderRecursiveInternal()
{
if (_visible) {
if ((stateMask & VISIBLE) != 0) {
EnsureChildControls ();
OnPreRender (EventArgs.Empty);
if (_controls == null)
if (!HasControls ())
return;
foreach (Control c in _controls)
int len = Controls.Count;
for (int i=0;i<len;i++)
{
Control c = Controls[i];
c.PreRenderRecursiveInternal ();
}
}
prerendered = true;
stateMask |= PRERENDERED;
}
internal void InitRecursive(Control namingContainer)
{
if (_controls != null) {
if (_isNamingContainer)
if (HasControls ()) {
if ((stateMask & IS_NAMING_CONTAINER) != 0)
namingContainer = this;
if (namingContainer != null &&
namingContainer._userId == null &&
namingContainer.autoID)
namingContainer.AutoID)
namingContainer._userId = namingContainer.GetDefaultName () + "b";
foreach (Control c in _controls) {
int len = Controls.Count;
for (int i=0;i<len;i++)
{
Control c = Controls[i];
c._page = Page;
c._namingContainer = namingContainer;
if (namingContainer != null && c._userId == null && c.autoID)
if (namingContainer != null && c._userId == null && c.AutoID)
c._userId = namingContainer.GetDefaultName () + "c";
c.InitRecursive (namingContainer);
}
c.InitRecursive (namingContainer);
}
}
initing = true;
stateMask |= INITING;
OnInit (EventArgs.Empty);
TrackViewState ();
inited = true;
initing = false;
stateMask |= INITED;
stateMask &= ~INITING;
}
internal object SaveViewStateRecursive ()
@@ -876,19 +904,26 @@ namespace System.Web.UI
ArrayList controlStates = null;
int idx = -1;
foreach (Control ctrl in Controls) {
object ctrlState = ctrl.SaveViewStateRecursive ();
idx++;
if (ctrlState == null)
continue;
if (HasControls ())
{
int len = Controls.Count;
for (int i=0;i<len;i++)
{
Control ctrl = Controls[i];
object ctrlState = ctrl.SaveViewStateRecursive ();
idx++;
if (ctrlState == null)
continue;
if (controlList == null) {
controlList = new ArrayList ();
controlStates = new ArrayList ();
if (controlList == null)
{
controlList = new ArrayList ();
controlStates = new ArrayList ();
}
controlList.Add (idx);
controlStates.Add (ctrlState);
}
controlList.Add (idx);
controlStates.Add (ctrlState);
}
object thisState = SaveViewState ();
@@ -924,7 +959,7 @@ namespace System.Web.UI
}
}
viewStateLoaded = true;
stateMask |= VIEWSTATE_LOADED;
}
void IParserAccessor.AddParsedSubObject(object obj)
@@ -949,18 +984,18 @@ namespace System.Web.UI
return (dataBindings!=null && dataBindings.Count>0);
}
}
internal bool AutoID
{
get { return autoID; }
set {
if (value == false && _isNamingContainer)
return;
autoID = value;
}
}
internal bool AutoID
{
get { return (stateMask & AUTOID) != 0; }
set {
if (value == false && (stateMask & IS_NAMING_CONTAINER) != 0)
return;
SetMask (AUTOID, value);
}
}
internal void PreventAutoID()
{
AutoID = false;
@@ -1,9 +1,11 @@
//
// System.Web.UI.ControlCollection.cs
//
// Duncan Mak ([email protected])
// Authors:
// Duncan Mak ([email protected])
// Gonzalo Paniagua Javier ([email protected])
//
// (C) Ximian, Inc.
// Copyright (c) 2002-2004 Novell, Inc. (http://www.novell.com)
//
//
@@ -34,41 +36,39 @@ namespace System.Web.UI {
public class ControlCollection : ICollection, IEnumerable
{
ArrayList list;
Control owner;
Control [] controls;
int version;
int count;
bool readOnly;
public ControlCollection (Control owner)
{
if (owner == null)
throw new ArgumentException ();
throw new ArgumentException ("owner");
list = new ArrayList ();
this.owner = owner;
}
internal ControlCollection (Control owner, bool shortList)
{
if (owner == null)
throw new ArgumentException ();
list = new ArrayList (shortList ? 1 : 0);
this.owner = owner;
}
public int Count {
get { return list.Count; }
get { return count; }
}
public bool IsReadOnly {
get { return list.IsReadOnly; }
get { return readOnly; }
}
public bool IsSynchronized {
get { return list.IsSynchronized; }
get { return false; }
}
public virtual Control this [int index] {
get { return list [index] as Control; }
get {
if (index < 0 || index >= count)
throw new ArgumentOutOfRangeException ("index");
return controls [index];
}
}
protected Control Owner {
@@ -76,18 +76,33 @@ namespace System.Web.UI {
}
public object SyncRoot {
get { return list.SyncRoot; }
get { return this; }
}
void EnsureControls ()
{
if (controls == null) {
controls = new Control [5];
} else if (controls.Length < count + 1) {
int n = controls.Length == 5 ? 4 : 2;
Control [] newControls = new Control [controls.Length * n];
Array.Copy (controls, 0, newControls, 0, controls.Length);
controls = newControls;
}
}
public virtual void Add (Control child)
{
if (child == null)
throw new ArgumentNullException ();
if (IsReadOnly)
if (readOnly)
throw new HttpException ();
list.Add (child);
owner.AddedControl (child, list.Count - 1);
EnsureControls ();
version++;
controls [count++] = child;
owner.AddedControl (child, count - 1);
}
public virtual void AddAt (int index, Control child)
@@ -95,64 +110,131 @@ namespace System.Web.UI {
if (child == null) // maybe we should check for ! (child is Control)?
throw new ArgumentNullException ();
if ((index < -1) || (index > Count))
if (index < -1 || index > count)
throw new ArgumentOutOfRangeException ();
if (IsReadOnly)
if (readOnly)
throw new HttpException ();
if (index == -1){
if (index == -1) {
Add (child);
} else {
list.Insert (index, child);
owner.AddedControl (child, index);
return;
}
EnsureControls ();
version++;
Array.Copy (controls, index, controls, index + 1, count - index);
count++;
controls [index] = child;
owner.AddedControl (child, index);
}
public virtual void Clear ()
{
foreach (Control ctrl in list)
owner.RemovedControl (ctrl);
if (controls == null)
return;
list.Clear ();
version++;
for (int i = 0; i < count; i++)
owner.RemovedControl (controls [i]);
count = 0;
if (owner != null)
owner.ResetChildNames ();
}
public virtual bool Contains (Control c)
{
return list.Contains (c);
return (controls != null && Array.IndexOf (controls, c) != -1);
}
public void CopyTo (Array array, int index)
{
list.CopyTo (array, index);
if (controls == null)
return;
controls.CopyTo (array, index);
}
public IEnumerator GetEnumerator ()
{
return list.GetEnumerator ();
return new SimpleEnumerator (this);
}
public virtual int IndexOf (Control c)
{
return list.IndexOf (c);
if (controls == null)
return -1;
return Array.IndexOf (controls, c);
}
public virtual void Remove (Control value)
{
list.Remove (value);
owner.RemovedControl (value);
int idx = IndexOf (value);
if (idx == -1)
return;
RemoveAt (idx);
}
public virtual void RemoveAt (int index)
{
if (IsReadOnly)
if (readOnly)
throw new HttpException ();
Control value = (Control) list [index];
list.RemoveAt (index);
owner.RemovedControl (value);
version++;
Control ctrl = controls [index];
Array.Copy (controls, index + 1, controls, index, count - index);
count--;
owner.RemovedControl (ctrl);
}
// Almost the same as in ArrayList
sealed class SimpleEnumerator : IEnumerator
{
ControlCollection coll;
int index;
int version;
object currentElement;
public SimpleEnumerator (ControlCollection coll)
{
this.coll = coll;
index = -1;
version = coll.version;
}
public bool MoveNext ()
{
if (version != coll.version)
throw new InvalidOperationException ("List has changed.");
if (index >= -1 && ++index < coll.Count) {
currentElement = coll [index];
return true;
} else {
index = -2;
return false;
}
}
public object Current {
get {
if (index < 0)
throw new InvalidOperationException (index == -1 ? "Enumerator not started" : "Enumerator ended");
return currentElement;
}
}
public void Reset ()
{
if (version != coll.version)
throw new InvalidOperationException ("List has changed.");
index = -1;
}
}
}
}
@@ -34,7 +34,7 @@ namespace System.Web.UI {
public class EmptyControlCollection : ControlCollection
{
public EmptyControlCollection (Control owner)
: base (owner, true)
: base (owner)
{
}
@@ -1,3 +1,8 @@
2004-11-30 Gonzalo Paniagua Javier <[email protected]>
* UrlUtils.cs: made (Insert|Get|Remove)SessionId use the appRoot +
SessionID + vpath format.
2004-07-20 Gonzalo Paniagua Javier <[email protected]>
* UrlUtils.cs: don't pass double slash when the path begins with a
@@ -333,32 +333,61 @@ namespace System.Web.Util
return url;
}
// appRoot + SessionID + vpath
public static string InsertSessionId (string id, string path)
{
string dir = GetDirectory (path);
if (!dir.EndsWith ("/"))
dir += "/";
return Reduce (dir + "(" + id + ")/" + GetFile (path));
string appvpath = HttpRuntime.AppDomainAppVirtualPath;
if (!appvpath.EndsWith ("/"))
appvpath += "/";
if (path.StartsWith (appvpath))
path = path.Substring (appvpath.Length);
if (path [0] == '/')
path = path.Length > 1 ? path.Substring (1) : "";
return Reduce (appvpath + "(" + id + ")/" + path);
}
public static string GetSessionId (string path)
{
int len = path.Length;
if ((len < SessionId.IdLength + 2) || (path [len - 1] != ')') ||
(path [len - SessionId.IdLength - 2] != '('))
string appvpath = HttpRuntime.AppDomainAppVirtualPath;
if (path.Length <= appvpath.Length)
return null;
return path.Substring (len - SessionId.IdLength - 1, SessionId.IdLength);
path = path.Substring (appvpath.Length);
if (path.Length == 0 || path [0] != '/')
path = '/' + path;
int len = path.Length;
if ((len < SessionId.IdLength + 3) || (path [1] != '(') ||
(path [SessionId.IdLength + 2] != ')'))
return null;
return path.Substring (2, SessionId.IdLength);
}
public static string RemoveSessionId (string base_path, string file_path)
{
int len = base_path.Length;
string dir = base_path.Substring (0, len - SessionId.IdLength - 2);
// Caller did a GetSessionId first
int idx = base_path.IndexOf ("/(");
string dir = base_path.Substring (0, idx + 1);
if (!dir.EndsWith ("/"))
dir += "/";
idx = base_path.IndexOf (")/");
if (idx != -1 && base_path.Length > idx + 2) {
string dir2 = base_path.Substring (idx + 2);
if (!dir2.EndsWith ("/"))
dir2 += "/";
dir += dir2;
}
return Reduce (dir + GetFile (file_path));
}
@@ -54,6 +54,7 @@ System.Web/ProcessModelInfo.cs
System.Web/ProcessShutdownReason.cs
System.Web/ProcessStatus.cs
System.Web/QueueManager.cs
System.Web/ReusableMemoryStream.cs
System.Web/ServerVariablesCollection.cs
System.Web/StaticFileHandler.cs
System.Web/TODOAttribute.cs
+17
View File
@@ -1,3 +1,20 @@
2004-11-30 Gonzalo Paniagua Javier <[email protected]>
* HttpResponse.cs: fixed ApplyAppPathModifier to insert the session ID.
2004-11-29 Gonzalo Paniagua Javier <[email protected]>
* ReusableMemoryStream.cs: copied from System.IO.MemoryStream and
slightly modified to allow expanding the buffer for cases on which the
regular MemoryStream don't allow it.
* HttpWriter.cs: use the new ReusableMemoryStream and fix bug #59841.
Otherwise we would have to allocate a new MemoryStream...
2004-11-28 Gonzalo Paniagua Javier <[email protected]>
* HttpApplication.cs: Create() is now GetInstance().
2004-11-12 Gonzalo Paniagua Javier <[email protected]>
* HttpResponse.cs: added internl SetHeadersSent.
@@ -787,7 +787,7 @@ namespace System.Web
if (handler == null)
throw new HttpException ("Cannot get system.web/httpHandlers handler.");
object result = handler.FindHandler (type, file).Create ();
object result = handler.FindHandler (type, file).GetInstance ();
if (result is IHttpHandler)
return (IHttpHandler) result;
@@ -356,8 +356,15 @@ namespace System.Web
virtualPath = UrlUtils.Reduce (virtualPath);
}
if (app_path_mod != null && virtualPath.IndexOf (app_path_mod) > 0)
virtualPath = UrlUtils.Combine (app_path_mod, virtualPath);
if (app_path_mod != null && virtualPath.IndexOf (app_path_mod) < 0) {
string rvd = _Context.Request.RootVirtualDir;
string basevd = rvd.Replace (app_path_mod, "");
if (!virtualPath.StartsWith (basevd))
return virtualPath;
virtualPath = UrlUtils.Combine (rvd, virtualPath.Substring (basevd.Length));
}
return virtualPath;
}
@@ -40,7 +40,7 @@ namespace System.Web
HttpResponseStream _ResponseStream;
MemoryStream _OutputStream;
ReusableMemoryStream _OutputStream;
StreamWriter _OutputHelper;
Encoding _Encoding;
@@ -52,7 +52,7 @@ namespace System.Web
_Response = Response;
_Encoding = _Response.ContentEncoding;
_OutputStream = new MemoryStream (MaxBufferSize);
_OutputStream = new ReusableMemoryStream (MaxBufferSize);
_OutputHelper = new StreamWriter (_OutputStream, _Response.ContentEncoding);
_ResponseStream = new HttpResponseStream (this);
}
@@ -116,9 +116,9 @@ namespace System.Web
internal void Clear ()
{
// This clears all the buffers that are around
_OutputHelper.Flush ();
_OutputStream.SetLength (0);
_OutputHelper.Close ();
_OutputStream = new ReusableMemoryStream (_OutputStream.GetBuffer ());
_OutputHelper = new StreamWriter (_OutputStream, _Response.ContentEncoding);
}
internal void SendContent (HttpWorkerRequest Handler)
@@ -0,0 +1,277 @@
//
// System.Web.ReusableMemoryStream
// Trimmed down copy of System.IO.MemoryStream used by HttpWriter.
//
// Authors: Marcin Szczepanski ([email protected])
// Patrik Torstensson
// Gonzalo Paniagua Javier ([email protected])
//
// (c) 2001,2002 Marcin Szczepanski, Patrik Torstensson
// (c) 2003 Ximian, Inc. (http://www.ximian.com)
// Copyright (C) 2004 Novell (http://www.novell.com)
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.IO;
using System.Runtime.InteropServices;
namespace System.Web
{
[Serializable]
class ReusableMemoryStream : Stream
{
int capacity;
int length;
byte [] internalBuffer;
bool streamClosed;
int position;
public ReusableMemoryStream (int capacity)
{
if (capacity < 0)
throw new ArgumentOutOfRangeException ("capacity");
this.capacity = capacity;
internalBuffer = new byte [capacity];
}
public ReusableMemoryStream (byte [] buffer)
{
if (buffer == null)
throw new ArgumentNullException ("buffer");
capacity = buffer.Length;
internalBuffer = buffer;
}
void CheckIfClosedThrowDisposed ()
{
if (streamClosed)
throw new ObjectDisposedException (GetType ().ToString ());
}
public override bool CanRead {
get { return !streamClosed; }
}
public override bool CanSeek {
get { return !streamClosed; }
}
public override bool CanWrite {
get { return !streamClosed; }
}
int Capacity {
get {
CheckIfClosedThrowDisposed ();
return capacity;
}
set {
CheckIfClosedThrowDisposed ();
if (value == capacity)
return; // LAMENESS: see MemoryStreamTest.ConstructorFive
if (value < 0 || value < length)
throw new ArgumentOutOfRangeException ("value",
"New capacity cannot be negative or less than the current capacity " + value + " " + capacity);
byte [] newBuffer = null;
if (value != 0) {
newBuffer = new byte [value];
Buffer.BlockCopy (internalBuffer, 0, newBuffer, 0, length);
}
internalBuffer = newBuffer; // It's null when capacity is set to 0
capacity = value;
}
}
public override long Length {
get {
CheckIfClosedThrowDisposed ();
return length;
}
}
public override long Position {
get {
CheckIfClosedThrowDisposed ();
return position;
}
set {
CheckIfClosedThrowDisposed ();
if (value < 0)
throw new ArgumentOutOfRangeException ("value",
"Position cannot be negative" );
if (value > Int32.MaxValue)
throw new ArgumentOutOfRangeException ("value",
"Position must be non-negative and less than 2^31 - 1 - origin");
position = (int) value;
}
}
public override void Close ()
{
streamClosed = true;
}
public override void Flush ()
{
}
public byte [] GetBuffer ()
{
return internalBuffer;
}
public override int Read ([In,Out] byte [] buffer, int offset, int count)
{
CheckIfClosedThrowDisposed ();
if (buffer == null)
throw new ArgumentNullException ("buffer");
if (position >= length || count == 0)
return 0;
if (position > length - count)
count = length - position;
Buffer.BlockCopy (internalBuffer, position, buffer, offset, count);
position += count;
return count;
}
public override int ReadByte ()
{
CheckIfClosedThrowDisposed ();
if (position >= length)
return -1;
return internalBuffer [position++];
}
public override long Seek (long offset, SeekOrigin loc)
{
CheckIfClosedThrowDisposed ();
if (offset > (long) Int32.MaxValue)
throw new ArgumentOutOfRangeException ("Offset out of range. " + offset);
int refPoint;
switch (loc) {
case SeekOrigin.Begin:
if (offset < 0)
throw new IOException ("Attempted to seek before start of MemoryStream.");
refPoint = 0;
break;
case SeekOrigin.Current:
refPoint = position;
break;
case SeekOrigin.End:
refPoint = length;
break;
default:
throw new ArgumentException ("loc", "Invalid SeekOrigin");
}
refPoint += (int) offset;
if (refPoint < 0)
throw new IOException ("Attempted to seek before start of MemoryStream.");
position = refPoint;
return position;
}
int CalculateNewCapacity (int minimum)
{
if (minimum < 256)
minimum = 256;
if (minimum < capacity * 2)
minimum = capacity * 2;
return minimum;
}
public override void SetLength (long value)
{
CheckIfClosedThrowDisposed ();
if (value < 0 || value > (long) Int32.MaxValue)
throw new ArgumentOutOfRangeException ();
int newSize = (int) value;
if (newSize > capacity)
Capacity = CalculateNewCapacity (newSize);
else if (newSize < length)
Array.Clear (internalBuffer, newSize, length - newSize);
length = newSize;
if (position > length)
position = length;
}
public override void Write (byte [] buffer, int offset, int count)
{
CheckIfClosedThrowDisposed ();
if (buffer == null)
throw new ArgumentNullException ("buffer");
if (offset < 0 || count < 0)
throw new ArgumentOutOfRangeException ();
if (buffer.Length - offset < count)
throw new ArgumentException ("offset+count",
"The size of the buffer is less than offset + count.");
// reordered to avoid possible integer overflow
if (position > capacity - count)
Capacity = CalculateNewCapacity (position + count);
Buffer.BlockCopy (buffer, offset, internalBuffer, position, count);
position += count;
if (position >= length)
length = position;
}
public override void WriteByte (byte value)
{
CheckIfClosedThrowDisposed ();
if (position >= capacity)
Capacity = CalculateNewCapacity (position + 1);
if (position >= length)
length = position + 1;
internalBuffer [position++] = value;
}
}
}
@@ -1,3 +1,8 @@
2004-11-28 Atsushi Enomoto <[email protected]>
* XslVariable.cs : Local param might be overriden by XsltArgumentList.
(plus some extraneous field cleanup.)
2004-06-18 Atsushi Enomoto <[email protected]>
* XslNumber.cs : Globalization. Removed unused code.
@@ -1,3 +1,8 @@
2004-11-30 Atsushi Enomoto <[email protected]>
* DTDReader.cs : Consideration on parameter entity was missing for
attribute default value. Fixed bug #70008.
2004-11-14 Atsushi Enomoto <[email protected]>
* XmlWriter.cs : after WriteAttributes(), argument XmlReader must
@@ -1584,6 +1584,8 @@ namespace System.Xml
{
ClearValueBuffer ();
TryExpandPERef ();
int quoteChar = ReadChar ();
if (quoteChar != '\'' && quoteChar != '\"')
@@ -1,3 +1,7 @@
2004-12-06 Gonzalo Paniagua Javier <[email protected]>
* Process.cs: always pass the same arguments to the runtime.
2004-09-07 Dick Porter <[email protected]>
* Process.cs: Throw documented exceptions when getting stdin,
@@ -796,11 +796,7 @@ namespace System.Diagnostics {
cmdline = startInfo.FileName + " " + startInfo.Arguments.Trim ();
} else {
appname = startInfo.FileName;
// FIXME: There seems something wrong in process.c. We should not require extraneous command line
if (Path.DirectorySeparatorChar == '\\')
cmdline = appname + " " + startInfo.Arguments.Trim ();
else
cmdline = startInfo.Arguments.Trim ();
cmdline = startInfo.Arguments.Trim ();
}
ret=Start_internal(appname,
+10
View File
@@ -1,3 +1,13 @@
2004-11-29 Gonzalo Paniagua Javier <[email protected]>
* DefaultWatcher.cs: make it work when the FileMask does not have
wildcards and we're watching a directory.
2004-11-22 Ben Maurer <[email protected]>
* DefaultWatcher.cs: Copy the hashtable when we scan for changes
so that you can make modifications in a handler. Fixes 65966.
2004-10-07 Gonzalo Paniagua Javier <[email protected]>
* DefaultWatcher.cs: if the file is removed between reading the
+19 -25
View File
@@ -132,34 +132,28 @@ namespace System.IO {
int zeroes = 0;
while (true) {
Thread.Sleep (750);
Hashtable my_watches;
lock (watches) {
if (watches.Count > 0) {
zeroes = 0;
ArrayList removed = null;
foreach (DefaultWatcherData data in watches.Values) {
bool remove = UpdateDataAndDispatch (data, true);
if (remove) {
if (removed == null)
removed = new ArrayList ();
removed.Add (data);
}
}
if (removed != null) {
foreach (DefaultWatcherData data in removed)
watches.Remove (data.FSW);
removed.Clear ();
removed = null;
}
} else {
zeroes++;
if (zeroes == 20)
if (watches.Count == 0) {
if (++zeroes == 20)
break;
continue;
}
my_watches = (Hashtable) watches.Clone ();
}
if (watches.Count != 0) {
zeroes = 0;
foreach (DefaultWatcherData data in my_watches.Values) {
bool remove = UpdateDataAndDispatch (data, true);
if (remove)
lock (watches)
watches.Remove (data.FSW);
}
}
Thread.Sleep (750);
}
lock (this) {
@@ -207,7 +201,7 @@ namespace System.IO {
files = Directory.GetFileSystemEntries (directory, data.FileMask);
} else {
// The pattern does not have wildcards
if (File.Exists (data.FileMask))
if (File.Exists (data.FileMask) || Directory.Exists (data.FileMask))
files = new string [] { data.FileMask };
else
files = NoStringsArray;
@@ -1,3 +1,8 @@
2004-12-03 Gonzalo Paniagua Javier <[email protected]>
* NetworkStream.cs: Write should ensure that writes all the contents
of the buffer. Fixes bug #70123. Besos para Miguelito.
2004-10-14 Dick Porter <[email protected]>
* Socket.cs (Sockets ): Set Accept()ed socket blocking status to
@@ -163,8 +163,8 @@ namespace System.Net.Sockets
try {
retval = socket.BeginReceive (buffer, offset, size, 0, callback, state);
} catch {
throw new IOException ("BeginReceive failure");
} catch (Exception e) {
throw new IOException ("BeginReceive failure", e);
}
return retval;
@@ -310,7 +310,10 @@ namespace System.Net.Sockets
throw new ArgumentOutOfRangeException("offset+size exceeds the size of buffer");
try {
socket.Send (buffer, offset, size, 0);
int count = 0;
while (size - count > 0) {
count += socket.Send (buffer, offset + count, size - count, 0);
}
} catch (Exception e) {
throw new IOException ("Write failure", e);
}
+52
View File
@@ -1,3 +1,55 @@
2004-12-05 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: set the event in Close so that if the queue is
empty, we won't block forever on next request. The finalizer was
removed because we're not implementing IDisposable pattern here.
2004-12-04 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: handle errors on chunked streams. Fixes bug #66858.
* ChunkStream.cs: added error checking all over.
* HttpWebRequest.cs: throw the exception received in SetResponseError
if we already have a response.
(SetRequestData): Don't nest the exception if it's a WebException.
2004-12-03 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: remove prevStream and don't set busy to false in
HandleError. prevStream is not needed any more and setting 'busy' so
early might let a request skip the queue.
* WebConnectionGroup.cs: decrement the indexer when removing a dead
reference from the arraylist.
* WebConnectionStream.cs:
(ReadAll): call NextRead if it has not been called before even when
we have completed the request. Reuse the read buffer when reading a
response of unknown size. Increase the buffer to 8kB.
(BeginRead): increase pendingReads earlier and even when reading from
the internal buffer.
(EndRead): decrease pendingReads later and always.
2004-12-01 Gonzalo Paniagua Javier <[email protected]>
* CookieCollection.cs: reformatted, fixed Add by adding a new method to
search across the arraylist, as list.IndexOf is not what we want.
2004-11-19 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: check for FIN or RST on the socket before reusing.
Fixes bug #69388.
2004-11-09 Gonzalo Paniagua Javier <[email protected]>
* ChunkStream.cs: simplified condition for WantMore property.
* WebConnection.cs: in Connect(), finish any pending reads we might
have for chunked data. Ignore possible blank lines at the very
beginning of the server response. Honor user set KeepAlive in
HttpWebRequest for HTTP/1.1 connections. Thanks to Eyal Alayuf for
his suggestions and code.
2004-11-01 Gonzalo Paniagua Javier <[email protected]>
* HttpWebResponse.cs: don't lock up when the cookie received ends with
+39 -9
View File
@@ -90,7 +90,8 @@ namespace System.Net
public void WriteAndReadBack (byte [] buffer, int offset, int size, ref int read)
{
Write (buffer, offset, offset+read);
if (offset + read > 0)
Write (buffer, offset, offset+read);
read = Read (buffer, offset, size);
}
@@ -167,7 +168,7 @@ namespace System.Net
}
public bool WantMore {
get { return (chunkRead != chunkSize || chunkSize != 0 || (chunkSize == 0 && state != State.None)); }
get { return (chunkRead != chunkSize || chunkSize != 0 || state != State.None); }
}
public int ChunkLeft {
@@ -199,7 +200,7 @@ namespace System.Net
c = (char) buffer [offset++];
if (c == '\r') {
if (sawCR)
throw new ProtocolViolationException ("2 CR found");
ThrowProtocolViolation ("2 CR found");
sawCR = true;
continue;
@@ -213,13 +214,32 @@ namespace System.Net
if (!gotit)
saved.Append (c);
if (saved.Length > 20)
ThrowProtocolViolation ("chunk size too long.");
}
if (!sawCR || c != '\n')
if (!sawCR || c != '\n') {
if (offset < size)
ThrowProtocolViolation ("Missing \\n");
try {
if (saved.Length > 0)
chunkSize = Int32.Parse (saved.ToString (), NumberStyles.HexNumber);
} catch (Exception) {
ThrowProtocolViolation ("Cannot parse chunk size.");
}
return State.None;
}
chunkRead = 0;
chunkSize = Int32.Parse (saved.ToString (), NumberStyles.HexNumber);
try {
chunkSize = Int32.Parse (saved.ToString (), NumberStyles.HexNumber);
} catch (Exception) {
ThrowProtocolViolation ("Cannot parse chunk size.");
}
if (chunkSize == 0)
return State.Trailer;
@@ -230,15 +250,15 @@ namespace System.Net
{
if (!sawCR) {
if ((char) buffer [offset++] != '\r')
throw new ProtocolViolationException ("Expecting \\r");
ThrowProtocolViolation ("Expecting \\r");
sawCR = true;
if (offset == size)
return State.BodyFinished;
}
if ((char) buffer [offset++] != '\n')
throw new ProtocolViolationException ("Expecting \\n");
if (sawCR && (char) buffer [offset++] != '\n')
ThrowProtocolViolation ("Expecting \\n");
return State.None;
}
@@ -277,8 +297,12 @@ namespace System.Net
}
}
if (st < 4)
if (st < 4) {
if (offset < size)
ThrowProtocolViolation ("Error reading trailer.");
return State.Trailer;
}
StringReader reader = new StringReader (saved.ToString ());
string line;
@@ -287,6 +311,12 @@ namespace System.Net
return State.None;
}
static void ThrowProtocolViolation (string message)
{
WebException we = new WebException (message, null, WebExceptionStatus.ServerProtocolViolation, null);
throw we;
}
}
}
+121 -110
View File
@@ -1,9 +1,12 @@
//
// System.Net.CookieCollection
//
// Author:
// Lawrence Pit ([email protected])
//
//
// System.Net.CookieCollection
//
// Authors:
// Lawrence Pit ([email protected])
// Gonzalo Paniagua Javier ([email protected])
//
// (c) Copyright 2004 Novell, Inc. (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
@@ -25,107 +28,115 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections;
using System.Runtime.Serialization;
namespace System.Net
{
[Serializable]
public class CookieCollection : ICollection, IEnumerable
{
private ArrayList list = new ArrayList ();
// ctor
public CookieCollection ()
{
}
// ICollection
public int Count {
get { return list.Count; }
}
public bool IsSynchronized {
get { return false; }
}
public Object SyncRoot {
get { return this; }
}
public void CopyTo (Array array, int arrayIndex)
{
list.CopyTo (array, arrayIndex);
}
// IEnumerable
public IEnumerator GetEnumerator ()
{
return list.GetEnumerator ();
}
// This
// LAMESPEC: So how is one supposed to create a writable CookieCollection
// instance?? We simply ignore this property, as this collection is always
// writable.
public bool IsReadOnly {
get { return true; }
}
// LAMESPEC: Which exception should we throw when the read only
// property is set to true??
public void Add (Cookie cookie)
{
if (cookie == null)
throw new ArgumentNullException ("cookie");
int pos = list.IndexOf (cookie);
if (pos == -1)
list.Add (cookie);
else
list [pos] = cookie;
}
// LAMESPEC: Which exception should we throw when the read only
// property is set to true??
public void Add (CookieCollection cookies)
{
if (cookies == null)
throw new ArgumentNullException ("cookies");
IEnumerator enumerator = cookies.list.GetEnumerator ();
while (enumerator.MoveNext ())
Add ((Cookie) enumerator.Current);
}
public Cookie this [int index] {
get {
if (index < 0 || index >= list.Count)
throw new ArgumentOutOfRangeException ("index");
return (Cookie) list [index];
}
}
public Cookie this [string name] {
get {
lock (this) {
IEnumerator enumerator = list.GetEnumerator ();
while (enumerator.MoveNext ())
if (String.Compare (((Cookie) enumerator.Current).Name, name, true) == 0)
return (Cookie) enumerator.Current;
}
return null;
}
}
} // CookieCollection
} // System.Net
using System;
using System.Collections;
using System.Globalization;
using System.Runtime.Serialization;
namespace System.Net
{
[Serializable]
public class CookieCollection : ICollection, IEnumerable
{
ArrayList list = new ArrayList (4);
// ICollection
public int Count {
get { return list.Count; }
}
public bool IsSynchronized {
get { return false; }
}
public Object SyncRoot {
get { return this; }
}
public void CopyTo (Array array, int arrayIndex)
{
list.CopyTo (array, arrayIndex);
}
// IEnumerable
public IEnumerator GetEnumerator ()
{
return list.GetEnumerator ();
}
// This
// LAMESPEC: So how is one supposed to create a writable CookieCollection
// instance?? We simply ignore this property, as this collection is always
// writable.
public bool IsReadOnly {
get { return true; }
}
public void Add (Cookie cookie)
{
if (cookie == null)
throw new ArgumentNullException ("cookie");
int pos = SearchCookie (cookie);
if (pos == -1)
list.Add (cookie);
else
list [pos] = cookie;
}
int SearchCookie (Cookie cookie)
{
string name = cookie.Name;
string domain = cookie.Domain;
string path = cookie.Path;
for (int i = list.Count - 1; i >= 0; i--) {
Cookie c = (Cookie) list [i];
if (0 != String.Compare (domain, c.Domain, true, CultureInfo.InvariantCulture))
continue;
if (0 != String.Compare (name, c.Name, true, CultureInfo.InvariantCulture))
continue;
if (0 != String.Compare (path, c.Path, true, CultureInfo.InvariantCulture))
continue;
return i;
}
return -1;
}
public void Add (CookieCollection cookies)
{
if (cookies == null)
throw new ArgumentNullException ("cookies");
foreach (Cookie c in cookies)
Add (c);
}
public Cookie this [int index] {
get {
if (index < 0 || index >= list.Count)
throw new ArgumentOutOfRangeException ("index");
return (Cookie) list [index];
}
}
public Cookie this [string name] {
get {
foreach (Cookie c in list) {
if (0 == String.Compare (c.Name, name, true))
return c;
}
return null;
}
}
} // CookieCollection
} // System.Net
+13 -2
View File
@@ -982,13 +982,24 @@ namespace System.Net
internal void SetResponseError (WebExceptionStatus status, Exception e, string where)
{
string msg = String.Format ("Error getting response stream ({0}): {1}", where, status);
if (webResponse != null) {
if (e is WebException)
throw e;
throw new WebException (msg, e, status, null);
}
WebAsyncResult r = asyncRead;
if (r == null)
r = asyncWrite;
if (r != null) {
string msg = String.Format ("Error getting response stream ({0}): {1}", where, status);
WebException wexc = new WebException (msg, e, status, null);
WebException wexc;
if (e is WebException) {
wexc = (WebException) e;
} else {
wexc = new WebException (msg, e, status, null);
}
r.SetCompleted (false, wexc);
r.DoCallback ();
asyncRead = null;
+119 -44
View File
@@ -61,7 +61,6 @@ namespace System.Net
EventHandler abortHandler;
ReadState readState;
internal WebConnectionData Data;
WebConnectionStream prevStream;
bool chunkedRead;
ChunkStream chunkStream;
AutoResetEvent goAhead;
@@ -89,14 +88,22 @@ namespace System.Net
queue = group.Queue;
}
bool CanReuse ()
{
// The real condition is !(socket.Poll (0, SelectMode.SelectRead) || socket.Available != 0)
// but if there's data pending to read (!) we won't reuse the socket.
return (socket.Poll (0, SelectMode.SelectRead) == false);
}
void Connect ()
{
lock (this) {
if (socket != null && socket.Connected && status == WebExceptionStatus.Success) {
// Take the chunked stream to the expected state (State.None)
while (chunkedRead && chunkStream.WantMore && Read (buffer, 0, buffer.Length) > 0);
reused = true;
return;
if (CanReuse () && CompleteChunkedRead ()) {
reused = true;
return;
}
}
reused = false;
@@ -104,7 +111,7 @@ namespace System.Net
socket.Close();
socket = null;
}
chunkStream = null;
IPHostEntry hostEntry = sPoint.HostEntry;
@@ -186,6 +193,11 @@ namespace System.Net
while (true) {
int n = stream.Read (buffer, 0, 256);
if (n == 0) {
HandleError (WebExceptionStatus.ServerProtocolViolation, null, "ReadHeders");
return false;
}
ms.Write (buffer, 0, n);
int start = 0;
string str = null;
@@ -218,6 +230,7 @@ namespace System.Net
{
try {
NetworkStream serverStream = new NetworkStream (socket, false);
if (request.Address.Scheme == Uri.UriSchemeHttps) {
ssl = true;
EnsureSSLStreamAvailable ();
@@ -254,7 +267,6 @@ namespace System.Net
{
status = st;
lock (this) {
busy = false;
if (st == WebExceptionStatus.RequestCanceled)
Data = new WebConnectionData ();
}
@@ -301,7 +313,6 @@ namespace System.Net
return;
}
//Console.WriteLine (System.Text.Encoding.Default.GetString (cnc.buffer, 0, nread + cnc.position));
int pos = -1;
nread += cnc.position;
if (cnc.readState == ReadState.None) {
@@ -341,10 +352,20 @@ namespace System.Net
stream.ReadBufferOffset = pos;
stream.ReadBufferSize = nread;
} else if (cnc.chunkStream == null) {
cnc.chunkStream = new ChunkStream (cnc.buffer, pos, nread, data.Headers);
try {
cnc.chunkStream = new ChunkStream (cnc.buffer, pos, nread, data.Headers);
} catch (Exception e) {
cnc.HandleError (WebExceptionStatus.ServerProtocolViolation, e, "ReadDone5");
return;
}
} else {
cnc.chunkStream.ResetBuffer ();
cnc.chunkStream.Write (cnc.buffer, pos, nread);
try {
cnc.chunkStream.Write (cnc.buffer, pos, nread);
} catch (Exception e) {
cnc.HandleError (WebExceptionStatus.ServerProtocolViolation, e, "ReadDone6");
return;
}
}
data.stream = stream;
@@ -357,7 +378,6 @@ namespace System.Net
if (cnc.queue.Count > 0) {
stream.ReadAll ();
} else {
cnc.prevStream = stream;
stream.CheckComplete ();
}
}
@@ -399,12 +419,19 @@ namespace System.Net
string line = null;
bool lineok = false;
bool isContinue = false;
bool emptyFirstLine = false;
do {
if (readState == ReadState.None) {
lineok = ReadLine (buffer, ref pos, max, ref line);
if (!lineok)
return -1;
if (line == null) {
emptyFirstLine = true;
continue;
}
emptyFirstLine = false;
readState = ReadState.Status;
string [] parts = line.Split (' ');
@@ -429,6 +456,7 @@ namespace System.Net
return pos;
}
emptyFirstLine = false;
if (readState == ReadState.Status) {
readState = ReadState.Headers;
Data.Headers = new WebHeaderCollection ();
@@ -482,7 +510,7 @@ namespace System.Net
return pos;
}
}
} while (isContinue == true);
} while (emptyFirstLine || isContinue);
return -1;
}
@@ -502,7 +530,6 @@ namespace System.Net
keepAlive = request.KeepAlive;
Data = new WebConnectionData ();
Data.request = request;
Connect ();
if (status != WebExceptionStatus.Success) {
request.SetWriteStreamError (status);
@@ -524,11 +551,6 @@ namespace System.Net
internal EventHandler SendRequest (HttpWebRequest request)
{
lock (this) {
if (prevStream != null && socket != null && socket.Connected) {
prevStream.ReadAll ();
prevStream = null;
}
if (!busy) {
busy = true;
ThreadPool.RegisterWaitForSingleObject (goAhead, initConn,
@@ -547,7 +569,6 @@ namespace System.Net
{
lock (queue) {
if (queue.Count > 0) {
prevStream = null;
SendRequest ((HttpWebRequest) queue.Dequeue ());
}
}
@@ -559,7 +580,7 @@ namespace System.Net
busy = false;
string header = (sPoint.UsesProxy) ? "Proxy-Connection" : "Connection";
string cncHeader = (Data.Headers != null) ? Data.Headers [header] : null;
bool keepAlive = (Data.Version == HttpVersion.Version11);
bool keepAlive = (Data.Version == HttpVersion.Version11 && this.keepAlive);
if (cncHeader != null) {
cncHeader = cncHeader.ToLower ();
keepAlive = (this.keepAlive && cncHeader.IndexOf ("keep-alive") != -1);
@@ -573,7 +594,6 @@ namespace System.Net
goAhead.Set ();
lock (queue) {
if (queue.Count > 0) {
prevStream = null;
SendRequest ((HttpWebRequest) queue.Dequeue ());
}
}
@@ -633,7 +653,7 @@ namespace System.Net
try {
result = nstream.BeginRead (buffer, offset, size, cb, state);
} catch (Exception) {
status = WebExceptionStatus.ReceiveFailure;
HandleError (WebExceptionStatus.ReceiveFailure, null, "chunked BeginRead");
throw;
}
}
@@ -658,26 +678,71 @@ namespace System.Net
if (wr.InnerAsyncResult != null)
nbytes = nstream.EndRead (wr.InnerAsyncResult);
chunkStream.WriteAndReadBack (wr.Buffer, wr.Offset, wr.Size, ref nbytes);
if (nbytes < wr.Size && chunkStream.WantMore) {
int size = chunkStream.ChunkLeft;
if (size < 0) // not read chunk size yet
size = 1024;
bool done = (nbytes == 0);
try {
chunkStream.WriteAndReadBack (wr.Buffer, wr.Offset, wr.Size, ref nbytes);
if (!done && nbytes == 0 && chunkStream.WantMore)
nbytes = EnsureRead (wr.Buffer, wr.Offset, wr.Size);
} catch (Exception e) {
if (e is WebException)
throw e;
byte [] morebytes = new byte [size];
int nread;
nread = nstream.Read (morebytes, 0, size);
chunkStream.Write (morebytes, 0, nread);
morebytes = null;
nbytes += chunkStream.Read (wr.Buffer, wr.Offset + nbytes,
wr.Size - nbytes);
throw new WebException ("Invalid chunked data.", e,
WebExceptionStatus.ServerProtocolViolation, null);
}
if ((done || nbytes == 0) && chunkStream.WantMore) {
HandleError (WebExceptionStatus.ReceiveFailure, null, "chunked EndRead");
throw new WebException ("Read error", null, WebExceptionStatus.ReceiveFailure, null);
}
return nbytes;
}
return nstream.EndRead (result);
}
// To be called on chunkedRead when we can read no data from the ChunkStream yet
int EnsureRead (byte [] buffer, int offset, int size)
{
byte [] morebytes = null;
int nbytes = 0;
while (nbytes == 0 && chunkStream.WantMore) {
int localsize = chunkStream.ChunkLeft;
if (localsize <= 0) // not read chunk size yet
localsize = 1024;
else if (localsize > 16384)
localsize = 16384;
if (morebytes == null || morebytes.Length < localsize)
morebytes = new byte [localsize];
int nread = nstream.Read (morebytes, 0, localsize);
if (nread <= 0)
return 0; // Error
chunkStream.Write (morebytes, 0, nread);
nbytes += chunkStream.Read (buffer, offset + nbytes, size - nbytes);
}
return nbytes;
}
bool CompleteChunkedRead()
{
if (!chunkedRead || chunkStream == null)
return true;
while (chunkStream.WantMore) {
int nbytes = nstream.Read (buffer, 0, buffer.Length);
if (nbytes <= 0)
return false; // Socket was disconnected
chunkStream.Write (buffer, 0, nbytes);
}
return true;
}
internal IAsyncResult BeginWrite (byte [] buffer, int offset, int size, AsyncCallback cb, object state)
{
IAsyncResult result = null;
@@ -707,11 +772,27 @@ namespace System.Net
int result = 0;
try {
if (!chunkedRead || chunkStream.WantMore)
bool done = false;
if (!chunkedRead) {
result = nstream.Read (buffer, offset, size);
done = (result == 0);
}
if (chunkedRead)
chunkStream.WriteAndReadBack (buffer, offset, size, ref result);
if (chunkedRead) {
try {
chunkStream.WriteAndReadBack (buffer, offset, size, ref result);
if (!done && result == 0 && chunkStream.WantMore)
result = EnsureRead (buffer, offset, size);
} catch (Exception e) {
HandleError (WebExceptionStatus.ReceiveFailure, e, "chunked Read1");
throw;
}
if ((done || result == 0) && chunkStream.WantMore) {
HandleError (WebExceptionStatus.ReceiveFailure, null, "chunked Read2");
throw new WebException ("Read error", null, WebExceptionStatus.ReceiveFailure, null);
}
}
} catch (Exception e) {
HandleError (WebExceptionStatus.ReceiveFailure, e, "Read");
}
@@ -776,10 +857,9 @@ namespace System.Net
socket = null;
}
if (sendNext) {
goAhead.Set ();
goAhead.Set ();
if (sendNext)
SendNext ();
}
}
}
@@ -799,11 +879,6 @@ namespace System.Net
}
}
}
~WebConnection ()
{
Close (false);
}
}
}
@@ -95,6 +95,7 @@ namespace System.Net
if (cnc == null) {
connections.RemoveAt (i);
count--;
i--;
continue;
}
@@ -130,8 +130,13 @@ namespace System.Net
internal void ReadAll ()
{
if (!isRead || totalRead >= contentLength || nextReadCalled)
if (!isRead || totalRead >= contentLength || nextReadCalled) {
if (!nextReadCalled) {
nextReadCalled = true;
cnc.NextRead ();
}
return;
}
pending.WaitOne ();
lock (this) {
@@ -144,12 +149,18 @@ namespace System.Net
if (contentLength == Int32.MaxValue) {
MemoryStream ms = new MemoryStream ();
if (readBuffer != null && diff > 0)
byte [] buffer = null;
if (readBuffer != null && diff > 0) {
ms.Write (readBuffer, readBufferOffset, diff);
if (readBufferSize >= 8192)
buffer = readBuffer;
}
if (buffer == null)
buffer = new byte [8192];
byte [] buffer = new byte [2048];
int read;
while ((read = cnc.Read (buffer, 0, 2048)) != 0)
while ((read = cnc.Read (buffer, 0, buffer.Length)) != 0)
ms.Write (buffer, 0, read);
b = ms.GetBuffer ();
@@ -216,6 +227,11 @@ namespace System.Net
if (size < 0 || offset < 0 || length < offset || length - offset < size)
throw new ArgumentOutOfRangeException ();
lock (this) {
pendingReads++;
pending.Reset ();
}
WebAsyncResult result = new WebAsyncResult (cb, state, buffer, offset, size);
if (totalRead >= contentLength) {
result.SetCompleted (true, -1);
@@ -239,11 +255,6 @@ namespace System.Net
result.NBytes = copy;
}
lock (this) {
pendingReads++;
pending.Reset ();
}
if (cb != null)
cb = new AsyncCallback (CallbackWrapper);
@@ -260,12 +271,6 @@ namespace System.Net
if (!result.IsCompleted) {
int nbytes = cnc.EndRead (result.InnerAsyncResult);
lock (this) {
pendingReads--;
if (pendingReads == 0)
pending.Set ();
}
bool finished = (nbytes == -1);
if (finished && result.NBytes > 0)
nbytes = 0;
@@ -276,11 +281,15 @@ namespace System.Net
contentLength = totalRead;
}
if (totalRead >= contentLength && !nextReadCalled) {
nextReadCalled = true;
cnc.NextRead ();
lock (this) {
pendingReads--;
if (pendingReads == 0)
pending.Set ();
}
if (totalRead >= contentLength && !nextReadCalled)
ReadAll ();
return result.NBytes;
}
@@ -1,9 +1,22 @@
2004-10-21 Joerg Rosenkranz <joergr@voelcker.com>
* regex.cs: Fixed a bug introduced with the last patch which
prevented any replacements when a postive count is given.
This also happens in all overloads without count parameter.
2004-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* regex.cs: use NextMatch to move on to the next match. Fixes bug
#57274.
2004-11-09 Atsushi Enomoto <[email protected]>
* parser.cs : cast.
2004-11-08 Ben Maurer <[email protected]>
* replace.cs, parser.cs: Use stringbuilder for allocation sanity.
2004-10-21 Joerg Rosenkranz <[email protected]>
* regex.cs: Fixed a bug introduced with the last patch which
prevented any replacements when a postive count is given.
This also happens in all overloads without count parameter.
2004-10-18 Gonzalo Paniagua Javier <[email protected]>
* regex.cs: in Replace, when count is negative, replacement continues
@@ -1048,7 +1048,7 @@ namespace System.Text.RegularExpressions.Syntax {
this.pattern = pattern;
this.ptr = 0;
string result = "";
StringBuilder result = new StringBuilder (pattern.Length);
while (ptr < pattern.Length) {
int c = pattern[ptr ++];
if (c == '\\') {
@@ -1060,10 +1060,10 @@ namespace System.Text.RegularExpressions.Syntax {
c = '\b';
}
}
result += (char)c;
result.Append ((char) c);
}
return result;
return result.ToString ();
}
private void ResolveReferences () {
@@ -415,8 +415,13 @@ namespace System.Text.RegularExpressions {
count = Int32.MaxValue;
int ptr = startat;
Match m = null;
while (--count > 0) {
Match m = Match (input, ptr);
if (m != null)
m = m.NextMatch ();
else
m = Match (input, ptr);
if (!m.Success)
break;
@@ -59,7 +59,7 @@ namespace System.Text.RegularExpressions {
private void Compile (string replacement) {
replacement = Parser.Unescape (replacement);
string literal = "";
StringBuilder literal = new StringBuilder ();
int ptr = 0;
char c;
@@ -75,18 +75,18 @@ namespace System.Text.RegularExpressions {
}
if (term != null) {
term.Literal = literal;
term.Literal = literal.ToString ();
terms.Add (term);
term = null;
literal = "";
literal.Length = 0;
}
else
literal += c;
literal.Append (c);
}
if (term == null && literal.Length > 0) {
terms.Add (new Term (literal));
terms.Add (new Term (literal.ToString ()));
}
}
@@ -1,8 +1,16 @@
2004-11-29 Gonzalo Paniagua Javier <[email protected]>
* System.Text.RegularExpressions/RegexBugs.cs: test case for bug #57274.
2004-10-18 Gonzalo Paniagua Javier <[email protected]>
* System.Text.RegularExpressions/RegexBugs.cs: added test for bug
#68398.
2004-07-05 Jackson Harper <[email protected]>
* RegexTest.cs: Add some simple tests for debugging/zen building.
2004-06-06 Jambunathan K <[email protected]>
* RegexTest.cs:
@@ -220,6 +220,27 @@ namespace MonoTests.System.Text.RegularExpressions
text = re.Replace(text, "e", -1, 4);
AssertEquals("#01", "abcde", text);
}
[Test]
//[Ignore] You may want to ignore this if the bugs gets back
public void SplitInfiniteLoop () // bug 57274
{
string ss = "a b c d e";
string [] words = Regex.Split (ss, "[ \t\n\r]*");
AssertEquals ("#01Length", 11, words.Length);
AssertEquals ("#00", "", words [0]);
AssertEquals ("#01", "a", words [1]);
AssertEquals ("#02", "", words [2]);
AssertEquals ("#03", "b", words [3]);
AssertEquals ("#04", "", words [4]);
AssertEquals ("#05", "c", words [5]);
AssertEquals ("#06", "", words [6]);
AssertEquals ("#07", "d", words [7]);
AssertEquals ("#08", "", words [8]);
AssertEquals ("#09", "e", words [9]);
AssertEquals ("#10", "", words [10]);
}
}
}
@@ -16,7 +16,7 @@ using NUnit.Framework;
namespace MonoTests.System.Text.RegularExpressions {
[TestFixture]
public class RegexTest {
public class RegexTest : Assertion {
[Test]
public void Simple () {
@@ -38,5 +38,198 @@ namespace MonoTests.System.Text.RegularExpressions {
Assertion.AssertEquals("unescape", outString, expectedString);
}
[Test]
public void Match1 ()
{
Regex email = new Regex ("(?<user>[^@]+)@(?<domain>.+)");
Match m;
m = email.Match ("[email protected]");
Assert ("#m01", m.Success);
AssertEquals ("#m02", "mono", m.Groups ["user"].Value);
AssertEquals ("#m03", "go-mono.com", m.Groups ["domain"].Value);
m = email.Match ("[email protected]");
Assert ("#m04", m.Success);
AssertEquals ("#m05", "mono.bugs", m.Groups ["user"].Value);
AssertEquals ("#m06", "go-mono.com", m.Groups ["domain"].Value);
}
[Test]
public void Matches1 ()
{
Regex words = new Regex ("(?<word>\\w+)");
MatchCollection mc = words.Matches ("the fat cat ate the rat");
AssertEquals ("#m01", 6, mc.Count);
AssertEquals ("#m02", "the", mc [0].Value);
AssertEquals ("#m03", "fat", mc [1].Value);
AssertEquals ("#m04", "cat", mc [2].Value);
AssertEquals ("#m05", "ate", mc [3].Value);
AssertEquals ("#m06", "the", mc [4].Value);
AssertEquals ("#m07", "rat", mc [5].Value);
}
[Test]
public void Matches2 ()
{
Regex words = new Regex ("(?<word>\\w+)", RegexOptions.RightToLeft);
MatchCollection mc = words.Matches ("the fat cat ate the rat");
AssertEquals ("#m01", 6, mc.Count);
AssertEquals ("#m02", "the", mc [5].Value);
AssertEquals ("#m03", "fat", mc [4].Value);
AssertEquals ("#m04", "cat", mc [3].Value);
AssertEquals ("#m05", "ate", mc [2].Value);
AssertEquals ("#m06", "the", mc [1].Value);
AssertEquals ("#m07", "rat", mc [0].Value);
}
[Test]
public void Matches3 ()
{
Regex digits = new Regex ("(?<digit>\\d+)");
MatchCollection mc = digits.Matches ("0 1 2 3 4 5 6a7b8c9d10");
AssertEquals ("#m01", 11, mc.Count);
AssertEquals ("#m02", "0", mc [0].Value);
AssertEquals ("#m03", "1", mc [1].Value);
AssertEquals ("#m04", "2", mc [2].Value);
AssertEquals ("#m05", "3", mc [3].Value);
AssertEquals ("#m06", "4", mc [4].Value);
AssertEquals ("#m07", "5", mc [5].Value);
AssertEquals ("#m08", "6", mc [6].Value);
AssertEquals ("#m09", "7", mc [7].Value);
AssertEquals ("#m10", "8", mc [8].Value);
AssertEquals ("#m11", "9", mc [9].Value);
AssertEquals ("#m12", "10", mc [10].Value);
}
[Test]
public void Matches4 ()
{
Regex digits = new Regex ("(?<digit>\\d+)", RegexOptions.RightToLeft);
MatchCollection mc = digits.Matches ("0 1 2 3 4 5 6a7b8c9d10");
AssertEquals ("#m01", 11, mc.Count);
AssertEquals ("#m02", "0", mc [10].Value);
AssertEquals ("#m03", "1", mc [9].Value);
AssertEquals ("#m04", "2", mc [8].Value);
AssertEquals ("#m05", "3", mc [7].Value);
AssertEquals ("#m06", "4", mc [6].Value);
AssertEquals ("#m07", "5", mc [5].Value);
AssertEquals ("#m08", "6", mc [4].Value);
AssertEquals ("#m09", "7", mc [3].Value);
AssertEquals ("#m10", "8", mc [2].Value);
AssertEquals ("#m11", "9", mc [1].Value);
AssertEquals ("#m12", "10", mc [0].Value);
}
[Test]
public void Matches5 ()
{
Regex lines = new Regex ("(?<line>.+)");
MatchCollection mc = lines.Matches (story);
AssertEquals ("#m01", 5, mc.Count);
AssertEquals ("#m02", "Two little dragons lived in the forest", mc [0].Value);
AssertEquals ("#m03", "They spent their days collecting honey suckle,",
mc [1].Value);
AssertEquals ("#m04", "And eating curds and whey", mc [2].Value);
AssertEquals ("#m05", "Until an evil sorcer came along", mc [3].Value);
AssertEquals ("#m06", "And chased my dragon friends away", mc [4].Value);
}
[Test]
public void Matches6 ()
{
Regex lines = new Regex ("(?<line>.+)", RegexOptions.RightToLeft);
MatchCollection mc = lines.Matches (story);
AssertEquals ("#m01", 5, mc.Count);
AssertEquals ("#m02", "Two little dragons lived in the forest", mc [4].Value);
AssertEquals ("#m03", "They spent their days collecting honey suckle,",
mc [3].Value);
AssertEquals ("#m04", "And eating curds and whey", mc [2].Value);
AssertEquals ("#m05", "Until an evil sorcer came along", mc [1].Value);
AssertEquals ("#m06", "And chased my dragon friends away", mc [0].Value);
}
string story = "Two little dragons lived in the forest\n" +
"They spent their days collecting honey suckle,\n" +
"And eating curds and whey\n" +
"Until an evil sorcer came along\n" +
"And chased my dragon friends away";
[Test]
public void Matches7 ()
{
Regex nonwhite = new Regex ("(?<nonwhite>\\S+)");
MatchCollection mc = nonwhite.Matches ("ab 12 cde 456 fghi .,\niou");
AssertEquals ("#m01", 7, mc.Count);
AssertEquals ("#m02", "ab", mc [0].Value);
AssertEquals ("#m03", "12", mc [1].Value);
AssertEquals ("#m04", "cde", mc [2].Value);
AssertEquals ("#m05", "456", mc [3].Value);
AssertEquals ("#m06", "fghi", mc [4].Value);
AssertEquals ("#m07", ".,", mc [5].Value);
AssertEquals ("#m08", "iou", mc [6].Value);
}
[Test]
public void Matches8 ()
{
Regex nonwhite = new Regex ("(?<nonwhite>\\S+)", RegexOptions.RightToLeft);
MatchCollection mc = nonwhite.Matches ("ab 12 cde 456 fghi .,\niou");
AssertEquals ("#m01", 7, mc.Count);
AssertEquals ("#m02", "ab", mc [6].Value);
AssertEquals ("#m03", "12", mc [5].Value);
AssertEquals ("#m04", "cde", mc [4].Value);
AssertEquals ("#m05", "456", mc [3].Value);
AssertEquals ("#m06", "fghi", mc [2].Value);
AssertEquals ("#m07", ".,", mc [1].Value);
AssertEquals ("#m08", "iou", mc [0].Value);
}
[Test]
public void Matches9 ()
{
Regex nondigit = new Regex ("(?<nondigit>\\D+)");
MatchCollection mc = nondigit.Matches ("ab0cd1ef2");
AssertEquals ("#m01", 3, mc.Count);
AssertEquals ("#m02", "ab", mc [0].Value);
AssertEquals ("#m02", "cd", mc [1].Value);
AssertEquals ("#m02", "ef", mc [2].Value);
}
[Test]
public void Matches10 ()
{
Regex nondigit = new Regex ("(?<nondigit>\\D+)", RegexOptions.RightToLeft);
MatchCollection mc = nondigit.Matches ("ab0cd1ef2");
AssertEquals ("#m01", 3, mc.Count);
AssertEquals ("#m02", "ab", mc [2].Value);
AssertEquals ("#m02", "cd", mc [1].Value);
AssertEquals ("#m02", "ef", mc [0].Value);
}
}
}
+1 -2
View File
@@ -12,7 +12,6 @@
//
// Copyright (c) 2002 Chew Keong TAN
// All rights reserved.
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
@@ -1021,7 +1020,7 @@ namespace Mono.Math {
r2.Normalize ();
if (r2 < x) {
if (r2 <= x) {
Kernel.MinusEq (x, r2);
} else {
BigInteger val = new BigInteger (Sign.Positive, kPlusOne + 1);
+5
View File
@@ -1,3 +1,8 @@
2004-12-03 Sebastien Pouliot <[email protected]>
* BigInteger.cs: Fix issue #70169 in ModPow when modulus is a power of
two.
2004-10-25 Sebastien Pouliot <[email protected]>
* BigInteger.cs: Fix issue #68452 when Randomize was being called on a
@@ -1,3 +1,14 @@
2004-12-06 Sebastien Pouliot <[email protected]>
* RSAManaged.cs: Implement key blinding for RSA decryption with, or
without, using CRT.
2004-11-23 Sebastien Pouliot <[email protected]>
* PKCS1.cs: Merge from HEAD. Fix PKCS#1 v1.5 decryption when the
ciphertext isn't exactly the same of the public key and some level 4
compiler warnings.
2004-09-29 Sebastien Pouliot <[email protected]>
* RSAManaged.cs: KeySize is now always a multiple of 8 bits.
@@ -2,12 +2,9 @@
// PKCS1.cs - Implements PKCS#1 primitives.
//
// Author:
// Sebastien Pouliot (spouliot@motus.com)
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
@@ -109,7 +106,9 @@ namespace Mono.Security.Cryptography {
public static byte[] OS2IP (byte[] x)
{
int i = 0;
while ((x [i++] == 0x00) && (i < x.Length));
while ((x [i++] == 0x00) && (i < x.Length)) {
// confuse compiler into reporting a warning with {}
}
i--;
if (i > 0) {
byte[] result = new byte [x.Length - i];
@@ -254,8 +253,8 @@ namespace Mono.Security.Cryptography {
// RSAES-PKCS1-V1_5-DECRYPT (K, C)
public static byte[] Decrypt_v15 (RSA rsa, byte[] C)
{
int size = rsa.KeySize / 8;
if ((size < 11) || (C.Length != size))
int size = rsa.KeySize >> 3; // div by 8
if ((size < 11) || (C.Length > size))
throw new CryptographicException ("decryption error");
byte[] c = OS2IP (C);
byte[] m = RSADP (rsa, c);
@@ -7,15 +7,11 @@
//
// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
// Portions (C) 2003 Ben Maurer
// (C) 2004 Novell (http://www.novell.com)
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Key generation translated from Bouncy Castle JCE (http://www.bouncycastle.org/)
// See bouncycastle.txt for license.
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
@@ -38,6 +34,7 @@
using System;
using System.Security.Cryptography;
using System.Text;
using Mono.Math;
@@ -61,6 +58,7 @@ namespace Mono.Security.Cryptography {
private const int defaultKeySize = 1024;
private bool isCRTpossible = false;
private bool keyBlinding = true;
private bool keypairGenerated = false;
private bool m_disposed = false;
@@ -79,9 +77,9 @@ namespace Mono.Security.Cryptography {
public RSAManaged (int keySize)
{
KeySizeValue = keySize;
LegalKeySizesValue = new KeySizes [1];
LegalKeySizesValue [0] = new KeySizes (384, 16384, 8);
base.KeySize = keySize;
}
~RSAManaged ()
@@ -164,7 +162,7 @@ namespace Mono.Security.Cryptography {
}
// note: this property will exist in RSACryptoServiceProvider in
// version 1.2 of the framework
// version 2.0 of the framework
public bool PublicOnly {
get { return ((d == null) || (n == null)); }
}
@@ -183,6 +181,16 @@ namespace Mono.Security.Cryptography {
GenerateKeyPair ();
BigInteger input = new BigInteger (rgb);
BigInteger r = null;
// we use key blinding (by default) against timing attacks
if (keyBlinding) {
// x = (r^e * g) mod n
// *new* random number (so it's timing is also random)
r = BigInteger.GenerateRandom (n.BitCount ());
input = r.ModPow (e, n) * input % n;
}
BigInteger output;
// decrypt (which uses the private key) can be
// optimized by using CRT (Chinese Remainder Theorem)
@@ -196,20 +204,26 @@ namespace Mono.Security.Cryptography {
// thanks to benm!
h = p - ((m2 - m1) * qInv % p);
output = m2 + q * h;
}
else {
} else {
// h = (m1 - m2) * qInv mod p
h = (m1 - m2) * qInv % p;
// m = m2 + q * h;
output = m2 + q * h;
}
}
else {
} else {
// m = c^d mod n
output = input.ModPow (d, n);
}
if (keyBlinding) {
// Complete blinding
// x^e / r mod n
output = output * r.ModInverse (n) % n;
r.Clear ();
}
byte[] result = output.GetBytes ();
// zeroize value
// zeroize values
input.Clear ();
output.Clear ();
return result;
@@ -245,7 +259,7 @@ namespace Mono.Security.Cryptography {
param.Modulus = n.GetBytes ();
if (includePrivateParameters) {
// some parameters are required for exporting the private key
if ((d == null) || (p == null) || (q == null))
if (d == null)
throw new CryptographicException ("Missing private key");
param.D = d.GetBytes ();
// hack for bugzilla #57941 where D wasn't provided
@@ -254,11 +268,11 @@ namespace Mono.Security.Cryptography {
Buffer.BlockCopy (param.D, 0, normalizedD, (normalizedD.Length - param.D.Length), param.D.Length);
param.D = normalizedD;
}
param.P = p.GetBytes ();
param.Q = q.GetBytes ();
// but CRT parameters are optionals
if ((dp != null) && (dq != null) && (qInv != null)) {
if ((p != null) && (q != null) && (dp != null) && (dq != null) && (qInv != null)) {
// and we include them only if we have them all
param.P = p.GetBytes ();
param.Q = q.GetBytes ();
param.DP = dp.GetBytes ();
param.DQ = dq.GetBytes ();
param.InverseQ = qInv.GetBytes ();
@@ -348,5 +362,98 @@ namespace Mono.Security.Cryptography {
public delegate void KeyGeneratedEventHandler (object sender, EventArgs e);
public event KeyGeneratedEventHandler KeyGenerated;
public override string ToXmlString (bool includePrivateParameters)
{
StringBuilder sb = new StringBuilder ();
RSAParameters rsaParams = ExportParameters (includePrivateParameters);
try {
sb.Append ("<RSAKeyValue>");
sb.Append ("<Modulus>");
sb.Append (Convert.ToBase64String (rsaParams.Modulus));
sb.Append ("</Modulus>");
sb.Append ("<Exponent>");
sb.Append (Convert.ToBase64String (rsaParams.Exponent));
sb.Append ("</Exponent>");
if (includePrivateParameters) {
if (rsaParams.P != null) {
sb.Append ("<P>");
sb.Append (Convert.ToBase64String (rsaParams.P));
sb.Append ("</P>");
}
if (rsaParams.Q != null) {
sb.Append ("<Q>");
sb.Append (Convert.ToBase64String (rsaParams.Q));
sb.Append ("</Q>");
}
if (rsaParams.DP != null) {
sb.Append ("<DP>");
sb.Append (Convert.ToBase64String (rsaParams.DP));
sb.Append ("</DP>");
}
if (rsaParams.DQ != null) {
sb.Append ("<DQ>");
sb.Append (Convert.ToBase64String (rsaParams.DQ));
sb.Append ("</DQ>");
}
if (rsaParams.InverseQ != null) {
sb.Append ("<InverseQ>");
sb.Append (Convert.ToBase64String (rsaParams.InverseQ));
sb.Append ("</InverseQ>");
}
sb.Append ("<D>");
sb.Append (Convert.ToBase64String (rsaParams.D));
sb.Append ("</D>");
}
sb.Append ("</RSAKeyValue>");
}
catch {
if (rsaParams.P != null)
Array.Clear (rsaParams.P, 0, rsaParams.P.Length);
if (rsaParams.Q != null)
Array.Clear (rsaParams.Q, 0, rsaParams.Q.Length);
if (rsaParams.DP != null)
Array.Clear (rsaParams.DP, 0, rsaParams.DP.Length);
if (rsaParams.DQ != null)
Array.Clear (rsaParams.DQ, 0, rsaParams.DQ.Length);
if (rsaParams.InverseQ != null)
Array.Clear (rsaParams.InverseQ, 0, rsaParams.InverseQ.Length);
if (rsaParams.D != null)
Array.Clear (rsaParams.D, 0, rsaParams.D.Length);
throw;
}
return sb.ToString ();
}
// internal for Mono 1.0.x in order to preserve public contract
// they are public for Mono 1.1.x (for 1.2) as the API isn't froze ATM
#if NET_2_0
public
#else
internal
#endif
bool UseKeyBlinding {
get { return keyBlinding; }
// you REALLY shoudn't touch this (true is fine ;-)
set { keyBlinding = value; }
}
#if NET_2_0
public
#else
internal
#endif
bool IsCrtPossible {
// either the key pair isn't generated (and will be
// generated with CRT parameters) or CRT is (or isn't)
// possible (in case the key was imported)
get { return (!keypairGenerated || isCRTpossible); }
}
}
}
+4
View File
@@ -1,3 +1,7 @@
2004-12-06 Atsushi Enomoto <[email protected]>
* TextWriter.cs : create CoreNewLine in another .ctor().
2004-09-19 Dick Porter <[email protected]>
* UnexceptionalStreamWriter.cs:
+1
View File
@@ -42,6 +42,7 @@ namespace System.IO {
}
protected TextWriter( IFormatProvider formatProvider ) {
CoreNewLine = System.Environment.NewLine.ToCharArray ();
internalFormatProvider = formatProvider;
}
@@ -1,3 +1,8 @@
2004-11-22 Zoltan Varga <[email protected]>
* ModuleBuilder.cs: Check that all types inside the module are created.
Fixes #69780.
2004-10-06 Zoltan Varga <[email protected]>
* ModuleBuilder.cs (GetTypes): Fix length of returned array. Fixes
@@ -628,6 +628,13 @@ namespace System.Reflection.Emit {
{
if (transient && !is_main)
return;
if (types != null) {
for (int i = 0; i < num_types; ++i)
if (!types [i].is_created)
throw new NotSupportedException ("Type '" + types [i].FullName + "' was not completed.");
}
if ((global_type != null) && (global_type_created == null))
global_type_created = global_type.CreateType ();
@@ -1,3 +1,7 @@
2004-12-06 Sebastien Pouliot <[email protected]>
* RSACryptoServiceProvider.cs: Merge from HEAD.
2004-07-15 Sebastien Pouliot <[email protected]>
* DES.cs: Fixed FeedbackSizeValue to 8.
@@ -7,10 +7,6 @@
//
// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
// Portions (C) 2003 Ben Maurer
// (C) 2004 Novell (http://www.novell.com)
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
@@ -33,16 +29,18 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.IO;
using System.Runtime.InteropServices;
using Mono.Math;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography {
#if (NET_2_0)
public sealed class RSACryptoServiceProvider : RSA, ICspAsymmetricAlgorithm {
#else
public sealed class RSACryptoServiceProvider : RSA {
#endif
private const int PROV_RSA_FULL = 1; // from WinCrypt.h
private KeyPairPersistence store;
@@ -99,7 +97,7 @@ namespace System.Security.Cryptography {
persistKey = (p != null);
if (p == null) {
p = new CspParameters (PROV_RSA_FULL);
#if ! NET_1_0
#if NET_1_1
if (useMachineKeyStore)
p.Flags |= CspProviderFlags.UseMachineKeyStore;
#endif
@@ -116,7 +114,7 @@ namespace System.Security.Cryptography {
}
}
#if ! NET_1_0
#if NET_1_1
private static bool useMachineKeyStore = false;
public static bool UseMachineKeyStore {
@@ -153,10 +151,11 @@ namespace System.Security.Cryptography {
}
}
#if (NET_1_0 || NET_1_1)
internal
#else
#if (NET_2_0)
[ComVisible (false)]
public
#else
internal
#endif
bool PublicOnly {
get { return rsa.PublicOnly; }
@@ -189,6 +188,9 @@ namespace System.Security.Cryptography {
// Using this method to decrypt data IS dangerous (and very slow).
public override byte[] DecryptValue (byte[] rgb)
{
if (!rsa.IsCrtPossible)
throw new CryptographicException ("Incomplete private key - missing CRT.");
return rsa.DecryptValue (rgb);
}
@@ -359,5 +361,27 @@ namespace System.Security.Cryptography {
persisted = true;
}
}
#if NET_2_0
// ICspAsymmetricAlgorithm
[MonoTODO ("call into KeyPairPersistence to get details")]
[ComVisible (false)]
public CspKeyContainerInfo CspKeyContainerInfo {
get { return null; }
}
[MonoTODO ("call into CryptoConvert")]
[ComVisible (false)]
public byte[] ExportCspBlob (bool includePrivateParameters)
{
return null;
}
[MonoTODO ("call into CryptoConvert")]
[ComVisible (false)]
public void ImportCspBlob (byte[] rawData)
{
}
#endif
}
}
+5
View File
@@ -1,3 +1,8 @@
2004-11-29 Atsushi Enomoto <[email protected]>
* GC.cs : Collect(generation) actually does not throw an exception
even if generation > MaxGeneration (MS document bug).
2004-11-15 Sebastien Pouliot <[email protected]>
* BitConverter.cs: Added support for special case when ToString is
+4 -1
View File
@@ -52,8 +52,11 @@ namespace System
InternalCollect (MaxGeneration);
}
// LAMESPEC: MS documentation says that it raises an error
// when the argument generation is greater than MaxGeneration,
// but it doesn't. (The documentation is fixed in 2.0.)
public static void Collect (int generation) {
if (generation < 0 || generation > MaxGeneration)
if (generation < 0)
throw new ArgumentOutOfRangeException ("generation");
InternalCollect (generation);
}
+1 -1
View File
@@ -1,7 +1,7 @@
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyVersion("1.0.4")]
[assembly: AssemblyVersion("1.0.5")]
[assembly: AssemblyTitle ("Mono ILasm Compiler")]
[assembly: AssemblyDescription ("Mono ILasm Compiler")]
[assembly: AssemblyCopyright ("Sergey Chaban and Jackson Harper")]
+1 -1
View File
@@ -1,7 +1,7 @@
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyVersion("1.0.4")]
[assembly: AssemblyVersion("1.0.5")]
[assembly: AssemblyTitle ("Mono C# Compiler")]
[assembly: AssemblyDescription ("Mono C# Compiler")]
[assembly: AssemblyCopyright ("2001, 2002, 2003 Ximian, Inc.")]
+16
View File
@@ -1,3 +1,19 @@
2004-12-01 Miguel de Icaza <[email protected]>
* cfold.cs (ConstantFold.DoConstantNumericPromotions): After
unwrapping the enumeration values, chain to
DoConstantNumericPromotions again, so we can promote things to the
fundamental types (takes care of enums that are bytes, sbytes).
Fixes bug #62054.
2004-11-25 Miguel de Icaza <[email protected]>
* const.cs (Const.ChangeType): Cope with the "0 literal can be
converted to an enum" here, before we try to change the underlying
type. This code exists, but it is a different code path than the
one used while encoding constants.
2004-11-04 Zoltan Varga <[email protected]>
* driver.cs: Strip the path from the names of embedded resources. Fixes
+3 -1
View File
@@ -165,6 +165,8 @@ namespace Mono.CSharp {
left = ((EnumConstant) left).Child;
if (right is EnumConstant)
right = ((EnumConstant) right).Child;
DoConstantNumericPromotions (ec, oper, ref left, ref right, loc);
return;
} else {
@@ -221,7 +223,7 @@ namespace Mono.CSharp {
DoConstantNumericPromotions (ec, oper, ref left, ref right, loc);
if (left == null || right == null)
return null;
if (left is IntConstant){
IntConstant v;
int res = ((IntConstant) left).Value | ((IntConstant) right).Value;
+7
View File
@@ -131,6 +131,13 @@ namespace Mono.CSharp {
Convert.Error_CannotImplicitConversion (loc, expr.Type, type);
return null;
}
// Special-case: The 0 literal can be converted to an enum value,
// and ImplicitStandardConversionExists will return true in that case.
if (expr.Type == TypeManager.int32_type && TypeManager.IsEnumType (type)){
if (expr is IntLiteral && ((IntLiteral) expr).Value == 0)
return new EnumConstant (expr, type);
}
object constant_value = TypeManager.ChangeType (expr.GetValue (), type, out fail);
if (fail){
+1 -1
View File
@@ -1145,7 +1145,7 @@ namespace Mono.CSharp {
//
// Possibly, we need to create a different 0 literal before passing
// to EnumConstant
//n
//
if (underlying == TypeManager.int64_type)
e = new LongLiteral (0);
else if (underlying == TypeManager.uint64_type)
+14 -9
View File
@@ -513,10 +513,15 @@ namespace Mono.CSharp {
}
}
static void Msgtry (string s)
static void MsgtryRef (string s)
{
Console.WriteLine (" Try using -r:" + s);
}
static void MsgtryPkg (string s)
{
Console.WriteLine (" Try using -pkg:" + s);
}
protected void error246 (Location loc, string name)
{
@@ -529,35 +534,35 @@ namespace Mono.CSharp {
switch (name){
case "Gtk": case "GtkSharp":
Msgtry ("gtk-sharp");
MsgtryPkg ("gtk-sharp");
break;
case "Gdk": case "GdkSharp":
Msgtry ("gdk-sharp");
MsgtryPkg ("gdk-sharp");
break;
case "Glade": case "GladeSharp":
Msgtry ("glade-sharp");
MsgtryPkg ("glade-sharp");
break;
case "System.Drawing":
Msgtry ("System.Drawing");
MsgtryRef ("System.Drawing");
break;
case "System.Web.Services":
Msgtry ("System.Web.Services");
MsgtryRef ("System.Web.Services");
break;
case "System.Web":
Msgtry ("System.Web");
MsgtryRef ("System.Web");
break;
case "System.Data":
Msgtry ("System.Data");
MsgtryRef ("System.Data");
break;
case "System.Windows.Forms":
Msgtry ("System.Windows.Forms");
MsgtryRef ("System.Windows.Forms");
break;
}
}
+3
View File
@@ -29,6 +29,9 @@ public class Blah {
enum Compute { two = AA.b + B.y }
// The constant assignment follows a different path
const Bar bar_assignment = 0;
public static int Main ()
{
byte b = (byte) MyEnum.Foo;
+6
View File
@@ -1,3 +1,9 @@
Fri Nov 19 17:29:22 CET 2004 Paolo Molaro <[email protected]>
* ppc/ppc-codegen.h: counter reg decrement branch values
(patch by Geoff Norton <[email protected]>).
2004-05-07 Bernie Solomon <[email protected]>
* ppc/ppc-codegen.h: remove GCC-ism in ppc_emit32
+6
View File
@@ -88,9 +88,15 @@ typedef enum {
enum {
/* B0 operand for branches */
PPC_BR_DEC_CTR_NONZERO_FALSE = 0,
PPC_BR_LIKELY = 1, /* can be or'ed with the conditional variants */
PPC_BR_DEC_CTR_ZERO_FALSE = 2,
PPC_BR_FALSE = 4,
PPC_BR_DEC_CTR_NONZERO_TRUE = 8,
PPC_BR_DEC_CTR_ZERO_TRUE = 10,
PPC_BR_TRUE = 12,
PPC_BR_DEC_CTR_NONZERO = 16,
PPC_BR_DEC_CTR_ZERO = 18,
PPC_BR_ALWAYS = 20,
/* B1 operand for branches */
PPC_BR_LT = 0,
+6
View File
@@ -1,3 +1,9 @@
2004-12-01 Gonzalo Paniagua Javier <[email protected]>
* processes.c: unquote the cmd path, allow for ' or " when quoting and
pass the quoted program name to the daemon, otherwise the call to
g_shell_unquote in the daemon will break things up.
2004-10-14 Dick Porter <[email protected]>
* sockets.c (_wapi_accept): Revert the previous change. We now
+20 -10
View File
@@ -230,18 +230,20 @@ gboolean CreateProcess (const gunichar2 *appname, gunichar2 *cmdline,
/* We can't put off locating the executable any longer :-( */
if(cmd!=NULL) {
gchar *unquoted;
if(g_ascii_isalpha (cmd[0]) && (cmd[1]==':')) {
/* Strip off the drive letter. I can't
* believe that CP/M holdover is still
* visible...
*/
memmove (cmd, cmd+2, strlen (cmd)-2);
g_memmove (cmd, cmd+2, strlen (cmd)-2);
cmd[strlen (cmd)-2]='\0';
}
if(cmd[0]=='/') {
unquoted = g_shell_unquote (cmd, NULL);
if(unquoted[0]=='/') {
/* Assume full path given */
prog=g_strdup (cmd);
prog=g_strdup (unquoted);
/* Executable existing ? */
if(access (prog, X_OK)!=0) {
@@ -249,6 +251,7 @@ gboolean CreateProcess (const gunichar2 *appname, gunichar2 *cmdline,
g_message (G_GNUC_PRETTY_FUNCTION ": Couldn't find executable %s", prog);
#endif
g_free (prog);
g_free (unquoted);
SetLastError (ERROR_FILE_NOT_FOUND);
goto cleanup;
}
@@ -258,13 +261,15 @@ gboolean CreateProcess (const gunichar2 *appname, gunichar2 *cmdline,
*/
char *curdir=g_get_current_dir ();
prog=g_strdup_printf ("%s/%s", curdir, cmd);
prog=g_strdup_printf ("%s/%s", curdir, unquoted);
g_free (unquoted);
g_free (curdir);
}
args_after_prog=args;
} else {
gchar *token=NULL;
char quote;
/* Dig out the first token from args, taking quotation
* marks into account
@@ -282,8 +287,9 @@ gboolean CreateProcess (const gunichar2 *appname, gunichar2 *cmdline,
/* Assume the opening quote will always be the first
* character
*/
if(args[0]=='\"') {
for(i=1; args[i]!='\0' && args[i]!='\"'; i++);
if(args[0]=='\"' || args [0] == '\'') {
quote = args [0];
for(i=1; args[i]!='\0' && args[i]!=quote; i++);
if(g_ascii_isspace (args[i+1])) {
/* We found the first token */
token=g_strndup (args+1, i-1);
@@ -337,7 +343,7 @@ gboolean CreateProcess (const gunichar2 *appname, gunichar2 *cmdline,
* believe that CP/M holdover is still
* visible...
*/
memmove (token, token+2, strlen (token)-2);
g_memmove (token, token+2, strlen (token)-2);
token[strlen (token)-2]='\0';
}
@@ -394,10 +400,14 @@ gboolean CreateProcess (const gunichar2 *appname, gunichar2 *cmdline,
args_after_prog);
#endif
if(args_after_prog!=NULL) {
full_prog=g_strconcat (prog, " ", args_after_prog, NULL);
if(args_after_prog!=NULL && *args_after_prog) {
gchar *qprog;
qprog = g_shell_quote (prog);
full_prog=g_strconcat (qprog, " ", args_after_prog, NULL);
g_free (qprog);
} else {
full_prog=g_strdup (prog);
full_prog=g_shell_quote (prog);
}
stored_prog=_wapi_handle_scratch_store (full_prog, strlen (full_prog));
+33
View File
@@ -1,3 +1,36 @@
2004-12-07 Ben Maurer <[email protected]>
* threads.c: Interlocked inc and dec for longs were messed up,
use a KISS based impl for this. Fixes 70234
2004-12-06 Gonzalo Paniagua Javier <[email protected]>
* process.c: make the patch that handles spaces in file paths work
on mono/windows too.
2004-12-04 Zoltan Varga <[email protected]>
* image.c: Add unbox_wrapper_cache.
* class-internals.h debug-helpers.c: Add MONO_WRAPPER_UNBOX.
* marshal.h marshal.c (mono_marshal_get_unbox_wrapper): New wrapper
function generator.
* object.c (mono_delegate_ctor): Call unbox wrapper if neccesary.
Fixes #70173.
* metadata-internals.h image.c: Add MonoImage->unbox_wrapper_cache.
2004-12-01 Gonzalo Paniagua Javier <[email protected]>
* process.c: (complete_path) return the path quoted
2004-11-24 Zoltan Varga <[email protected]>
* reflection.c: Allow all kinds of whitespace, not just ' ' in type
names. Fixes #69787.
2004-11-15 Zoltan Varga <[email protected]>
* icall.c (ves_icall_type_isprimitive): Native int is a primitive type.
+1
View File
@@ -31,6 +31,7 @@ typedef enum {
MONO_WRAPPER_STFLD,
MONO_WRAPPER_SYNCHRONIZED,
MONO_WRAPPER_DYNAMIC_METHOD,
MONO_WRAPPER_UNBOX,
MONO_WRAPPER_UNKNOWN
} MonoWrapperType;
+1
View File
@@ -29,6 +29,7 @@ static const char *wrapper_type_names [] = {
"stfld",
"synchronized",
"dynamic-method",
"unbox",
"unknown"
};
+3
View File
@@ -563,6 +563,7 @@ mono_image_init (MonoImage *image)
image->native_wrapper_cache = g_hash_table_new (NULL, NULL);
image->remoting_invoke_cache = g_hash_table_new (NULL, NULL);
image->synchronized_cache = g_hash_table_new (NULL, NULL);
image->unbox_wrapper_cache = g_hash_table_new (NULL, NULL);
image->typespec_cache = g_hash_table_new (NULL, NULL);
image->memberref_signatures = g_hash_table_new (NULL, NULL);
@@ -992,6 +993,8 @@ mono_image_close (MonoImage *image)
g_hash_table_destroy (image->delegate_invoke_cache);
g_hash_table_destroy (image->remoting_invoke_cache);
g_hash_table_destroy (image->runtime_invoke_cache);
g_hash_table_destroy (image->synchronized_cache);
g_hash_table_destroy (image->unbox_wrapper_cache);
g_hash_table_destroy (image->typespec_cache);
g_hash_table_destroy (image->generic_inst_cache);
g_hash_table_foreach (image->memberref_signatures, free_mr_signatures, NULL);
+37 -1
View File
@@ -4854,7 +4854,43 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method)
return res;
}
/* FIXME: on win32 we should probably use GlobalAlloc(). */
/*
* the returned method calls 'method' unboxing the this argument
*/
MonoMethod *
mono_marshal_get_unbox_wrapper (MonoMethod *method)
{
MonoMethodSignature *sig = method->signature;
int i;
MonoMethodBuilder *mb;
MonoMethod *res;
GHashTable *cache;
cache = method->klass->image->unbox_wrapper_cache;
if ((res = mono_marshal_find_in_cache (cache, method)))
return res;
mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_UNBOX);
g_assert (sig->hasthis);
mono_mb_emit_ldarg (mb, 0);
mono_mb_emit_icon (mb, sizeof (MonoObject));
mono_mb_emit_byte (mb, CEE_ADD);
for (i = 0; i < sig->param_count; ++i)
mono_mb_emit_ldarg (mb, i + 1);
mono_mb_emit_managed_call (mb, method, NULL);
mono_mb_emit_byte (mb, CEE_RET);
res = mono_mb_create_and_cache (cache, method,
mb, sig, sig->param_count + 16);
mono_mb_free (mb);
/* printf ("CODE FOR %s: \n%s.\n", mono_method_full_name (res, TRUE), mono_disasm_code (0, res, ((MonoMethodNormal*)res)->header->code, ((MonoMethodNormal*)res)->header->code + ((MonoMethodNormal*)res)->header->code_size)); */
return res;
}
void*
mono_marshal_alloc (gpointer size)
{
+3
View File
@@ -207,6 +207,9 @@ mono_marshal_get_ldfld_wrapper (MonoType *type);
MonoMethod *
mono_marshal_get_synchronized_wrapper (MonoMethod *method);
MonoMethod *
mono_marshal_get_unbox_wrapper (MonoMethod *method);
MonoMethod *
mono_marshal_get_isinst (MonoClass *klass);
+1
View File
@@ -129,6 +129,7 @@ struct _MonoImage {
GHashTable *native_wrapper_cache;
GHashTable *remoting_invoke_cache;
GHashTable *synchronized_cache;
GHashTable *unbox_wrapper_cache;
void *reflection_info;
+4
View File
@@ -2843,6 +2843,10 @@ mono_delegate_ctor (MonoObject *this, MonoObject *target, gpointer addr)
method = mono_marshal_get_remoting_invoke (method);
delegate->method_ptr = mono_compile_method (method);
delegate->target = target;
} else if (method->signature->hasthis && method->klass->valuetype) {
method = mono_marshal_get_unbox_wrapper (method);
delegate->method_ptr = mono_compile_method (method);
delegate->target = target;
} else {
delegate->method_ptr = addr;
delegate->target = target;
+43 -7
View File
@@ -726,21 +726,42 @@ void ves_icall_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal (MonoO
mono_image_close (image);
}
/* Only used when UseShellExecute is false */
static gchar *
quote_path (const gchar *path)
{
gchar *res = g_shell_quote (path);
#ifdef PLATFORM_WIN32
{
gchar *q = res;
while (*q) {
if (*q == '\'')
*q = '\"';
q++;
}
}
#endif
return res;
}
/* Only used when UseShellExecute is false */
static gboolean
complete_path (const gunichar2 *appname, gunichar2 **completed)
complete_path (const gunichar2 *appname, gchar **completed)
{
gchar *utf8app;
gchar *found;
utf8app = g_utf16_to_utf8 (appname, -1, NULL, NULL, NULL);
if (g_path_is_absolute (utf8app)) {
*completed = quote_path (utf8app);
g_free (utf8app);
return FALSE;
return TRUE;
}
if (g_file_test (utf8app, G_FILE_TEST_IS_EXECUTABLE) && !g_file_test (utf8app, G_FILE_TEST_IS_DIR)) {
*completed = quote_path (utf8app);
g_free (utf8app);
return FALSE;
return TRUE;
}
found = g_find_program_in_path (utf8app);
@@ -750,7 +771,7 @@ complete_path (const gunichar2 *appname, gunichar2 **completed)
return FALSE;
}
*completed = g_utf8_to_utf16 (found, -1, NULL, NULL, NULL);
*completed = quote_path (found);
g_free (found);
g_free (utf8app);
return TRUE;
@@ -765,6 +786,7 @@ MonoBoolean ves_icall_System_Diagnostics_Process_Start_internal (MonoString *app
gunichar2 *shell_path = NULL;
gchar *env_vars = NULL;
gboolean free_shell_path = TRUE;
gchar *newcmd, *tmp;
MONO_ARCH_SAVE_REGS;
@@ -786,7 +808,6 @@ MonoBoolean ves_icall_System_Diagnostics_Process_Start_internal (MonoString *app
#endif
if (spath != NULL) {
gint dummy;
gchar *newcmd, *tmp;
gchar *quoted;
shell_path = mono_unicode_from_external (spath, &dummy);
@@ -809,12 +830,27 @@ MonoBoolean ves_icall_System_Diagnostics_Process_Start_internal (MonoString *app
g_free (newcmd);
}
} else {
gchar *spath = NULL;
shell_path = mono_string_chars (appname);
free_shell_path = complete_path (shell_path, &shell_path);
if (shell_path == NULL) {
complete_path (shell_path, &spath);
if (spath == NULL) {
process_info->pid = -ERROR_FILE_NOT_FOUND;
return FALSE;
}
#ifdef PLATFORM_WIN32
/* Seems like our CreateProcess does not work as the windows one.
* This hack is needed to deal with paths containing spaces */
shell_path = NULL;
free_shell_path = FALSE;
tmp = mono_string_to_utf8 (cmd);
newcmd = g_strdup_printf ("%s %s", spath, tmp);
cmd = mono_string_new_wrapper (newcmd);
g_free (newcmd);
g_free (tmp);
#else
shell_path = g_utf8_to_utf16 (spath, -1, NULL, NULL, NULL);
#endif
g_free (spath);
}
if (process_info->env_keys != NULL) {
Loaded 100 of 110 files, more files were not shown because too many files have changed in this diff. Show more