Compare commits

...
259 Commits
Author SHA1 Message Date
Atsushi Eno 1429f06a9e 2005-04-25 Atsushi Enomoto <[email protected]>
* XmlTextReader.cs : Check empty BaseURI before being used to
	  resolve Uri. Patch by Heath Harrelson. Fixed bug #74704.


svn path=/branches/mono-1-0/mcs/; revision=43525
2005-04-25 02:54:59 +00:00
Sebastien Pouliot 5d2ccdb028 2005-04-18 Sebastien Pouliot <[email protected]>
* SymmetricTransform.cs: Fixed a division by zero if someone changes 
	the feedback value to 0.


svn path=/branches/mono-1-0/mcs/; revision=43213
2005-04-18 12:58:51 +00:00
Sebastien Pouliot 4fd1ddf2b9 2005-04-18 Sebastien Pouliot <[email protected]>
* SymmetricTransform.cs: Fixed a division by zero if someone changes 
	the feedback value to 0.


svn path=/branches/mono-1-0/mcs/; revision=43212
2005-04-18 12:57:51 +00:00
Sebastien Pouliot 20ab2c4674 2005-04-13 Sebastien Pouliot <[email protected]>
* CipherSuite.cs: In sync with HEAD.
	* RecordProtocol.cs: Some API changes so a record can be decoded from
	any supplied stream (not just the inner network stream).
	* SslClientStream.cs: BeginRead is now truly async if the Negotiate is
	called from BeginWrite (where it should be in most case).
	* SslServerStream.cs: Adapted to API changes in RecordProtocol.cs.


svn path=/branches/mono-1-0/mcs/; revision=42956
2005-04-13 19:06:13 +00:00
Sebastien Pouliot 93f290d5a0 2005-04-12 Sebastien Pouliot <[email protected]>
* TlsClientCertificateVerify.cs: Add missing data length (16 bits - 
	not to be confused with the record 24 bits length) before the RSA
	signature of the MD5SHA1 hash. Fix #71696.


svn path=/branches/mono-1-0/mcs/; revision=42862
2005-04-12 18:32:13 +00:00
Sebastien Pouliot 249179cdce 2005-04-12 Sebastien Pouliot <[email protected]>
* SslHandshakeHash.cs: Changed "SslHash" to "MD5SHA1". Fix #71696.


svn path=/branches/mono-1-0/mcs/; revision=42861
2005-04-12 18:31:34 +00:00
Sebastien Pouliot e70f174d3c 2005-04-10 Sebastien Pouliot <[email protected]>
* HttpsClientStream.cs: Added a TrustFailure property so a 
	WebException can now report TrustFailure correctly. Fix bug 74286.


svn path=/branches/mono-1-0/mcs/; revision=42764
2005-04-10 18:31:17 +00:00
Miguel de Icaza d5f96204e1 Fix for 74513 on 1-0 branch
svn path=/branches/mono-1-0/mcs/; revision=42739
2005-04-09 19:26:11 +00:00
Gonzalo Paniagua Javier d90252b176 2005-04-08 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: moved redirection handling to a proper place.


svn path=/branches/mono-1-0/mcs/; revision=42707
2005-04-08 20:56:45 +00:00
Gonzalo Paniagua Javier 096136321d 2005-04-07 Gonzalo Paniagua Javier <[email protected]>
* Thread.cs: clear the Unstarted bit before calling Start_internal.
	Fixes bug #72738.


svn path=/branches/mono-1-0/mcs/; revision=42665
2005-04-07 23:48:44 +00:00
Sebastien Pouliot 6ea3619f41 2005-04-07 Sebastien Pouliot <[email protected]>
* SslCipherSuite.cs: Fix calculation (sequence number) for the server
	side stream. Patch by Brian Ritchie.


svn path=/branches/mono-1-0/mcs/; revision=42649
2005-04-07 16:18:54 +00:00
Gonzalo Paniagua Javier b52b9ca478 2005-04-04 Gonzalo Paniagua Javier <[email protected]>
* System.Net/NtlmClient.cs: fix typo in assembly name.
	* Assembly/Consts.cs: added constants for Mono.Http.dll


svn path=/branches/mono-1-0/mcs/; revision=42523
2005-04-04 13:49:40 +00:00
Gonzalo Paniagua Javier 6a59211c47 2005-04-01 Gonzalo Paniagua Javier <[email protected]>
* CachedVaryBy.cs: fixed VaryByParam and wildcard (*). Patch by Ilya
	Kharmatsky (Mainsoft).


svn path=/branches/mono-1-0/mcs/; revision=42487
2005-04-02 00:29:07 +00:00
Gonzalo Paniagua Javier 7946cab2f8 from HEAD
svn path=/branches/mono-1-0/mcs/; revision=42396
2005-03-30 22:13:52 +00:00
Gonzalo Paniagua Javier 7fe238facd 2005-03-23 Gonzalo Paniagua Javier <[email protected]>
* HttpCookieCollection.cs: when adding more than one cookie with the
	same name, the last one is the winner.


svn path=/branches/mono-1-0/mcs/; revision=42173
2005-03-23 21:04:55 +00:00
Gonzalo Paniagua Javier b307466868 2005-03-22 Gonzalo Paniagua Javier <[email protected]>
* ResourceManager.cs: use culture.Equals in InternalGetResourceSet().


svn path=/branches/mono-1-0/mcs/; revision=42131
2005-03-23 03:23:17 +00:00
Gonzalo Paniagua Javier bc108ec04a 2005-03-18 Gonzalo Paniagua Javier <[email protected]>
* BasicClient.cs:
	* DigestClient.cs: check that GetCredential() does not return null.


svn path=/branches/mono-1-0/mcs/; revision=41994
2005-03-18 15:09:38 +00:00
Gonzalo Paniagua Javier 72e49e4625 updated
svn path=/branches/mono-1-0/mono/; revision=41967
2005-03-17 23:23:37 +00:00
Gonzalo Paniagua Javier 3fc4671ceb 2005-03-16 Gonzalo Paniagua Javier <[email protected]>
* file-io.c: disabled file async. IO using aio_*. It uses the
	threadpool now. Workaround for bug #73718.


svn path=/branches/mono-1-0/mono/; revision=41920
2005-03-16 19:21:23 +00:00
Gonzalo Paniagua Javier 437cd20b37 2005-03-16 Gonzalo Paniagua Javier <[email protected]>
* BasicClient.cs: ensure credentials are not null.


svn path=/branches/mono-1-0/mcs/; revision=41918
2005-03-16 18:55:51 +00:00
Raja R Harinath e7e5d0b6b6 Fix slightly differently.
svn path=/branches/mono-1-0/mcs/; revision=41905
2005-03-16 14:55:45 +00:00
Sebastien Pouliot 386ac21e4c Also fix when bootstraping 2.0
svn path=/branches/mono-1-0/mcs/; revision=41902
2005-03-16 14:10:35 +00:00
Sebastien Pouliot 5c3ba7981e Fix when compiling with an older corlib which doesn't have Mono.Security.Uri available
svn path=/branches/mono-1-0/mcs/; revision=41900
2005-03-16 13:54:50 +00:00
Sebastien Pouliot 727d3d79d7 In Mono.Security:
2005-03-16  Sebastien Pouliot  <[email protected]>

	* Uri.cs: Added Uri.cs from HEAD.

In .:
2005-03-16  Sebastien Pouliot  <[email protected]>

	* corlib.dll.sources: Added Mono.Security.Uri to the build.

In System.Reflection:
2005-03-16  Sebastien Pouliot  <[email protected]>

	* Assembly.cs: Implemented EscapedCodeBase using the copy of 
	System.Uri (System.dll) located in Mono.Security.Uri. Fix bug #73663.


svn path=/branches/mono-1-0/mcs/; revision=41896
2005-03-16 13:25:44 +00:00
Gonzalo Paniagua Javier c18c4cf88a 2005-03-14 Gonzalo Paniagua Javier <[email protected]>
* DirectoryEntry.cs: username and password are now initialized to null.
	Patch by Boris Kirzner (Mainsoft).


svn path=/branches/mono-1-0/mcs/; revision=41818
2005-03-15 01:44:02 +00:00
Gonzalo Paniagua Javier 2039ef93ce 2005-03-14 Gonzalo Paniagua Javier <[email protected]>
* PropertyValueCollection.cs: the Value property for an empty collection
	is now null and setting Value to null clears the collection. Patch by
	Boris Kirzner (Mainsoft).

svn path=/branches/mono-1-0/mcs/; revision=41816
2005-03-15 01:40:13 +00:00
Sebastien Pouliot c9dbf3abd5 2005-03-13 Sebastien Pouliot <[email protected]>
* process.c: Fix buffer length in ves_icall_System_Diagnostics_Process
	_ProcessName_internal.


svn path=/branches/mono-1-0/mono/; revision=41779
2005-03-14 02:35:10 +00:00
Sebastien Pouliot 47dbd8a6f8 2005-03-13 Sebastien Pouliot <[email protected]>
* util.c: Fix buffer length in mono_set_rootdir.

svn path=/branches/mono-1-0/mono/; revision=41778
2005-03-14 02:30:12 +00:00
Gonzalo Paniagua Javier 99ddff7492 2005-03-11 Gonzalo Paniagua Javier <[email protected]>
* Tds.cs: set the charset for MS SQL 2000. Patch from Aleksandar
	Dezelin. Closes bug #73591.


svn path=/branches/mono-1-0/mcs/; revision=41720
2005-03-11 21:03:32 +00:00
Gonzalo Paniagua Javier 0ea981862d 2005-03-11 Gonzalo Paniagua Javier <[email protected]>
* Version.cs: don't ignore the last number. Fixes bug #73539.


svn path=/branches/mono-1-0/mcs/; revision=41718
2005-03-11 20:53:39 +00:00
Gonzalo Paniagua Javier 0f789d4884 2005-03-11 Gonzalo Paniagua Javier <[email protected]>
* FormsAuthenticationModule.cs: fix for bug 73545, which caused
	authentication not to work when the cookie was not persistent.
	Patch by Ilya Kharmatsky (Mainsoft).


svn path=/branches/mono-1-0/mcs/; revision=41676
2005-03-11 06:03:53 +00:00
Gonzalo Paniagua Javier 54f32d6ccb 2005-03-10 Gonzalo Paniagua Javier <[email protected]>
* HttpWebResponse.cs: moved cookie parsing into its own class.
	* WebHeaderCollection.cs: remove (probably bogus) GetMultipleValues
	call.
	* HttpWebRequest.cs: don't let exception raised in the ctor of
	HttpWebResponse vanish.


svn path=/branches/mono-1-0/mcs/; revision=41671
2005-03-10 23:30:03 +00:00
Gonzalo Paniagua Javier 321aa195bb oops
svn path=/branches/mono-1-0/mcs/; revision=41625
2005-03-09 23:27:23 +00:00
Gonzalo Paniagua Javier 02f74b46a6 2005-03-09 Gonzalo Paniagua Javier <[email protected]>
* Control.cs: in FindControl, throw if there's more than one control
 	with the same ID. Fixes bug #73479.
 

svn path=/branches/mono-1-0/mcs/; revision=41623
2005-03-09 23:21:06 +00:00
Gonzalo Paniagua Javier 702b407556 2005-03-09 Gonzalo Paniagua Javier <[email protected]>
* HttpRequest.cs: correctly store the value cookies in Params. Fixes
	bug #73345.


svn path=/branches/mono-1-0/mcs/; revision=41617
2005-03-09 21:41:16 +00:00
Zoltan Varga 5d12cc0c7f Merge from HEAD.
svn path=/branches/mono-1-0/mcs/; revision=41597
2005-03-09 12:33:16 +00:00
Sebastien Pouliot a9cd17cb6f 2005-03-07 Sebastien Pouliot <[email protected]>
* MD5CryptoServiceProvider.cs: Fixed #73404 to return right results
	if the data length is bigger than 2^32 bits.
	* SHA1CryptoServiceProvider.cs: Fixed #73404 to return right results
	if the data length is bigger than 2^32 bits.
	* SHA256Managed.cs: Fixed #73404 to return right results if the data
	length is bigger than 2^32 bits.


svn path=/branches/mono-1-0/mcs/; revision=41525
2005-03-07 14:48:26 +00:00
Gonzalo Paniagua Javier 550ef7500a from HEAD
svn path=/branches/mono-1-0/mcs/; revision=41472
2005-03-05 21:13:11 +00:00
Zoltan Varga ecc0aea9ae Merge from HEAD.
svn path=/branches/mono-1-0/mono/; revision=41449
2005-03-04 16:18:53 +00:00
Gonzalo Paniagua Javier 071575a9ef 2005-03-03 Gonzalo Paniagua Javier <[email protected]>
* UnicodeEncoding.cs: same fix (\uFEFF) but for Unicode. Patch by
	Svetlana Zholkovsky.


svn path=/branches/mono-1-0/mcs/; revision=41419
2005-03-03 23:52:38 +00:00
Gonzalo Paniagua Javier f3567689bc 2005-03-03 Gonzalo Paniagua Javier <[email protected]>
* UTF7Encoding.cs: fix for characters encoded as a shifted sequence
	whose length is greater than 3. Patch by Svetlana Zhokolsky.


svn path=/branches/mono-1-0/mcs/; revision=41415
2005-03-03 22:20:51 +00:00
Gonzalo Paniagua Javier 111de944a3 2005-03-02 Gonzalo Paniagua Javier <[email protected]>
* SessionStateModule.cs:
	* SessionId.cs: share the same RNG for all the instances of
	SessionStateModule.


svn path=/branches/mono-1-0/mcs/; revision=41374
2005-03-02 20:20:53 +00:00
Gonzalo Paniagua Javier 9832a66418 forgot this in r41341
svn path=/branches/mono-1-0/mcs/; revision=41346
2005-03-01 23:47:26 +00:00
Gonzalo Paniagua Javier 95a9a08b5d 2005-03-01 Gonzalo Paniagua Javier <[email protected]>
* sockets.c: translate EINPROGRESS to EWOULDBLOCK in connect. This is
	the expected error code showed by the test case in bug #73053.


svn path=/branches/mono-1-0/mono/; revision=41345
2005-03-01 22:56:56 +00:00
Gonzalo Paniagua Javier 8cb68ba0cf 2005-03-01 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs: don't Poll/block in Connect aither.


svn path=/branches/mono-1-0/mcs/; revision=41341
2005-03-01 22:52:59 +00:00
Gonzalo Paniagua Javier 5edaf037fb 2005-03-01 Gonzalo Paniagua Javier <[email protected]>
* WebHeaderCollection.cs: handle commas inside quotes when splitting
	a multi-value header. Fixes bug #73151.


svn path=/branches/mono-1-0/mcs/; revision=41339
2005-03-01 22:33:23 +00:00
Gonzalo Paniagua Javier a8b5ec0a92 2005-03-01 Gonzalo Paniagua Javier <[email protected]>
* CSharpCodeCompiler.cs: mcs in 1-0 writes the errors to stdout while
	mcs HEAD writes to stderr... Fixes bug #73081.


svn path=/branches/mono-1-0/mcs/; revision=41337
2005-03-01 20:45:33 +00:00
Zoltan Varga 00790cd830 Merge from HEAD.
svn path=/branches/mono-1-0/mcs/; revision=41335
2005-03-01 18:35:51 +00:00
Gonzalo Paniagua Javier 6b21676368 2005-02-28 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs: don't block on Accept if the socket is non-blocking.
	Fixes bug #73053. Patch by Ankit Jain.


svn path=/branches/mono-1-0/mcs/; revision=41304
2005-03-01 01:22:09 +00:00
Gonzalo Paniagua Javier fa84087720 2005-02-28 Gonzalo Paniagua Javier <[email protected]>
* HttpRequest.cs: Path and FilePath also change when RewritePath is
	called. Fixes bug #73055.


svn path=/branches/mono-1-0/mcs/; revision=41302
2005-03-01 01:11:47 +00:00
Gonzalo Paniagua Javier 041f3217c6 undo r39948. See bugzilla #73073.
svn path=/branches/mono-1-0/mcs/; revision=41299
2005-03-01 00:34:23 +00:00
Gonzalo Paniagua Javier b8ccbf21b7 2005-02-27 Gonzalo Paniagua Javier <[email protected]>
* parser.cs: stuff inside {} might not be a quantifier. Fixes
	bug #69193.


svn path=/branches/mono-1-0/mcs/; revision=41254
2005-02-27 09:49:55 +00:00
Gonzalo Paniagua Javier b35faa74ef 2005-02-23 Gonzalo Paniagua Javier <[email protected]>
* WebControl.cs: correctly use TagName in RenderBeginTag, ie, if TagKey
	is zero, use the TagName no matter its value. Fixes bug #72415.


svn path=/branches/mono-1-0/mcs/; revision=41126
2005-02-24 00:59:54 +00:00
Gonzalo Paniagua Javier ddc5a7b388 2005-02-23 Gonzalo Paniagua Javier <[email protected]>
* FormsAuthentication.cs: make the string to be stored in a config.
	file uppercase... See bug #72557.


svn path=/branches/mono-1-0/mcs/; revision=41124
2005-02-24 00:10:55 +00:00
Sebastien Pouliot 3a2e93ef0d 2005-02-23 Sebastien Pouliot <[email protected]>
* HttpRequest.cs: Make sure that any access after a ValidateInput 
	throws an exception if the data isn't safe.


svn path=/branches/mono-1-0/mcs/; revision=41110
2005-02-23 19:30:10 +00:00
Gonzalo Paniagua Javier 82a06303f2 2005-02-22 Gonzalo Paniagua Javier <[email protected]>
* UnixEndPoint.cs: get the correct bytes when building the filename from
	a SocketAddress. Fixes bug #72850.


svn path=/branches/mono-1-0/mcs/; revision=41069
2005-02-22 22:35:30 +00:00
Gonzalo Paniagua Javier fd3326b3b7 2005-02-22 Gonzalo Paniagua Javier <[email protected]>
* HttpRequest.cs: fail on unicode full-width '<' and '>' too. Fixes
	a security report (http://secunia.com/advisories/14325) that wan't
	reported to us before public disclosure.


svn path=/branches/mono-1-0/mcs/; revision=41062
2005-02-22 20:03:04 +00:00
Gonzalo Paniagua Javier 4cffed6891 from 1.1
svn path=/branches/mono-1-0/mono/; revision=41050
2005-02-22 18:33:41 +00:00
Sureshkumar T 5ec4e9b3b6 2005-02-22 Sureshkumar T <[email protected]>
* OracleCommand.cs: set behavior for execute reader.
        fixes bug #72607.


svn path=/branches/mono-1-0/mcs/; revision=41023
2005-02-22 09:10:57 +00:00
Gonzalo Paniagua Javier 9935f5d5df 2005-02-18 Gonzalo Paniagua Javier <[email protected]>
* HttpResponse.cs: send the calculated content length even when it's 0.
	Fixes bug #72655.


svn path=/branches/mono-1-0/mcs/; revision=40881
2005-02-18 20:02:02 +00:00
Gonzalo Paniagua Javier a1ed913095 2005-02-13 Gonzalo Paniagua Javier <[email protected]>
* DigestClient.cs: fix for digest auth. and URIs containing query. Patch
	by James Wilcox. Fixes bug #72571.

svn path=/branches/mono-1-0/mcs/; revision=40598
2005-02-14 01:08:22 +00:00
Gonzalo Paniagua Javier 8b212efc30 2005-02-12 Gonzalo Paniagua Javier <[email protected]>
* HttpWebResponse.cs:
	* WebConnection.cs:
	* HttpWebRequest.cs:
	* WebConnectionStream.cs: don't read the entire response unless the
	user requests it. Fixes bug #72443.


svn path=/branches/mono-1-0/mcs/; revision=40560
2005-02-12 21:55:33 +00:00
Gonzalo Paniagua Javier 13a43e7792 2005-02-11 Gonzalo Paniagua Javier <[email protected]>
* AspGenerator.cs: don't fail on <tbody runat=server>. Fixes bug #71856.


svn path=/branches/mono-1-0/mcs/; revision=40508
2005-02-11 23:34:18 +00:00
Zoltan Varga 45bd71b7d8 Merge from HEAD.
svn path=/branches/mono-1-0/mcs/; revision=40495
2005-02-11 18:48:28 +00:00
Zoltan Varga 31be035834 Merge from HEAD.
svn path=/branches/mono-1-0/mcs/; revision=40494
2005-02-11 18:47:59 +00:00
Sebastien Pouliot a9e37c8b3d 2005-02-10 Sebastien Pouliot <[email protected]>
* DSA.cs: Fix to case where DSAParameters.Counter is 0.


svn path=/branches/mono-1-0/mcs/; revision=40407
2005-02-10 16:12:48 +00:00
Lluis Sanchez 3a73944449 2005-02-10 Lluis Sanchez Gual <[email protected]>
* SoapFormatter.cs: Don't store the SoapWriter in an instance field,
	it is not needed and it is not thread safe. This fixes bug #72344.
       * SoapReader.cs: Serialize byte arrays using base64 encoding.
         GetComponentType should always return the type if
         specified, GetId can now be !=0 for base64 arrrays.
       * SoapTypeMapper.cs: Register byte[] as base64 xml type.
       * SoapWriter.cs: Handle base64 encoded byte arrays.


svn path=/branches/mono-1-0/mcs/; revision=40390
2005-02-10 12:16:59 +00:00
Zoltan Varga 97b4ea90ac Merge from HEAD.
svn path=/branches/mono-1-0/mono/; revision=40339
2005-02-09 16:02:23 +00:00
Lluis Sanchez 045f16ce59 2005-02-07 Lluis Sanchez Gual <[email protected]>
* data/DefaultWsdlHelpGenerator.aspx: Don't use databinding where
	not needed.


svn path=/branches/mono-1-0/mono/; revision=40268
2005-02-07 20:45:52 +00:00
Lluis Sanchez a0761c74c2 2005-02-07 Lluis Sanchez Gual <[email protected]>
* XmlSerializationReader.cs: After reading an href element, skip the
	whole element (it may not be an empty element). This fixes bug #72265.


svn path=/branches/mono-1-0/mcs/; revision=40256
2005-02-07 17:47:24 +00:00
Lluis Sanchez b0460e112b 2005-02-07 Lluis Sanchez Gual <[email protected]>
* XmlReturnWriter.cs, SoapDocumentationHandler.cs: Use utf-8 encoding
	when generating xml responses, wsdl documents and schemas. This fixes
	bug #72202.


svn path=/branches/mono-1-0/mcs/; revision=40245
2005-02-07 15:21:06 +00:00
Raja R Harinath 7cebb19054 Backport fix from HEAD.
Patch from: 
Abin Thomas (NOSIP)  <[email protected]>
Anoob V E (NOSIP)  <[email protected]>
Harilal P R (NOSIP)  <[email protected]>
	Fix cs0164.cs.
	* statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
	(LabeledStatement.AddReference): New.  Set 'referenced'.
	(Goto.Resolve): Use it.

svn path=/branches/mono-1-0/mcs/; revision=40240
2005-02-07 14:44:29 +00:00
Raja R Harinath 0dbc3e0206 2005-02-07 Abin Thomas (NOSIP) <[email protected]>
Anoob V E (NOSIP)  <[email protected]>
	    Harilal P R (NOSIP)  <[email protected]>

	* class.cs (MethodCore.IsDuplicateImplementation): Make internal,
	not protected.
	(Operator.Define): Add test for error CS0111.

svn path=/branches/mono-1-0/mcs/; revision=40237
2005-02-07 13:12:52 +00:00
Raja R Harinath 37c3a6ad08 update to reflect current status
svn path=/branches/mono-1-0/mcs/; revision=40236
2005-02-07 10:21:01 +00:00
Raja R Harinath 24fafcee76 Really add it
svn path=/branches/mono-1-0/mcs/; revision=40234
2005-02-07 09:15:30 +00:00
Raja R Harinath 5f6ef46188 * Makefile (ILASM): New. Set MONO_PATH.
svn path=/branches/mono-1-0/mcs/; revision=40232
2005-02-07 08:52:35 +00:00
Gonzalo Paniagua Javier 1c49304140 2005-02-06 Gonzalo Paniagua Javier <[email protected]>
* FormsAuthentication.cs: fixed typo when getting the hash for the 
	password in SHA1 and MD5. Thanks to Tadas Dailyda.
	Lock on a static object instead of typeof(FormsAuthentication).


svn path=/branches/mono-1-0/mcs/; revision=40213
2005-02-06 17:30:07 +00:00
Gonzalo Paniagua Javier 5a14404a49 2005-02-06 Gonzalo Paniagua Javier <[email protected]>
* Test/System.IO/FileTest.cs: test for invalid characters in file names.
	* System.IO/File.cs: Exists does not throw when there are invalid
	characters in the file name.

	Patch by Gert Driesen.


svn path=/branches/mono-1-0/mcs/; revision=40210
2005-02-06 17:15:23 +00:00
Gonzalo Paniagua Javier 02e3e3006c 2005-02-05 Gonzalo Paniagua Javier <[email protected]>
* Activator.cs: provide the Type name when throwing an exception.


svn path=/branches/mono-1-0/mcs/; revision=40200
2005-02-06 01:02:16 +00:00
Gonzalo Paniagua Javier 79fd08d5de 2005-02-05 Gonzalo Paniagua Javier <[email protected]>
* SessionStateModule.cs: hack that makes static files work on sites that
	use the Session object in global.asax. You need to set
	MONO_XSP_STATIC_SESSION to enable it and by dong so you will lose a bit 
	of performance when serving static files. Fixes bug #71133.


svn path=/branches/mono-1-0/mcs/; revision=40194
2005-02-06 00:02:37 +00:00
Gonzalo Paniagua Javier 2ef37435a6 from HEAD. Note that some other fixes have not been backported
svn path=/branches/mono-1-0/mcs/; revision=40177
2005-02-05 18:14:14 +00:00
Gonzalo Paniagua Javier 2a7333427b from HEAD
svn path=/branches/mono-1-0/mcs/; revision=40176
2005-02-05 18:09:50 +00:00
Gonzalo Paniagua Javier 0a7b322811 2005-02-05 Gonzalo Paniagua Javier <[email protected]>
* TimeZone.cs: lock on the static Hashtable instead of 'this'. Fixes
	bug #72238.


svn path=/branches/mono-1-0/mcs/; revision=40165
2005-02-05 13:37:50 +00:00
Gonzalo Paniagua Javier 85957609af 2005-01-20 Jonathan Pryor <[email protected]>
* WebHeaderCollection.cs: Fix GetValues(string) to split the values on
	  commas if the header is a Multi-Value header.  This matches
	  MonoTests.System.Net.WebHeaderCollectionTest.


svn path=/branches/mono-1-0/mcs/; revision=40158
2005-02-04 23:27:05 +00:00
Gonzalo Paniagua Javier 6c7c77a687 2005-02-04 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: send the headers when we're supposed to write
	a POST/PUT but call GetResponse before GetRequestStream.

	* WebConnectionStream.cs: new RequestWritten property.

svn path=/branches/mono-1-0/mcs/; revision=40128
2005-02-04 12:42:49 +00:00
Sureshkumar T 91d8288423 2005-02-03 Sureshkumar T <[email protected]>
* SqlDateTime.cs : Parse : try with local culture first, then try
	with invariant culture if it fails.


svn path=/branches/mono-1-0/mcs/; revision=40039
2005-02-03 09:38:46 +00:00
Zoltan Varga 296b986374 2005-02-02 Zoltan Varga <[email protected]>
* object.c (mono_runtime_get_main_args): Fix stupid typo.

svn path=/branches/mono-1-0/mono/; revision=40005
2005-02-02 19:49:10 +00:00
Gonzalo Paniagua Javier 287b6672f1 2005-02-01 Gonzalo Paniagua Javier <[email protected]>
* TraceContext.cs: writing a message without any other argument is not
	a warniing. Fixes bug #72017.


svn path=/branches/mono-1-0/mcs/; revision=39950
2005-02-01 22:28:58 +00:00
Gonzalo Paniagua Javier df49fe942b 2005-02-01 Gonzalo Paniagua Javier <[email protected]>
* FormsAuthenticationModule.cs: allow accessing other files in the
	directory where the login page is. Fixes bug #71871.


svn path=/branches/mono-1-0/mcs/; revision=39948
2005-02-01 22:21:30 +00:00
Sureshkumar T 679c4b8044 In Test/System.Data:
2005-02-01  Sureshkumar T  <[email protected]>
	    Ankit Jain     <[email protected]>

	* DataRowTest.cs: Added case for SetparentRow: create
	DataRelations with createConstraints=false.
	
In System.Data:
2005-02-01  Sureshkumar T  <[email protected]>
	    Ankit Jain     <[email protected]>

        * DataRow.cs: SetParentRow (): use relation.ParentColumns &
	relation.ChildColumns instead of relation.ChildKeyConstraint.*
	because createConstrains flag may be false when creating data
	relations.


svn path=/branches/mono-1-0/mcs/; revision=39912
2005-02-01 05:54:19 +00:00
Ben Maurer e1eb581e8a 2005-01-31 Ben Maurer <[email protected]>
* StringBuilder.cs (Remove): We need to do the check that the
        string isnt being cached *before* we munge it.


svn path=/branches/mono-1-0/mcs/; revision=39888
2005-02-01 01:04:43 +00:00
Miguel de Icaza fd0db3b590 Update version to 1.0.6
svn path=/branches/mono-1-0/mcs/; revision=39885
2005-02-01 00:55:22 +00:00
Miguel de Icaza 5ae7f99470 Up
svn path=/branches/mono-1-0/mono/; revision=39884
2005-02-01 00:53:45 +00:00
Atsushi Eno 287faa9e56 2005-01-31 Atsushi Enomoto <[email protected]>
* NumberFormatInfo.cs : allow zero length sizes. patch by Kazuki
	  Oikawa.


svn path=/branches/mono-1-0/mcs/; revision=39854
2005-01-31 15:30:48 +00:00
Zoltan Varga 292676010f Merge from HEAD.
svn path=/branches/mono-1-0/mono/; revision=39848
2005-01-31 14:46:13 +00:00
Miguel de Icaza fef2b6723e Fix from Kazuki for #71297
svn path=/branches/mono-1-0/mcs/; revision=39824
2005-01-31 06:08:18 +00:00
Miguel de Icaza a28363adf9 2005-01-31 mei ([email protected])
* RegistryKey.cs: Fixes bug 70451: When the key doesn't exist, and
	the default value is not specified, it is necessary to return
	null. and DecodeString function's bug is fixed.

svn path=/branches/mono-1-0/mcs/; revision=39820
2005-01-31 05:56:59 +00:00
Zoltan Varga 9c7cea69f6 Merge from HEAD.
svn path=/branches/mono-1-0/mcs/; revision=39798
2005-01-30 13:42:22 +00:00
Zoltan Varga c46b58028a Merge from HEAD.
svn path=/branches/mono-1-0/mono/; revision=39756
2005-01-29 20:40:24 +00:00
Sureshkumar T edaaf203c5 In Test/System.Data:
2005-01-28  Sureshkumar T  <[email protected]>
                                                                                                                             
        * DataTableTest.cs: added test case for checking ImportRow when
        the row state is detached. Test case by Ankit Jain.

In System.Data:
2005-01-28  Sureshkumar T  <[email protected]>

        * DataRow.cs: CopyValuesToRow : set the column value with the
        default version of the given row.
        * DataTable.cs: ImportRow: Copy values before adding row.
        * DataSet.cs: AddChangedRow: Add the row to the table after
        copying values.
         
        Fixes bug #67317. Patch by Ankit Jain.


svn path=/branches/mono-1-0/mcs/; revision=39699
2005-01-28 13:16:55 +00:00
Paolo Molaro b3649da6d8 Wed Jan 26 17:49:45 CET 2005 Paolo Molaro <[email protected]>
* domain.c: fixed long standing bug in mono_string_equal().


svn path=/branches/mono-1-0/mono/; revision=39590
2005-01-26 16:37:29 +00:00
Lluis Sanchez 706593bbd2 2005-01-25 LLuis Sanchez Gual <[email protected]>
* Win32Exception.cs: Set the correct name for the serialized
	NativeErrorCode. This fixes bug #71572. Fix by Aleksandar Dezelin.


svn path=/branches/mono-1-0/mcs/; revision=39520
2005-01-25 17:54:32 +00:00
Lluis Sanchez 4878c6a2fc 2005-01-25 Lluis Sanchez Gual <[email protected]>
* XmlSchemaImporter.cs: When importing a default value of type enum,
	translate it from the schema value to the clr value.


svn path=/branches/mono-1-0/mcs/; revision=39516
2005-01-25 17:41:22 +00:00
Jonathan Pryor ff3d755b8b * support/Makefile.am: Add GLIB_CFLAGS to INCLUDE so that <glib.h> can be
found by support/macros.c.
  * support/macros.c: Use gint64, not long, to match C# declaration.
    Fixes 71152.

svn path=/branches/mono-1-0/mono/; revision=39506
2005-01-25 15:05:38 +00:00
Raja R Harinath 96057a1306 Fix #71602.
* mcs/expression.cs (MemberAccess.DoResolve): Backport fix from HEAD.
* tests/test-338.cs: New test for #71602.

svn path=/branches/mono-1-0/mcs/; revision=39497
2005-01-25 13:35:04 +00:00
Gonzalo Paniagua Javier 240f80d6c1 backported from HEAD
svn path=/branches/mono-1-0/mcs/; revision=39471
2005-01-25 05:16:34 +00:00
Zoltan Varga bf4c5178a3 2005-01-23 Zoltan Varga <[email protected]>
* mini.h mini.c exceptions-x86.c tramp-x86.c: Port global codeman
	changes from HEAD. Fixes #71615.

svn path=/branches/mono-1-0/mono/; revision=39379
2005-01-23 14:30:33 +00:00
Sebastien Pouliot d430dcb109 2005-01-21 Sebastien Pouliot <[email protected]>
* Assembly.cs: Fixed add for ModuleResolve.


svn path=/branches/mono-1-0/mcs/; revision=39327
2005-01-21 19:36:54 +00:00
Sebastien Pouliot de3d462b56 2005-01-21 Sebastien Pouliot <[email protected]>
* DSA.cs: Handle the case where DSAParameters.Counter is 0.


svn path=/branches/mono-1-0/mcs/; revision=39317
2005-01-21 18:02:41 +00:00
Gonzalo Paniagua Javier 4b4d4e3294 2005-01-20 Gonzalo Paniagua Javier <[email protected]>
* threadpool.c: increase the timeout for threads in the thread pool to 10s.
	Fixes bug #67159.


svn path=/branches/mono-1-0/mono/; revision=39293
2005-01-21 00:32:57 +00:00
Gonzalo Paniagua Javier d4f579ab0b 2005-01-20 Gonzalo Paniagua Javier <[email protected]>
* HttpApplication.cs: if there are no more handlers, finish the request and
	ensure we call Complete on it. Now FreeTextBox 3.0 works.

svn path=/branches/mono-1-0/mcs/; revision=39292
2005-01-20 23:11:58 +00:00
Gonzalo Paniagua Javier 389b183bc7 2005-01-20 Gonzalo Paniagua Javier <[email protected]>
* CheckBox.cs: when rendering the input tag inside a span tag, keep the
	attributes that are meant to be in the input tag in their place.


svn path=/branches/mono-1-0/mcs/; revision=39272
2005-01-20 20:24:30 +00:00
Sureshkumar T 531e7cd91f 2005-01-20 Sureshkumar T <[email protected]>
* OdbcDataReader.cs: case for type OdbcType.Double added in
	GetValue.  fixes bug #71173.

	Thanks to patch given by "Appasamy T" <[email protected]>


svn path=/branches/mono-1-0/mcs/; revision=39238
2005-01-20 08:33:25 +00:00
Sureshkumar T d3b0c4bd31 In Test/System.Data:
* DataRelationCollectionTest.cs: 
	        "Remove" Method: Should not throw
		exception while removing null data relaiton.
		"RemoveAt" Method: Should throw only IndexOutRange exception
		not ArgumentException.

	This is same for all MS.NET versions.

In System.Data:
	
	* DataRelationCollection.cs: 

	Method Remove : Donot throw exception if DataRelation argument is
	null in DataRelationCollection.Remove method.

	Method RemoveAt : Exception should be IndexOutOfRangeException if
	row index is not in list range.

	Fixes nunit failures DataRelationCollection.Remove and
	DataRelationCollection.RemoveAt.
	

svn path=/branches/mono-1-0/mcs/; revision=39177
2005-01-19 15:35:28 +00:00
Sureshkumar T 0998ee74e2 2005-01-19 Sureshkumar T <[email protected]>
* ConstraintCollection.cs: Donot throw exception if constraints
	are null in AddRange method. Check for null before using the
	argument.

	fixes bug #69381.


svn path=/branches/mono-1-0/mcs/; revision=39155
2005-01-19 13:48:47 +00:00
Sureshkumar T 8c41b83d93 * OdbcDataReader.cs: Implement NextResultSet for multiple result
set queries. 
	
	* OdbcDataReader.cs: build column schema once creating reader and
	then for each Next result set. Thanks to
	[email protected] (Sebastien Robitaille) for
	pointing out this optimization (bugzilla #70530).

	* libodbc.cs: Added library calls SQLFreeStmt and SQLMoreResults
	for mutiple resultsets.

2005-01-19  Sureshkumar T  <[email protected]>


svn path=/branches/mono-1-0/mcs/; revision=39138
2005-01-19 08:18:18 +00:00
Sureshkumar T 57a42d6d0d 2005-01-19 Sureshkumar T <[email protected]>
* OdbcDataReader.cs: Pass OdbcCType.SignedBigInt for accessing big
	int columns.

	* OdbcType.cs: Added a new enum for Odbc C DataTypes. This should
	essentially be passed to drivers, since the public OdbcType types
	differs from types expected in drivers in some cases.

	* libodbc.cs : Added a ODBC method which takes OdbcCType
	enumeration for SQLGetData for BigInt fields.

	fixes bug #65342.


svn path=/branches/mono-1-0/mcs/; revision=39137
2005-01-19 07:22:38 +00:00
Atsushi Eno 514ac424f5 2004-01-19 Atsushi Enomoto <[email protected]>
* XmlDiffLoader.cs : Ankit Jain <[email protected]> has a conflicting
	  patches and some good catches. Some attributes should be skipped,
	  and loaded value must be typed.



svn path=/branches/mono-1-0/mcs/; revision=39135
2005-01-19 07:03:27 +00:00
Atsushi Eno 4f0ea07f3d 2004-01-19 Atsushi Enomoto <[email protected]>
* XmlConstants.cs,
	  XmlDataInferenceLoader.cs, 
	  XmlDataReader.cs : use common const for http://www.w3.org/2000/xmlns/.
	* XmlDiffLoader.cs : It was not handling attributes. Fixed bug #70961.



svn path=/branches/mono-1-0/mcs/; revision=39133
2005-01-19 06:36:57 +00:00
Gonzalo Paniagua Javier 631bb74c09 applied from HEAD
svn path=/branches/mono-1-0/mcs/; revision=39116
2005-01-18 19:57:03 +00:00
Miguel de Icaza 2c20e28f89 Must not throw
svn path=/branches/mono-1-0/mcs/; revision=39095
2005-01-18 15:11:48 +00:00
Geoff Norton 974b4b8959 Revert this change by miguel to allow building on OSX.
svn path=/branches/mono-1-0/mono/; revision=38964
2005-01-14 21:57:39 +00:00
Miguel de Icaza 76f82a15ca Updated
svn path=/branches/mono-1-0/mono/; revision=38955
2005-01-14 19:15:27 +00:00
Miguel de Icaza 09e00de01e Fix makemap
svn path=/branches/mono-1-0/mcs/; revision=38954
2005-01-14 19:15:11 +00:00
Mike Kestner b363a4da0f 2005-01-13 Mike Kestner <[email protected]>
* driver.cs: use relative symlinks in package links.

svn path=/branches/mono-1-0/mcs/; revision=38906
2005-01-13 22:54:12 +00:00
Mike Kestner 70191fac33 man page changes for gacutil
svn path=/branches/mono-1-0/mono/; revision=38905
2005-01-13 22:53:50 +00:00
Gonzalo Paniagua Javier 331fb64c5a 2005-01-13 Gonzalo Paniagua Javier <[email protected]>
* CultureInfo.cs: the InvariantCulture returns false for
	IsNeutralCulture. Fixes bug #59716.


svn path=/branches/mono-1-0/mcs/; revision=38904
2005-01-13 22:34:45 +00:00
Gonzalo Paniagua Javier 8494cbf446 2005-01-13 Gonzalo Paniagua Javier <[email protected]>
* monoresgen.cs: s/monoresgen/resgen/. Open the destination file with
	FileMode.Create. Fixes bug #52105.


svn path=/branches/mono-1-0/mcs/; revision=38897
2005-01-13 21:24:25 +00:00
Raja R Harinath e6f5c6fafa In mcs:
Fix test-335.cs (bug #58126).
	* cs-parser.jay (argument): Split out non-expression parts of the
	rule into 'non_simple_argument'.
	(invocation_expression): Support parenthesized invocations with
	multiple arguments, and with single non-simple arguments.

In tests:
	* Makefile (TEST_SOURCES): Add test-335.cs from HEAD.
	(UNSAFE_SOURCES): Disable unsafe-9 and unsafe-10, as they're
	missing from the repository.


svn path=/branches/mono-1-0/mcs/; revision=38875
2005-01-13 15:14:02 +00:00
Raja R Harinath b7ffe85112 * Makefile.am (clean-local): Rename from 'clean' so as not to step
on automake's toes.

svn path=/branches/mono-1-0/mono/; revision=38873
2005-01-13 14:49:02 +00:00
Atsushi Eno 5073c9eac4 2005-01-13 Atsushi Enomoto <[email protected]>
* SerializationCodeGenerator.cs : the last merge was wrong. Fixed the
	  build.



svn path=/branches/mono-1-0/mcs/; revision=38872
2005-01-13 14:15:50 +00:00
Atsushi Eno 8149ddc0dc 2005-01-13 Atsushi Enomoto <[email protected]>
* XmlResolver.cs : throw ArgumentException in ResolveUri().



svn path=/branches/mono-1-0/mcs/; revision=38858
2005-01-13 08:21:11 +00:00
Gonzalo Paniagua Javier bef9afa7e0 2005-01-12 Gonzalo Paniagua Javier <[email protected]>
* BaseNumberConverter.cs: when the culture we get is null, set it to the
	default. Fixes bug #67033. Thanks to Sander Rijken.


svn path=/branches/mono-1-0/mcs/; revision=38828
2005-01-12 21:43:58 +00:00
Atsushi Eno 501bff4b28 2005-01-12 Atsushi Enomoto <[email protected]>
* SerializationCodeGeneratorConfiguration.cs,
	  SerializationCodeGenerator.cs : Added some generation configuration:
		<generateAsInternal>
			write custom reader/writer as internal classes.
		<noreader>, <nowriter>
			They make generation of reader and/or writer optional.
	* XmlSerializerNamespaces.cs :
	  Now it uses ListDictionary instead of Hashtable.
	* XmlSerializationWriter.cs : entries in XmlSerializerNamespaces are
	  written unless there is already the same prefix-ns mapping.


svn path=/branches/mono-1-0/mcs/; revision=38785
2005-01-12 14:13:33 +00:00
Atsushi Eno 9441155d29 2004-01-12 Atsushi Enomoto <[email protected]>
* DataSet.cs : When serializing DataTable, BuildSchema() is passed
	  null relation collections.
	  Quick fix for XmlSerializer deserialization. It does not require
	  XML Schema included.



svn path=/branches/mono-1-0/mcs/; revision=38782
2005-01-12 13:54:03 +00:00
Lluis Sanchez 388ab08ce7 2005-01-12 Lluis Sanchez Gual <[email protected]>
* XmlTypeMapElementInfo.cs: Added new IndexOfElement method.
	* XmlSchemaImporter.cs: When importing a base type of a complex type,
	make sure that the base class is always imported as a class and not
	as an array. If it has been imported as array, import it again.
	This fixes bug #70839. Other minor fixes as well.
	* XmlSerializationWriter.cs: Fixed warning.


svn path=/branches/mono-1-0/mcs/; revision=38755
2005-01-12 01:44:21 +00:00
Gonzalo Paniagua Javier ffdb6bc1b3 2005-01-11 Gonzalo Paniagua Javier <[email protected]>
* System.Text/StringBuilder.cs: when creating the StringBuilder from a
	string, the maximum capacity remains Int32.MaxValue.

	* Test/System.Text/StringBuilderTest.cs: new tests for capacity when
	the StringBuilder is created from a string.


svn path=/branches/mono-1-0/mcs/; revision=38736
2005-01-11 22:05:14 +00:00
Atsushi Eno b9a06db813 2005-01-11 Atsushi Enomoto <[email protected]>
* XmlSchema.cs : Write() should handle carefully output
	  namespace/prefix mapping.



svn path=/branches/mono-1-0/mcs/; revision=38719
2005-01-11 18:31:55 +00:00
Atsushi Eno 97007fdaab 2005-01-11 Atsushi Enomoto <[email protected]>
* XmlTextWriter.cs : WriteComment() was outputting extraneous EOL.



svn path=/branches/mono-1-0/mcs/; revision=38703
2005-01-11 16:01:05 +00:00
Dick Porter 2df4f9497c 2005-01-11 Dick Porter <[email protected]>
* error.c (errno_to_WSA): Add EADDRNOTAVAIL error code
        translation.



svn path=/branches/mono-1-0/mono/; revision=38690
2005-01-11 13:13:48 +00:00
Sureshkumar T 9886f44127 2005-01-11 Sureshkumar T <[email protected]>
* OdbcDataReader.cs: Connection has to be closed only after
	Statement handle is freed. fixes bug #70048


svn path=/branches/mono-1-0/mcs/; revision=38675
2005-01-11 04:51:10 +00:00
Daniel Morgan 6a0c7b72ae 2005-01-10 Daniel Morgan <[email protected]>
* Mono.Data.SybaseClient/SybaseConnection.cs: fix 
	for packetSize not being set.  Fixes bug 70930
	Thanks to [email protected] (Sebastien Robitaille)
	for reporting this bug.

svn path=/branches/mono-1-0/mcs/; revision=38669
2005-01-11 02:17:02 +00:00
Gonzalo Paniagua Javier fa037f5592 Synched with HEAD
svn path=/branches/mono-1-0/mcs/; revision=38655
2005-01-10 22:45:52 +00:00
Gonzalo Paniagua Javier c632c4a99e Synched with HEAD
svn path=/branches/mono-1-0/mcs/; revision=38652
2005-01-10 22:37:47 +00:00
Juraj Skripsky a17df477d7 2005-01-10 Juraj Skripsky <[email protected]>
* RepeatInfo.cs: fixed bug #68927 (DataList with RepeatLayout='Flow'
	generates invalid html).


svn path=/branches/mono-1-0/mcs/; revision=38646
2005-01-10 20:20:43 +00:00
Paolo Molaro 4e997ec5a9 Mon Jan 10 20:30:19 CET 2005 Paolo Molaro <[email protected]>
* atomic.h: fix some functions on ppc (tests/interlocked.cs).


svn path=/branches/mono-1-0/mono/; revision=38642
2005-01-10 19:53:43 +00:00
Gonzalo Paniagua Javier b483058ea3 2005-01-10 Gonzalo Paniagua Javier <[email protected]>
* System.Text/StringBuilder.cs: throw if the new size is greater than
	the maximum capacity for the StringBuilder. Patch by [email protected].
	Fixes bug #62422.

	* Test/System.Text/StringBuilderTest.cs: patch to test for capacity
	being exceeded.


svn path=/branches/mono-1-0/mcs/; revision=38641
2005-01-10 19:51:56 +00:00
Dick Porter c96297b587 2005-01-10 Dick Porter <[email protected]>
* misc.c (_wapi_calc_timeout): Guard against overflow when
        calculating timeouts.  This makes waiting with a large
        (Int32.MaxValue) timeout not return immediately.



svn path=/branches/mono-1-0/mono/; revision=38631
2005-01-10 17:05:21 +00:00
Lluis Sanchez d9b6dc6151 2005-01-10 Lluis Sanchez Gual <[email protected]>
* BinaryCommon.cs: IntPtr is not a primitive type in the serialization
	world. This fixes bug #70757.


svn path=/branches/mono-1-0/mcs/; revision=38627
2005-01-10 16:09:47 +00:00
Sebastien Pouliot 3f95f8a3ba 2005-01-08 Sebastien Pouliot <[email protected]>
* BitConverter.cs: Reverted my patch from 2004-11-15 as this is true
	only for Fx 2.0+.


svn path=/branches/mono-1-0/mcs/; revision=38557
2005-01-09 00:52:36 +00:00
Paolo Molaro 1cede3cba3 Sat Jan 8 19:03:26 CET 2005 Paolo Molaro <[email protected]>
* loader.c: for P/Invoke methods, allow the "Internal" shared
	library name to refer to the calling process symbol namespace.


svn path=/branches/mono-1-0/mono/; revision=38530
2005-01-08 18:31:10 +00:00
Miguel de Icaza 32a701dc4c Backport
svn path=/branches/mono-1-0/mcs/; revision=38518
2005-01-08 06:25:44 +00:00
Dick Porter 57b3fe75e0 2005-01-07 Dick Porter <[email protected]>
* threads.c: 
        * monitor.c: Update thread state during Monitor and WaitHandle
        waits.  Fixes bug 71031.



svn path=/branches/mono-1-0/mono/; revision=38492
2005-01-07 15:01:03 +00:00
Zoltan Varga d6400d10a7 2005-01-07 Zoltan Varga <[email protected]>
* reflection.c (property_encode_signature): Correctly handle when the
	property has no methods.

svn path=/branches/mono-1-0/mono/; revision=38488
2005-01-07 13:52:16 +00:00
Zoltan Varga 1a741c2b80 Merge from HEAD.
svn path=/branches/mono-1-0/mono/; revision=38459
2005-01-06 19:52:03 +00:00
Zoltan Varga 15b02a6f60 2005-01-06 Zoltan Varga <[email protected]>
* marshal.c (emit_ptr_to_str_conv): Fix 1.0 build.

svn path=/branches/mono-1-0/mono/; revision=38450
2005-01-06 18:47:08 +00:00
Zoltan Varga 3461853696 2005-01-06 Zoltan Varga <[email protected]>
* marshal.c (emit_ptr_to_str_conv): Add support for 
	ByValTStr -> string conversion. Fixes #71015.

svn path=/branches/mono-1-0/mono/; revision=38438
2005-01-06 16:35:57 +00:00
Ben Maurer ef6b6383f2 oops
svn path=/branches/mono-1-0/mcs/; revision=38404
2005-01-05 23:49:29 +00:00
Zoltan Varga 2c8cddad17 Merge from HEAD.
svn path=/branches/mono-1-0/mono/; revision=38366
2005-01-05 17:38:05 +00:00
Sebastien Pouliot a4ff149320 2005-01-03 Sebastien Pouliot <[email protected]>
* DESCryptoServiceProvider.cs: Now using pre-computed tables (instead
	of using a static constructor to compute them). Not much change 
	performance-wise unless you used DES but only "a little" ;-). The old
	code (who computed the results) is still present but commented,
	Refactored ECB/ProcessBlock to allow TripleDES to be more efficient by
	using the permutations itself. 
	* TripleDESCryptoServiceProvider.cs: Removed memory allocation in 
	Transform's ECB method. Changed code to directly call DES's 
	permutations. MACTripleDES is now 20% faster (didn't have any other
	3DES benchmark on hand) and requires much less memory.


svn path=/branches/mono-1-0/mcs/; revision=38284
2005-01-03 19:09:23 +00:00
Sebastien Pouliot 9a2632e1ef * SHA256Managed.cs: Removed memory allocation in ProcessBlock method
(now global). This gives up to 5% performance increase when multiple 
	blocks are being used.

svn path=/branches/mono-1-0/mcs/; revision=38238
2005-01-02 20:35:43 +00:00
Sebastien Pouliot b491f84400 2005-01-02 Sebastien Pouliot <[email protected]>
* SHA1CryptoServiceProvider.cs: Removed memory allocation in 
	ProcessBlock method (now global). This gives up to 8% performance
	increase when multiple blocks are being used.


svn path=/branches/mono-1-0/mcs/; revision=38234
2005-01-02 19:02:00 +00:00
Ben Maurer 84b9050333 merge from head
svn path=/branches/mono-1-0/mcs/; revision=38232
2005-01-02 17:40:13 +00:00
Jonathan Pryor e982daf3c5 * Syscall.cs: All syscall_ functions should explicitly specify EntryPoint
so that an EntryPointNotFoundException is avoided.  Fixes 70706.

svn path=/branches/mono-1-0/mcs/; revision=38180
2004-12-30 13:06:41 +00:00
Zoltan Varga e1645332ae Merge from HEAD.
svn path=/branches/mono-1-0/mono/; revision=38167
2004-12-29 22:03:58 +00:00
Gonzalo Paniagua Javier 7c30a22d95 2004-12-28 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs: for Receive*/Send*, don't set the connected status to false
	when the error is EINPROGRESS or EWOULDBLOCK.


svn path=/branches/mono-1-0/mcs/; revision=38129
2004-12-28 12:09:29 +00:00
Sebastien Pouliot fdd5c8f1ef 2004-12-22 Sebastien Pouliot <[email protected]>
* RSA.cs: Throw the proper CryptographicException exception when 
	exporting a private key without CRT parameters, while keeping the
	ArgumentNullException when the private exponent (D) is missing.


svn path=/branches/mono-1-0/mcs/; revision=38053
2004-12-22 19:36:59 +00:00
Ben Maurer 914a6c7591 merge the fix for 65827 into head
svn path=/branches/mono-1-0/mcs/; revision=38020
2004-12-21 04:01:07 +00:00
Atsushi Eno 58ec72cc8e 2004-12-21 Atsushi Enomoto <[email protected]>
* DateTime.cs : If no progress on value string, don't regard as
	  matched. This fixes bug #70707.



svn path=/branches/mono-1-0/mcs/; revision=38018
2004-12-21 03:14:56 +00:00
Gonzalo Paniagua Javier 16c85760eb 2004-12-21 Gonzalo Paniagua Javier <[email protected]>
* HttpRequest.cs: honor the maxRequestSize limit from machine.config.


svn path=/branches/mono-1-0/mcs/; revision=38015
2004-12-21 02:59:13 +00:00
Gonzalo Paniagua Javier 3257e26217 2004-12-21 Gonzalo Paniagua Javier <[email protected]>
* BufferedStream.cs: use Buffer.BlockCopyInternal instead of Array.Copy.


svn path=/branches/mono-1-0/mcs/; revision=38013
2004-12-21 02:23:52 +00:00
Gonzalo Paniagua Javier b0d5e6580b 2004-12-21 Gonzalo Paniagua Javier <[email protected]>
* ThreadAbortException.cs: added private serialization .ctor.


svn path=/branches/mono-1-0/mcs/; revision=38010
2004-12-21 00:34:58 +00:00
Lluis Sanchez d1518010c1 2004-12-20 Lluis Sanchez Gual <[email protected]>
* Hashtable.cs: Check for null serialization info in OnDeserialization.
	A hashtable subclass can fully override the constructor, so
	serializationInfo would be null in this case. Fixes bug #70698.


svn path=/branches/mono-1-0/mcs/; revision=37989
2004-12-20 18:26:21 +00:00
Gonzalo Paniagua Javier ecd4a4a91b 2004-12-16 Gonzalo Paniagua Javier <[email protected]>
* ArrayList.cs: don't initialize _items twice. Closes bug #70620.


svn path=/branches/mono-1-0/mcs/; revision=37962
2004-12-20 11:14:22 +00:00
Daniel Morgan 9af5b74c89 add missing ChangeLog file added in previous commit
svn path=/branches/mono-1-0/mcs/; revision=37947
2004-12-19 23:42:49 +00:00
Daniel Morgan eb6c6eeb2c 2004-12-19 Daniel Morgan <[email protected]>
* OracleCommand.cs: ExecuteReader needs to be able 
	to handle non queries too (retrofitted from trunk)
	
	* ChangeLog: added file

svn path=/branches/mono-1-0/mcs/; revision=37946
2004-12-19 23:42:13 +00:00
Lluis Sanchez ebdbaa1a6b 2004-12-17 Lluis Sanchez Gual <[email protected]>
* TcpMessageIO.cs: Removed some more WriteByte calls.
	* TcpClientTransportSink.cs: Flush the net stream after writing
	a message.


svn path=/branches/mono-1-0/mcs/; revision=37878
2004-12-17 12:06:00 +00:00
Lluis Sanchez b80fb16653 2004-12-17 Lluis Sanchez Gual <[email protected]>
* HttpHelper.cs: Removed unused method. Optimized CopyStream method.
	* HttpServerChannel.cs: SendResponse does not return a bool any
	  more, it throws an exception when it fails.
	* HttpServer.cs: Improved handling of errors.


svn path=/branches/mono-1-0/mcs/; revision=37877
2004-12-17 12:05:46 +00:00
Lluis Sanchez f11407839d 2004-12-16 Lluis Sanchez Gual <[email protected]>
* Hashtable.cs: Add deserialized elements in OnDeserialization, since
	when the serialization constructor is called, some of the elements
	may not yet be fully deserialized. This fixes bug #70570.


svn path=/branches/mono-1-0/mcs/; revision=37831
2004-12-16 13:07:53 +00:00
Gonzalo Paniagua Javier fbe08afa0a 2004-12-15 Gonzalo Paniagua Javier <[email protected]>
* System.Web/HttpApplication.cs: reread application CultureInfo as
	web.config might have changed. Fixes bug #62539.

	* System.Web.Configuration/WebConfigurationSettings.cs: correctly
	detect web.config changes.


svn path=/branches/mono-1-0/mcs/; revision=37780
2004-12-15 13:04:33 +00:00
Gonzalo Paniagua Javier f4741866e0 2004-12-15 Gonzalo Paniagua Javier <[email protected]>
* HtmlForm.cs: MakeRelative() can be null. Thanks to Denis Gervaille.


svn path=/branches/mono-1-0/mcs/; revision=37778
2004-12-15 11:09:07 +00:00
Gonzalo Paniagua Javier 90fb34509f 2004-12-14 Gonzalo Paniagua Javier <[email protected]>
* WebConnectionStream.cs: remove unneeded check. Write detects and
	triggers the exception now.


svn path=/branches/mono-1-0/mcs/; revision=37746
2004-12-14 13:33:04 +00:00
Gonzalo Paniagua Javier 3944dabece 2004-12-14 Gonzalo Paniagua Javier <[email protected]>
* AuthenticationManager.cs: don't lock on a public Type.
	* HttpWebRequest.cs: read the error response for auth. errors.


svn path=/branches/mono-1-0/mcs/; revision=37733
2004-12-14 09:55:37 +00:00
Gonzalo Paniagua Javier 0252a4b423 2004-12-14 Gonzalo Paniagua Javier <[email protected]>
* ControlCollection.cs: fix off-by-one and store a null at the end to
	remove the reference to the removed control.


svn path=/branches/mono-1-0/mcs/; revision=37726
2004-12-14 05:28:16 +00:00
Gonzalo Paniagua Javier caf2a1cdab 2004-12-13 Gonzalo Paniagua Javier <[email protected]>
* io.c: check for the existence of 'dest' and set ERROR_ALREADY_EXISTS
	if it exists and is not the same as 'src'.


svn path=/branches/mono-1-0/mono/; revision=37716
2004-12-14 03:47:55 +00:00
Gonzalo Paniagua Javier f8aca10bb8 2004-12-13 Gonzalo Paniagua Javier <[email protected]>
* File.cs: delegate to the runtime the task of checking for destination
	file existence in Move.


svn path=/branches/mono-1-0/mcs/; revision=37715
2004-12-14 03:47:21 +00:00
Gonzalo Paniagua Javier 41b5ad6a5e 2004-12-12 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: set webResponse back to null when redirecting.
	Fix the previous patch so that it reads the whole response even if
	auto-redirect is not enabled. Closes bug #70484.

svn path=/branches/mono-1-0/mcs/; revision=37671
2004-12-12 22:59:35 +00:00
Gonzalo Paniagua Javier 6ccf1cf6f7 2004-12-12 Gonzalo Paniagua Javier <[email protected]>
* HttpWebResponse.cs: added ReadAll method.

	* WebConnection.cs: in HandleError, set the response error after
	closing the socket. Use an async. delegate to finish reading any prior
	WebConnectionStream.

	* HttpWebRequest.cs: for error responses that allow content, read the
	stream immediately. Fixes bug #70483.

svn path=/branches/mono-1-0/mcs/; revision=37665
2004-12-12 20:43:42 +00:00
Geoff Norton 1e4a215c2d Backport the following fixes:
* SearchPattern.cs:  Have IsMatch(string)
        call IsMatch(string, bool) to avoid setting a instance variable in a
        method that logically should not be changing it.
        * KeventWatcher.cs: Add IDisposable to our kevent struct
        so the disposer gets called.  Fixes a small memory leak.  Dont monitor
        LastAccessedTime for changed files, as this will cause AppUnloading in XSP
        when global.asax is accessed after creation.  Use a case-insensitive IsMatch
        to deal with OSX Case-aware/Case-insensitive filesystem.
        * SearchPattern.cs: Add a overload to IsMatch to explicitly set
        the ignore field for OSX case-aware yet case-insensitive filesystem.  This
        allows monitoring of global.asax to happen properly.
        * KeventWatcher.cs:  Dont marshal a string to a struct
        that the kernel will hold; this causes a double free bug.  Marshal
        it as a IntPtr and clean it up in the dispose method.  Don't pass
        FullName to the pattern matcher, pass the filename.  Fixes bug #69692.

svn path=/branches/mono-1-0/mcs/; revision=37635
2004-12-11 08:17:32 +00:00
Gonzalo Paniagua Javier 9d08ee3eb4 2004-11-29 Gonzalo Paniagua Javier <[email protected]>
* HttpApplicationFactory.cs: monitor changes in global.asax and bin
	directory and shutdown the application when that happens. Fixes bug
	#49651.

svn path=/branches/mono-1-0/mcs/; revision=37633
2004-12-11 08:02:53 +00:00
Gonzalo Paniagua Javier a0698673af backported Cookie changes from HEAD
svn path=/branches/mono-1-0/mcs/; revision=37632
2004-12-11 08:00:22 +00:00
Gonzalo Paniagua Javier a1af0eb692 2004-12-10 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs:
	* WebConnectionStream.cs: removed TryReconnect. It's no longer needed.


svn path=/branches/mono-1-0/mcs/; revision=37631
2004-12-11 07:45:40 +00:00
Ben Maurer 3f13a7d7fa re merge the patch for bug 69926 into head. I made a stupid cut and paste typo and removed the Finally block from the using clause
svn path=/branches/mono-1-0/mcs/; revision=37623
2004-12-11 03:24:09 +00:00
Lluis Sanchez 9515522172 2004-12-10 Lluis Sanchez Gual <[email protected]>
* TcpChannel.cs: Don't use regular expressions to parse the url, it's
	too slow.
	* TcpMessageIO.cs: Read byte chunks using the new StreamRead method,
	which won't block if the connection is closed.
	* TcpServerChannel.cs: Flush the stream after writing the response.
	Wrap the close call in a try/catch (some bytes can be left in the
	buffered stream if a connection is suddently closed, and it will fail
	when trying to flush them).


svn path=/branches/mono-1-0/mcs/; revision=37565
2004-12-10 11:46:37 +00:00
Lluis Sanchez 110fdf3ba2 2004-12-09 Lluis Sanchez Gual <[email protected]>
* SerializationCodeGenerator.cs: Yet another generation fix.


svn path=/branches/mono-1-0/mcs/; revision=37524
2004-12-09 21:06:25 +00:00
Lluis Sanchez e259703198 2004-12-09 Lluis Sanchez Gual <[email protected]>
* TcpConnectionPool.cs: Access the socket stream through a
	BufferedStream.
	* TcpMessageIO.cs: Avoid ReadByte().
	* TcpServerChannel.cs: Access the socket stream through a
	BufferedStream. Abort the connection if an unknown message is received.
	All this fixes performance bug #70337.


svn path=/branches/mono-1-0/mcs/; revision=37521
2004-12-09 20:51:41 +00:00
Lluis Sanchez 226ae644f9 2004-12-09 Lluis Sanchez Gual <[email protected]>
* SerializationCodeGenerator.cs: Fixed generation of enum literals.


svn path=/branches/mono-1-0/mcs/; revision=37488
2004-12-09 13:59:21 +00:00
Lluis Sanchez 4bc298c411 2004-12-09 Lluis Sanchez Gual <[email protected]>
* ValueCollectionParameterReader.cs: Parse parameters in the correct
	way, Convert.ChangeType is not enough. This fixes bug #70266.
	Removed some types that are not supported as parameters.
	* MimeFormatter.cs: Added methods for xml <-> object conversion.
	* UrlEncodedParameterWriter.cs: Use a more elaborate method for converting
	from object to string, ToString() is not enough.


svn path=/branches/mono-1-0/mcs/; revision=37486
2004-12-09 13:53:31 +00:00
Lluis Sanchez 575598549b 2004-12-09 Lluis Sanchez Gual <[email protected]>
* ObjectManager.cs: When deserializing an object that implements
	ISerializable, check if a surrogate	exists for that object, before
	trying to deserialize it as ISerializable. This fixes bug #70104.


svn path=/branches/mono-1-0/mcs/; revision=37481
2004-12-09 11:28:20 +00:00
Lluis Sanchez 8f2b0ac63e 2004-12-09 Lluis Sanchez Gual <[email protected]>
* SerializationTest.cs: Added test for bug #70104.


svn path=/branches/mono-1-0/mcs/; revision=37480
2004-12-09 11:27:53 +00:00
Zoltan Varga fc43c289a7 Merge from HEAD.
svn path=/branches/mono-1-0/mono/; revision=37438
2004-12-08 22:54:20 +00:00
Zoltan Varga 917cfd14e8 Merge from HEAD.
svn path=/branches/mono-1-0/mcs/; revision=37419
2004-12-08 20:42:49 +00:00
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
332 changed files with 10145 additions and 3404 deletions

No files matched your search

+12
View File
@@ -1,3 +1,15 @@
2005-02-07 Lluis Sanchez Gual <[email protected]>
* data/DefaultWsdlHelpGenerator.aspx: Don't use databinding where
not needed.
2005-01-25 Jonathan Pryor <[email protected]>
* support/Makefile.am: Add GLIB_CFLAGS to INCLUDE so that <glib.h> can be
found by support/macros.c.
* support/macros.c: Use gint64, not long, to match C# declaration.
Fixes 71152.
2004-10-14 Joe Shaw <[email protected]>
* man/mono.1: Fix the syntax of the M: trace syntax
+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.6)
AM_MAINTAINER_MODE
AC_PROG_LN_S
+43 -33
View File
@@ -337,7 +337,9 @@ string GetTestResult ()
try
{
WebRequest req = WebRequest.Create (location + "/" + CurrentOperationName + "?" + qs);
string url = location + "/" + CurrentOperationName;
Uri uri = new Uri (url);
WebRequest req = WebRequest.Create (url + "?" + qs);
HttpCookieCollection cookies = Request.Cookies;
int last = cookies.Count;
if (last > 0) {
@@ -345,7 +347,7 @@ string GetTestResult ()
for (int i = 0; i < last; i++) {
HttpCookie hcookie = cookies [i];
Cookie cookie = new Cookie (hcookie.Name, hcookie.Value, hcookie.Path, hcookie.Domain);
container.Add (cookie);
container.Add (uri, cookie);
}
((HttpWebRequest) req).CookieContainer = container;
}
@@ -940,15 +942,23 @@ public class HtmlSampleGenerator: SampleGenerator
}
// Serialize headers
bool writtenHeader = false;
foreach (object ob in msgbin.Extensions)
{
SoapHeaderBinding hb = ob as SoapHeaderBinding;
if (hb == null) continue;
xtw.WriteStartElement ("soap", "Header", SoapEnvelopeNamespace);
if (!writtenHeader) {
xtw.WriteStartElement ("soap", "Header", SoapEnvelopeNamespace);
writtenHeader = true;
}
WriteHeader (xtw, hb);
xtw.WriteEndElement ();
}
if (writtenHeader)
xtw.WriteEndElement ();
// Serialize body
xtw.WriteStartElement ("soap", "Body", SoapEnvelopeNamespace);
@@ -1576,7 +1586,7 @@ function clearForm ()
<span class="bindingLabel"><%#FormatBindingName(DataBinder.Eval(Container.DataItem, "Name").ToString())%></span>
<asp:repeater id="OperationsRepeater" runat=server datasource='<%# ((Binding)Container.DataItem).Operations %>'>
<itemtemplate>
<a class="method" href="<%#PageName%>?<%#GetTabContext("op",null)%>op=<%#GetOpName(Container.DataItem)%>&bnd=<%#DataBinder.Eval(Container.DataItem, "Binding.Name")%>"><%#GetOpName(Container.DataItem)%></a>
<a class="method" href="<%=PageName%>?<%=GetTabContext("op",null)%>op=<%#GetOpName(Container.DataItem)%>&bnd=<%#DataBinder.Eval(Container.DataItem, "Binding.Name")%>"><%#GetOpName(Container.DataItem)%></a>
<div class="smallSeparator"></div>
</itemtemplate>
</asp:repeater>
@@ -1594,7 +1604,7 @@ function clearForm ()
-->
<p class="label">Web Service Overview</p>
<%#WebServiceDescription%>
<%=WebServiceDescription%>
<%} if (DefaultBinding == null) {%>
This service does not contain any public web method.
@@ -1605,7 +1615,7 @@ This service does not contain any public web method.
Operation description
-->
<span class="operationTitle"><%#CurrentOperationName%></span>
<span class="operationTitle"><%=CurrentOperationName%></span>
<br><br>
<% WriteTabs (); %>
<br><br><br>
@@ -1647,12 +1657,12 @@ This service does not contain any public web method.
<span class="label">Remarks</span>
<div class="smallSeparator"></div>
<%#OperationDocumentation%>
<%=OperationDocumentation%>
<br><br>
<span class="label">Technical information</span>
<div class="smallSeparator"></div>
Format: <%#CurrentOperationFormat%>
<br>Supported protocols: <%#CurrentOperationProtocols%>
Format: <%=CurrentOperationFormat%>
<br>Supported protocols: <%=CurrentOperationProtocols%>
<% } %>
<!--
@@ -1663,11 +1673,11 @@ This service does not contain any public web method.
<% if (CurrentTab == "test") {
if (CurrentOperationSupportsTest) {%>
Enter values for the parameters and click the 'Invoke' button to test this method:<br><br>
<form action="<%#PageName%>" method="GET">
<input type="hidden" name="page" value="<%#CurrentPage%>">
<input type="hidden" name="tab" value="<%#CurrentTab%>">
<input type="hidden" name="op" value="<%#CurrentOperationName%>">
<input type="hidden" name="bnd" value="<%#CurrentOperationBinding%>">
<form action="<%=PageName%>" method="GET">
<input type="hidden" name="page" value="<%=CurrentPage%>">
<input type="hidden" name="tab" value="<%=CurrentTab%>">
<input type="hidden" name="op" value="<%=CurrentOperationName%>">
<input type="hidden" name="bnd" value="<%=CurrentOperationBinding%>">
<input type="hidden" name="ext" value="testform">
<table class="paramFormTable" cellspacing="0" cellpadding="3">
<asp:repeater id="InputFormParamsRepeater" runat=server>
@@ -1681,9 +1691,9 @@ This service does not contain any public web method.
<tr><td></td><td><input class="button" type="submit" value="Invoke">&nbsp;<input class="button" type="button" onclick="clearForm()" value="Clear"></td></tr>
</table>
</form>
<div id="testFormResult" style="display:<%# (HasFormResult?"block":"none") %>">
<div id="testFormResult" style="display:<%= (HasFormResult?"block":"none") %>">
The web service returned the following result:<br/><br/>
<div class="codePanel"><%#GetTestResult()%></div>
<div class="codePanel"><%=GetTestResult()%></div>
</div>
<% } else {%>
The test form is not available for this operation because it has parameters with a complex structure.
@@ -1703,25 +1713,25 @@ This service does not contain any public web method.
<% if (IsOperationSupported ("Soap")) { %>
<span class="label">Soap</span>
<br/><br/>
<div class="codePanel"><div class="code-xml"><%#GenerateOperationMessages ("Soap", true)%></div></div>
<div class="codePanel"><div class="code-xml"><%=GenerateOperationMessages ("Soap", true)%></div></div>
<br/>
<div class="codePanel"><div class="code-xml"><%#GenerateOperationMessages ("Soap", false)%></div></div>
<div class="codePanel"><div class="code-xml"><%=GenerateOperationMessages ("Soap", false)%></div></div>
<br/>
<% } %>
<% if (IsOperationSupported ("HttpGet")) { %>
<span class="label">HTTP Get</span>
<br/><br/>
<div class="codePanel"><div class="code-xml"><%#GenerateOperationMessages ("HttpGet", true)%></div></div>
<div class="codePanel"><div class="code-xml"><%=GenerateOperationMessages ("HttpGet", true)%></div></div>
<br/>
<div class="codePanel"><div class="code-xml"><%#GenerateOperationMessages ("HttpGet", false)%></div></div>
<div class="codePanel"><div class="code-xml"><%=GenerateOperationMessages ("HttpGet", false)%></div></div>
<br/>
<% } %>
<% if (IsOperationSupported ("HttpPost")) { %>
<span class="label">HTTP Post</span>
<br/><br/>
<div class="codePanel"><div class="code-xml"><%#GenerateOperationMessages ("HttpPost", true)%></div></div>
<div class="codePanel"><div class="code-xml"><%=GenerateOperationMessages ("HttpPost", true)%></div></div>
<br/>
<div class="codePanel"><div class="code-xml"><%#GenerateOperationMessages ("HttpPost", false)%></div></div>
<div class="codePanel"><div class="code-xml"><%=GenerateOperationMessages ("HttpPost", false)%></div></div>
<br/>
<% } %>
@@ -1731,21 +1741,21 @@ This service does not contain any public web method.
**********************************************************
Client Proxy
-->
<form action="<%#PageName%>" name="langForm" method="GET">
<form action="<%=PageName%>" name="langForm" method="GET">
Select the language for which you want to generate a proxy
<input type="hidden" name="page" value="<%#CurrentPage%>">&nbsp;
<input type="hidden" name="page" value="<%=CurrentPage%>">&nbsp;
<SELECT name="lang" onchange="langForm.submit()">
<%#GetOptionSel("cs",CurrentLanguage)%>C#</option>
<%#GetOptionSel("vb",CurrentLanguage)%>Visual Basic</option>
<%=GetOptionSel("cs",CurrentLanguage)%>C#</option>
<%=GetOptionSel("vb",CurrentLanguage)%>Visual Basic</option>
</SELECT>
&nbsp;&nbsp;
</form>
<br>
<span class="label"><%#CurrentProxytName%></span>&nbsp;&nbsp;&nbsp;
<a href="<%#PageName + "?code=" + CurrentLanguage%>">Download</a>
<span class="label"><%=CurrentProxytName%></span>&nbsp;&nbsp;&nbsp;
<a href="<%=PageName + "?code=" + CurrentLanguage%>">Download</a>
<br><br>
<div class="codePanel">
<div class="code-<%#CurrentLanguage%>"><%#GetProxyCode ()%></div>
<div class="code-<%=CurrentLanguage%>"><%=GetProxyCode ()%></div>
</div>
<%} else if (CurrentPage == "wsdl") {%>
<!--
@@ -1767,18 +1777,18 @@ This service does not contain any public web method.
<%} else {%>
<%}%>
<br>
<span class="label"><%#CurrentDocumentName%></span>&nbsp;&nbsp;&nbsp;
<span class="label"><%=CurrentDocumentName%></span>&nbsp;&nbsp;&nbsp;
<a href="<%=PageName + "?" + CurrentDocType + "=" + CurrentDocInd %>">Download</a>
<br><br>
<div class="codePanel">
<div class="code-xml"><%#GenerateDocument ()%></div>
<div class="code-xml"><%=GenerateDocument ()%></div>
</div>
<%}%>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</td>
<td withd="20px"></td>
<td width="20px"></td>
</tr>
</table>
+1340 -488
View File
File diff suppressed because it is too large. Load diff
+7 -7
View File
@@ -41,14 +41,14 @@ prefix/lib/mono with the name NAME, and a symlink is created from
NAME/assembly_name to the assembly on the GAC. This is used so
developers can reference a set of libraries at once.
.Sp
The -root option is used by developers integrating this with automake
tools or packaging tools that require a prefix directory to be
specified. The root represents the "libdir" component of a prefix
(typically prefix/lib).
The -root option is used to specify the "libdir" value of an installation
prefix which differs from the prefix of the system GAC.
Typical automake usage is "-root $(DESTDIR)$(libdir)".
To access assemblies installed to a prefix other than the mono prefix,
it is necessary to set the MONO_GAC_PREFIX environment variable.
.Sp
The -gacdir option is used to specify the GACs base directory. Once an
assembly has been installed to a non standard gacdir the MONO_GAC_PATH
environment variable must be used to access the assembly.
The -gacdir option is included for backward compatibility but is not
recommended for new code. Use the -root option instead.
.Sp
The -check_refs option is used to ensure that the assembly being
installed into the GAC does not reference any non strong named
+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 \
@@ -1,3 +1,10 @@
2005-01-10 Daniel Morgan <[email protected]>
* Mono.Data.SybaseClient/SybaseConnection.cs: fix
for packetSize not being set. Fixes bug 70930
Thanks to [email protected] (Sebastien Robitaille)
for reporting this bug.
2004-04-05 Lluis Sanchez Gual <[email protected]>
* Mono.Data.SybaseClient.dll.sources: Removed SybaseConnectionPool.cs.
@@ -430,9 +430,7 @@ namespace Mono.Data.SybaseClient {
if (!value.Equals (""))
parameters [name.ToUpper ().Trim ()] = value;
if (this.ConnectionString == null)
SetDefaultConnectionParameters (parameters);
SetDefaultConnectionParameters (parameters);
SetProperties (parameters);
this.connectionString = connectionString;
@@ -442,8 +440,10 @@ namespace Mono.Data.SybaseClient {
{
if (null == parameters.Get ("APPLICATION NAME"))
parameters["APPLICATION NAME"] = "Mono SybaseClient Data Provider";
if (null == parameters.Get ("CONNECT TIMEOUT") && null == parameters.Get ("CONNECTION TIMEOUT"))
if (null == parameters.Get ("CONNECT TIMEOUT") && null == parameters.Get ("CONNECTION TIMEOUT")) {
parameters["CONNECT TIMEOUT"] = "15";
connectionTimeout = 15;
}
if (null == parameters.Get ("CONNECTION LIFETIME"))
parameters["CONNECTION LIFETIME"] = "0";
if (null == parameters.Get ("CONNECTION RESET"))
@@ -452,14 +452,20 @@ namespace Mono.Data.SybaseClient {
parameters["ENLIST"] = "true";
if (null == parameters.Get ("INTEGRATED SECURITY") && null == parameters.Get ("TRUSTED_CONNECTION"))
parameters["INTEGRATED SECURITY"] = "false";
if (null == parameters.Get ("MAX POOL SIZE"))
if (null == parameters.Get ("MAX POOL SIZE")) {
parameters["MAX POOL SIZE"] = "100";
if (null == parameters.Get ("MIN POOL SIZE"))
maxPoolSize = 100;
}
if (null == parameters.Get ("MIN POOL SIZE")) {
parameters["MIN POOL SIZE"] = "0";
maxPoolSize = 0;
}
if (null == parameters.Get ("NETWORK LIBRARY") && null == parameters.Get ("NET"))
parameters["NETWORK LIBRARY"] = "dbmssocn";
if (null == parameters.Get ("PACKET SIZE"))
if (null == parameters.Get ("PACKET SIZE")) {
parameters["PACKET SIZE"] = "512";
packetSize = 512;
}
if (null == parameters.Get ("PERSIST SECURITY INFO"))
parameters["PERSIST SECURITY INFO"] = "false";
if (null == parameters.Get ("POOLING"))
@@ -1,3 +1,8 @@
2005-03-11 Gonzalo Paniagua Javier <[email protected]>
* Tds.cs: set the charset for MS SQL 2000. Patch from Aleksandar
Dezelin. Closes bug #73591.
2004-11-06 Gert Driesen <[email protected]>
* Tds70.cs: For numeric parameters, convert enum to numeric value.
Fixes bug #66630.
@@ -1011,8 +1011,7 @@ namespace Mono.Data.Tds.Protocol {
case TdsEnvPacketSubType.CharSet :
cLen = comm.GetByte () & 0xff;
if (tdsVersion == TdsVersion.tds70) {
//this.language = comm.GetString (cLen); // FIXME
comm.GetString (cLen);
SetCharset (comm.GetString (cLen));
comm.Skip (len - 2 - cLen * 2);
}
else {
+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>
+10
View File
@@ -1,3 +1,13 @@
2005-02-22 Gonzalo Paniagua Javier <[email protected]>
* UnixEndPoint.cs: get the correct bytes when building the filename from
a SocketAddress. Fixes bug #72850.
2004-12-30 Jonathan Pryor <[email protected]>
* Syscall.cs: All syscall_ functions should explicitly specify EntryPoint
so that an EntryPointNotFoundException is avoided. Fixes 70706.
2004-07-09 Dick Porter <[email protected]>
* PeerCred.cs: Get the unix socket peer credentials.
+3 -3
View File
@@ -212,7 +212,7 @@ namespace Mono.Posix {
[DllImport ("MonoPosixHelper", EntryPoint="wstopsig")]
public static extern int WSTOPSIG (int status);
[DllImport ("libc", SetLastError=true)]
[DllImport ("libc", EntryPoint="creat", SetLastError=true)]
internal static extern int syscall_creat (string pathname, int flags);
public static int creat (string pathname, FileMode flags)
@@ -277,7 +277,7 @@ namespace Mono.Posix {
// TODO: utime
[DllImport ("libc")]
[DllImport ("libc", EntryPoint="access", SetLastError=true)]
internal extern static int syscall_access (string pathname, int mode);
[DllImport ("MonoPosixHelper")]
@@ -302,7 +302,7 @@ namespace Mono.Posix {
[DllImport ("libc", SetLastError=true)]
public static extern int rename (string oldPath, string newPath);
[DllImport ("libc", SetLastError=true)]
[DllImport ("libc", EntryPoint="mkdir", SetLastError=true)]
internal extern static int syscall_mkdir (string pathname, int mode);
public static int mkdir (string pathname, FileMode mode)
@@ -61,7 +61,18 @@ namespace Mono.Posix
{
int size = socketAddress.Size;
byte [] bytes = new byte [size];
for (int i = 0; i < size; i++) {
/*
* Should also check this
*
int addr = (int) AddressFamily.Unix;
if (socketAddress [0] != (addr & 0xFF))
throw new ArgumentException ("socketAddress is not a unix socket address.");
if (socketAddress [1] != ((addr & 0xFF00) >> 8))
throw new ArgumentException ("socketAddress is not a unix socket address.");
*/
for (int i = 2; i < size - 2; i++) {
bytes [i] = socketAddress [i];
}
+1 -1
View File
@@ -82,7 +82,7 @@ class MakeMap {
foreach (FieldInfo fi in t.GetFields ()){
if (!fi.IsLiteral)
continue;
sh.WriteLine ("#define {0}_{1} {1}", n, fi.Name);
sh.WriteLine ("#define {0}_{1} {2}", n, fi.Name, (int) fi.GetValue (null));
}
sh.WriteLine ();
@@ -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,19 @@
2005-04-18 Sebastien Pouliot <[email protected]>
* SymmetricTransform.cs: Fixed a division by zero if someone changes
the feedback value to 0.
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); }
}
}
}
@@ -6,32 +6,7 @@
// Sebastien Pouliot <[email protected]>
//
// Portions (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
// (C) 2004 Novell (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.
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
// Copyright (C) 2004-2005 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
@@ -90,7 +65,8 @@ namespace Mono.Security.Cryptography {
Buffer.BlockCopy (rgbIV, 0, temp, 0, BlockSizeByte);
temp2 = new byte [BlockSizeByte];
FeedBackByte = (algo.FeedbackSize >> 3);
FeedBackIter = (int) BlockSizeByte / FeedBackByte;
if (FeedBackByte != 0)
FeedBackIter = (int) BlockSizeByte / FeedBackByte;
// transform buffers
workBuff = new byte [BlockSizeByte];
workout = new byte [BlockSizeByte];
@@ -1,3 +1,9 @@
2005-04-12 Sebastien Pouliot <[email protected]>
* TlsClientCertificateVerify.cs: Add missing data length (16 bits -
not to be confused with the record 24 bits length) before the RSA
signature of the MD5SHA1 hash. Fix #71696.
2004-11-10 Sebastien Pouliot <[email protected]>
*.cs: Remove duplicate license header so sources matches with HEAD.
@@ -79,7 +79,9 @@ namespace Mono.Security.Protocol.Tls.Handshake.Client
RSA rsa = this.getClientCertRSA((RSA)privKey);
// Write message
this.Write(hash.CreateSignature(rsa));
byte[] signature = hash.CreateSignature(rsa);
this.Write((short)signature.Length);
this.Write(signature, 0, signature.Length);
}
}
@@ -110,7 +112,9 @@ namespace Mono.Security.Protocol.Tls.Handshake.Client
RSA rsa = this.getClientCertRSA((RSA)privKey);
// Write message
this.Write(hash.CreateSignature(rsa));
byte[] signature = hash.CreateSignature(rsa);
this.Write((short)signature.Length);
this.Write(signature, 0, signature.Length);
}
}
@@ -1,3 +1,30 @@
2005-04-13 Sebastien Pouliot <[email protected]>
* CipherSuite.cs: In sync with HEAD.
* RecordProtocol.cs: Some API changes so a record can be decoded from
any supplied stream (not just the inner network stream).
* SslClientStream.cs: BeginRead is now truly async if the Negotiate is
called from BeginWrite (where it should be in most case).
* SslServerStream.cs: Adapted to API changes in RecordProtocol.cs.
2005-04-12 Sebastien Pouliot <[email protected]>
* SslHandshakeHash.cs: Changed "SslHash" to "MD5SHA1". Fix #71696.
2005-04-10 Sebastien Pouliot <[email protected]>
* HttpsClientStream.cs: Added a TrustFailure property so a
WebException can now report TrustFailure correctly. Fix bug 74286.
2005-04-07 Sebastien Pouliot <[email protected]>
* SslCipherSuite.cs: Fix calculation (sequence number) for the server
side stream. Patch by Brian Ritchie.
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
@@ -370,9 +370,6 @@ namespace Mono.Security.Protocol.Tls
public byte[] PRF(byte[] secret, string label, byte[] data, int length)
{
HashAlgorithm md5 = MD5.Create();
HashAlgorithm sha1 = SHA1.Create();
/* Secret Length calc exmplain from the RFC2246. Section 5
*
* S1 and S2 are the two halves of the secret and each is the same
@@ -593,4 +590,4 @@ namespace Mono.Security.Protocol.Tls
#endregion
}
}
}
@@ -5,9 +5,7 @@
// Author:
// Sebastien Pouliot <[email protected]>
//
// (C) 2004 Novell (http://www.novell.com)
//
// Copyright (C) 2004-2005 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
@@ -41,7 +39,7 @@ namespace Mono.Security.Protocol.Tls {
internal class HttpsClientStream : SslClientStream {
private HttpWebRequest _request;
private int _status;
public HttpsClientStream (Stream stream, X509CertificateCollection clientCertificates,
HttpWebRequest request, byte [] buffer)
@@ -50,6 +48,7 @@ namespace Mono.Security.Protocol.Tls {
// this constructor permit access to the WebRequest to call
// ICertificatePolicy.CheckValidationResult
_request = request;
_status = 0;
if (buffer != null)
InputBuffer.Write (buffer, 0, buffer.Length);
#if !NET_1_0
@@ -58,19 +57,29 @@ namespace Mono.Security.Protocol.Tls {
#endif
}
public bool TrustFailure {
get {
switch (_status) {
case -2146762486: // CERT_E_CHAINING 0x800B010A
case -2146762487: // CERT_E_UNTRUSTEDROOT 0x800B0109
return true;
default:
return false;
}
}
}
internal override bool RaiseServerCertificateValidation (X509Certificate certificate, int[] certificateErrors)
{
bool failed = (certificateErrors.Length > 0);
if (ServicePointManager.CertificatePolicy != null) {
ServicePoint sp = _request.ServicePoint;
bool failed = (certificateErrors.Length > 0);
// only one problem can be reported by this interface
_status = ((failed) ? certificateErrors [0] : 0);
// only one problem can be reported by this interface
int problem = ((failed) ? certificateErrors [0] : 0);
return ServicePointManager.CertificatePolicy.CheckValidationResult (sp, certificate, _request, problem);
}
return failed;
}
if (ServicePointManager.CertificatePolicy != null) {
ServicePoint sp = _request.ServicePoint;
return ServicePointManager.CertificatePolicy.CheckValidationResult (sp, certificate, _request, _status);
}
return failed;
}
}
}
@@ -72,7 +72,7 @@ namespace Mono.Security.Protocol.Tls
#region Reveive Record Methods
public byte[] ReceiveRecord()
public byte[] ReceiveRecord(Stream record)
{
if (this.context.ConnectionEnd)
{
@@ -80,19 +80,25 @@ namespace Mono.Security.Protocol.Tls
AlertDescription.InternalError,
"The session is finished and it's no longer valid.");
}
// Try to read the Record Content Type
int type = this.innerStream.ReadByte();
// Try to read the Record Content Type
int type = record.ReadByte ();
if (type == -1)
{
return null;
}
// Set last handshake message received to None
this.context.LastHandshakeMsg = HandshakeType.ClientHello;
ContentType contentType = (ContentType)type;
byte[] buffer = this.ReadRecordBuffer(type);
byte[] buffer = this.ReadRecordBuffer(type, record);
if (buffer == null)
{
// record incomplete (at the moment)
return null;
}
TlsStream message = new TlsStream(buffer);
// Decrypt message contents if needed
if (contentType == ContentType.Alert && buffer.Length == 2)
{
@@ -101,23 +107,22 @@ namespace Mono.Security.Protocol.Tls
{
if (this.context.IsActual && contentType != ContentType.ChangeCipherSpec)
{
message = this.decryptRecordFragment(contentType, message.ToArray());
DebugHelper.WriteLine("Decrypted record data", message.ToArray());
buffer = this.decryptRecordFragment(contentType, buffer);
DebugHelper.WriteLine("Decrypted record data", buffer);
}
}
// Set last handshake message received to None
this.context.LastHandshakeMsg = HandshakeType.None;
// Process record
byte[] result = message.ToArray();
switch (contentType)
{
case ContentType.Alert:
this.ProcessAlert((AlertLevel)message.ReadByte(), (AlertDescription)message.ReadByte());
result = null;
this.ProcessAlert((AlertLevel)buffer [0], (AlertDescription)buffer [1]);
if (record.CanSeek)
{
// don't reprocess that memory block
record.SetLength (0);
}
buffer = null;
break;
case ContentType.ChangeCipherSpec:
@@ -127,14 +132,15 @@ namespace Mono.Security.Protocol.Tls
case ContentType.ApplicationData:
break;
case ContentType.Handshake:
case ContentType.Handshake:
TlsStream message = new TlsStream (buffer);
while (!message.EOF)
{
this.ProcessHandshakeMessage(message);
}
// Update handshakes of current messages
this.context.HandshakeMessages.Write(message.ToArray());
this.context.HandshakeMessages.Write(buffer);
break;
// FIXME / MCS bug - http://bugzilla.ximian.com/show_bug.cgi?id=67711
@@ -149,34 +155,40 @@ namespace Mono.Security.Protocol.Tls
AlertDescription.UnexpectedMessage,
"Unknown record received from server.");
}
this.context.HandshakeMessages.Write (result);
this.context.HandshakeMessages.Write (buffer);
break;
}
return result;
}
private byte[] ReadRecordBuffer(int contentType)
return buffer;
}
private byte[] ReadRecordBuffer (int contentType, Stream record)
{
switch (contentType)
{
case 0x80:
return this.ReadClientHelloV2();
return this.ReadClientHelloV2(record);
default:
if (!Enum.IsDefined(typeof(ContentType), (ContentType)contentType))
{
throw new TlsException(AlertDescription.DecodeError);
}
return this.ReadStandardRecordBuffer();
return this.ReadStandardRecordBuffer(record);
}
}
private byte[] ReadClientHelloV2()
{
int msgLength = this.innerStream.ReadByte();
byte[] message = new byte [msgLength];
this.innerStream.Read (message, 0, msgLength);
}
private byte[] ReadClientHelloV2 (Stream record)
{
int msgLength = record.ReadByte ();
// process further only if the whole record is available
if (record.CanSeek && (msgLength + 1 > record.Length))
{
return null;
}
byte[] message = new byte[msgLength];
record.Read (message, 0, msgLength);
int msgType = message [0];
if (msgType != 1)
@@ -229,19 +241,26 @@ namespace Mono.Security.Protocol.Tls
this.context.ProtocolNegotiated = true;
return message;
}
private byte[] ReadStandardRecordBuffer()
}
private byte[] ReadStandardRecordBuffer (Stream record)
{
short protocol = this.ReadShort();
short length = this.ReadShort();
short protocol = this.ReadShort(record);
short length = this.ReadShort(record);
// process further only if the whole record is available
// note: the first 5 bytes aren't part of the length
if (record.CanSeek && (length + 5 > record.Length))
{
return null;
}
// Read Record data
int received = 0;
byte[] buffer = new byte[length];
while (received != length)
{
received += this.innerStream.Read(buffer, received, buffer.Length - received);
received += record.Read(buffer, received, buffer.Length - received);
}
// Check that the message has a valid protocol version
@@ -256,10 +275,10 @@ namespace Mono.Security.Protocol.Tls
return buffer;
}
private short ReadShort()
private short ReadShort(Stream record)
{
byte[] b = new byte[2];
this.innerStream.Read(b, 0, b.Length);
record.Read(b, 0, b.Length);
short val = BitConverter.ToInt16(b, 0);
@@ -459,7 +478,7 @@ namespace Mono.Security.Protocol.Tls
return ecr;
}
private TlsStream decryptRecordFragment(
private byte[] decryptRecordFragment(
ContentType contentType,
byte[] fragment)
{
@@ -520,7 +539,7 @@ namespace Mono.Security.Protocol.Tls
// Update sequence number
this.context.ReadSequenceNumber++;
return new TlsStream(dcrFragment);
return dcrFragment;
}
#endregion
@@ -540,9 +559,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;
@@ -118,11 +118,11 @@ namespace Mono.Security.Protocol.Tls
block.Write(this.pad1);
if (this.Context is ClientContext)
{
block.Write(this.Context.ReadSequenceNumber);
block.Write(this.Context.WriteSequenceNumber);
}
else
{
block.Write(this.Context.WriteSequenceNumber);
block.Write(this.Context.ReadSequenceNumber);
}
block.Write((byte)contentType);
block.Write((short)fragment.Length);
@@ -298,4 +298,4 @@ namespace Mono.Security.Protocol.Tls
#endregion
}
}
}
@@ -29,6 +29,7 @@ using System.Net;
using System.Net.Sockets;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Threading;
using Mono.Security.Protocol.Tls.Handshake;
@@ -65,12 +66,13 @@ namespace Mono.Security.Protocol.Tls
#region Fields
private Stream innerStream;
private BufferedStream inputBuffer;
private MemoryStream inputBuffer;
private ClientContext context;
private ClientRecordProtocol protocol;
private bool ownsStream;
private bool disposed;
private bool checkCertRevocationStatus;
private object negotiate;
private object read;
private object write;
@@ -236,6 +238,11 @@ namespace Mono.Security.Protocol.Tls
}
}
// this is used by Mono's certmgr tool to download certificates
internal Mono.Security.X509.X509CertificateCollection ServerCertificates {
get { return context.ServerSettings.Certificates; }
}
#endregion
#region Callback Properties
@@ -329,9 +336,10 @@ namespace Mono.Security.Protocol.Tls
targetHost,
clientCertificates);
this.inputBuffer = new BufferedStream(new MemoryStream());
this.inputBuffer = new MemoryStream();
this.innerStream = stream;
this.ownsStream = ownsStream;
this.negotiate = new object ();
this.read = new object ();
this.write = new object ();
this.protocol = new ClientRecordProtocol(innerStream, context);
@@ -398,8 +406,8 @@ namespace Mono.Security.Protocol.Tls
int count,
AsyncCallback callback,
object state)
{
this.checkDisposed();
{
this.checkDisposed ();
if (buffer == null)
{
@@ -422,15 +430,21 @@ namespace Mono.Security.Protocol.Tls
throw new ArgumentOutOfRangeException("count is less than the length of buffer minus the value of the offset parameter.");
}
lock (this)
if (this.context.HandshakeState == HandshakeState.None)
{
if (this.context.HandshakeState == HandshakeState.None)
// Note: Async code may have problem if they can't ensure that
// the Negotiate phase isn't done during a read operation.
// System.Net.HttpWebRequest protects itself from that problem
lock (this.negotiate)
{
this.NegotiateHandshake();
if (this.context.HandshakeState == HandshakeState.None)
{
this.NegotiateHandshake();
}
}
}
IAsyncResult asyncResult;
IAsyncResult asyncResult = null;
lock (this.read)
{
@@ -445,43 +459,28 @@ namespace Mono.Security.Protocol.Tls
if (!this.context.ConnectionEnd)
{
// Check if we have space in the middle buffer
// if not Read next TLS record and update the inputBuffer
while ((this.inputBuffer.Length - this.inputBuffer.Position) < count)
if ((this.inputBuffer.Length == this.inputBuffer.Position) && (count > 0))
{
// Read next record and write it into the inputBuffer
long position = this.inputBuffer.Position;
byte[] record = this.protocol.ReceiveRecord();
if (record != null && record.Length > 0)
{
// Write new data to the inputBuffer
this.inputBuffer.Seek(0, SeekOrigin.End);
this.inputBuffer.Write(record, 0, record.Length);
// bigger than max record length for SSL/TLS
byte[] recbuf = new byte[16384];
// Restore buffer position
this.inputBuffer.Seek(position, SeekOrigin.Begin);
}
else
// this will read data from the network until we have (at least) one
// record to send back to the caller
this.innerStream.BeginRead (recbuf, 0, recbuf.Length,
new AsyncCallback (NetworkReadCallback), recbuf);
if (!recordEvent.WaitOne (300000, false)) // 5 minutes
{
if (record == null)
{
break;
}
// FAILSAFE
DebugHelper.WriteLine ("TIMEOUT length {0}, position {1}, count {2} - {3}\n{4}",
this.inputBuffer.Length, this.inputBuffer.Position, count, GetHashCode (),
Environment.StackTrace);
throw new TlsException (AlertDescription.InternalError);
}
// TODO: Review if we need to check the Length
// property of the innerStream for other types
// of streams, to check that there are data available
// for read
if (this.innerStream is NetworkStream &&
!((NetworkStream)this.innerStream).DataAvailable)
{
break;
}
}
}
}
// return the record(s) to the caller
asyncResult = this.inputBuffer.BeginRead(
buffer, offset, count, callback, state);
}
@@ -496,9 +495,102 @@ namespace Mono.Security.Protocol.Tls
{
throw new IOException("IO exception during read.");
}
}
return asyncResult;
}
private ManualResetEvent recordEvent = new ManualResetEvent (false);
private MemoryStream recordStream = new MemoryStream ();
// read encrypted data until we have enough to decrypt (at least) one
// record and return are the records (may be more than one) we have
private void NetworkReadCallback (IAsyncResult result)
{
byte[] recbuf = (byte[])result.AsyncState;
int n = innerStream.EndRead (result);
if (n > 0)
{
// add the just received data to the waiting data
recordStream.Write (recbuf, 0, n);
}
bool dataToReturn = false;
long pos = recordStream.Position;
recordStream.Position = 0;
byte[] record = null;
// don't try to decode record unless we have at least 5 bytes
// i.e. type (1), protocol (2) and length (2)
if (recordStream.Length >= 5)
{
record = this.protocol.ReceiveRecord (recordStream);
}
// a record of 0 length is valid (and there may be more record after it)
while (record != null)
{
// we probably received more stuff after the record, and we must keep it!
long remainder = recordStream.Length - recordStream.Position;
byte[] outofrecord = null;
if (remainder > 0)
{
outofrecord = new byte[remainder];
recordStream.Read (outofrecord, 0, outofrecord.Length);
}
long position = this.inputBuffer.Position;
if (record.Length > 0)
{
// Write new data to the inputBuffer
this.inputBuffer.Seek (0, SeekOrigin.End);
this.inputBuffer.Write (record, 0, record.Length);
// Restore buffer position
this.inputBuffer.Seek (position, SeekOrigin.Begin);
dataToReturn = true;
}
recordStream.SetLength (0);
record = null;
if (remainder > 0)
{
recordStream.Write (outofrecord, 0, outofrecord.Length);
// type (1), protocol (2) and length (2)
if (recordStream.Length >= 5)
{
// try to see if another record is available
recordStream.Position = 0;
record = this.protocol.ReceiveRecord (recordStream);
if (record == null)
pos = recordStream.Length;
}
else
pos = remainder;
}
else
pos = 0;
}
if (!dataToReturn && (n > 0))
{
// there is no record to return to caller and (possibly) more data waiting
// so continue reading from network (and appending to stream)
recordStream.Position = recordStream.Length;
this.innerStream.BeginRead (recbuf, 0, recbuf.Length,
new AsyncCallback (NetworkReadCallback), recbuf);
}
else
{
// we have record(s) to return -or- no more available to read from network
// reset position for further reading
recordStream.Position = pos;
recordEvent.Set ();
}
}
public override IAsyncResult BeginWrite(
@@ -531,11 +623,14 @@ namespace Mono.Security.Protocol.Tls
throw new ArgumentOutOfRangeException("count is less than the length of buffer minus the value of the offset parameter.");
}
lock (this)
if (this.context.HandshakeState == HandshakeState.None)
{
if (this.context.HandshakeState == HandshakeState.None)
lock (this.negotiate)
{
this.NegotiateHandshake();
if (this.context.HandshakeState == HandshakeState.None)
{
this.NegotiateHandshake();
}
}
}
@@ -576,9 +671,10 @@ namespace Mono.Security.Protocol.Tls
if (asyncResult == null)
{
throw new ArgumentNullException("asyncResult is null or was not obtained by calling BeginRead.");
}
}
return this.inputBuffer.EndRead(asyncResult);
recordEvent.Reset ();
return this.inputBuffer.EndRead (asyncResult);
}
public override void EndWrite(IAsyncResult asyncResult)
@@ -684,75 +780,72 @@ namespace Mono.Security.Protocol.Tls
internal void NegotiateHandshake()
{
lock (this)
try
{
try
if (this.context.HandshakeState != HandshakeState.None)
{
if (this.context.HandshakeState != HandshakeState.None)
{
this.context.Clear();
}
this.context.Clear();
}
// Obtain supported cipher suites
this.context.SupportedCiphers = CipherSuiteFactory.GetSupportedCiphers(this.context.SecurityProtocol);
// Obtain supported cipher suites
this.context.SupportedCiphers = CipherSuiteFactory.GetSupportedCiphers(this.context.SecurityProtocol);
// Send client hello
this.protocol.SendRecord(HandshakeType.ClientHello);
// Send client hello
this.protocol.SendRecord(HandshakeType.ClientHello);
// Read server response
while (this.context.LastHandshakeMsg != HandshakeType.ServerHelloDone)
{
// Read next record
this.protocol.ReceiveRecord();
}
// Read server response
while (this.context.LastHandshakeMsg != HandshakeType.ServerHelloDone)
{
// Read next record
this.protocol.ReceiveRecord (this.innerStream);
}
// Send client certificate if requested
if (this.context.ServerSettings.CertificateRequest)
{
this.protocol.SendRecord(HandshakeType.Certificate);
}
// Send client certificate if requested
if (this.context.ServerSettings.CertificateRequest)
{
this.protocol.SendRecord(HandshakeType.Certificate);
}
// Send Client Key Exchange
this.protocol.SendRecord(HandshakeType.ClientKeyExchange);
// Send Client Key Exchange
this.protocol.SendRecord(HandshakeType.ClientKeyExchange);
// Now initialize session cipher with the generated keys
this.context.Cipher.InitializeCipher();
// Now initialize session cipher with the generated keys
this.context.Cipher.InitializeCipher();
// Send certificate verify if requested
if (this.context.ServerSettings.CertificateRequest)
{
this.protocol.SendRecord(HandshakeType.CertificateVerify);
}
// Send certificate verify if requested
if (this.context.ServerSettings.CertificateRequest)
{
this.protocol.SendRecord(HandshakeType.CertificateVerify);
}
// Send Cipher Spec protocol
this.protocol.SendChangeCipherSpec();
// Send Cipher Spec protocol
this.protocol.SendChangeCipherSpec();
// Read record until server finished is received
while (this.context.HandshakeState != HandshakeState.Finished)
{
// If all goes well this will process messages:
// Change Cipher Spec
// Server finished
this.protocol.ReceiveRecord();
}
// Clear Key Info
this.context.ClearKeyInfo();
}
catch (TlsException ex)
// Read record until server finished is received
while (this.context.HandshakeState != HandshakeState.Finished)
{
this.protocol.SendAlert(ex.Alert);
this.Close();
throw new IOException("The authentication or decryption has failed.");
// If all goes well this will process messages:
// Change Cipher Spec
// Server finished
this.protocol.ReceiveRecord (this.innerStream);
}
catch (Exception)
{
this.protocol.SendAlert(AlertDescription.InternalError);
this.Close();
throw new IOException("The authentication or decryption has failed.");
}
// Clear Key Info
this.context.ClearKeyInfo();
}
catch (TlsException ex)
{
this.protocol.SendAlert(ex.Alert);
this.Close();
throw new IOException("The authentication or decryption has failed.");
}
catch (Exception)
{
this.protocol.SendAlert(AlertDescription.InternalError);
this.Close();
throw new IOException("The authentication or decryption has failed.");
}
}
@@ -129,7 +129,7 @@ namespace Mono.Security.Protocol.Tls
}
RSASslSignatureFormatter f = new RSASslSignatureFormatter(rsa);
f.SetHashAlgorithm("SslHash");
f.SetHashAlgorithm("MD5SHA1");
return f.CreateSignature(this.Hash);
}
@@ -146,7 +146,7 @@ namespace Mono.Security.Protocol.Tls
}
RSASslSignatureDeformatter d = new RSASslSignatureDeformatter(rsa);
d.SetHashAlgorithm("SslHash");
d.SetHashAlgorithm("MD5SHA1");
return d.VerifySignature(this.Hash, rgbSignature);
}
@@ -402,7 +402,7 @@ namespace Mono.Security.Protocol.Tls
{
// Read next record and write it into the inputBuffer
long position = this.inputBuffer.Position;
byte[] record = this.protocol.ReceiveRecord();
byte[] record = this.protocol.ReceiveRecord(this.innerStream);
if (record != null && record.Length > 0)
{
@@ -649,8 +649,8 @@ namespace Mono.Security.Protocol.Tls
// Set handshake state
this.context.HandshakeState = HandshakeState.Started;
// Receive Client Hello message
this.protocol.ReceiveRecord();
// Receive Client Hello message
this.protocol.ReceiveRecord (this.innerStream);
// If received message is not an ClientHello send a
// Fatal Alert
@@ -685,8 +685,8 @@ namespace Mono.Security.Protocol.Tls
// Receive client response, until the Client Finished message
// is received
while (this.context.LastHandshakeMsg != HandshakeType.Finished)
{
this.protocol.ReceiveRecord();
{
this.protocol.ReceiveRecord (this.innerStream);
}
// Send ChangeCipherSpec and ServerFinished messages
@@ -0,0 +1,12 @@
2005-02-22 Sureshkumar T <[email protected]>
* OracleCommand.cs: set behavior for execute reader.
fixes bug #72607.
2004-12-19 Daniel Morgan <[email protected]>
* OracleCommand.cs: ExecuteReader needs to be able
to handle non queries too (retrofitted from trunk)
* ChangeLog: added file
@@ -8,10 +8,10 @@
// Namespace: System.Data.OracleClient
//
// Authors:
// Daniel Morgan <danmorg@sc.rr.com>
// Daniel Morgan <danielmorg[email protected]>
// Tim Coleman <[email protected]>
//
// Copyright (C) Daniel Morgan, 2002
// Copyright (C) Daniel Morgan, 2002, 2004
// Copyright (C) Tim Coleman , 2003
//
// Licensed under the MIT/X11 License.
@@ -290,6 +290,16 @@ namespace System.Data.OracleClient {
throw new NotImplementedException ();
}
private bool IsNonQuery (OciStatementHandle statementHandle) {
// assumes Prepare() has been called prior to calling this function
OciStatementType statementType = statementHandle.GetStatementType ();
if (statementType.Equals (OciStatementType.Select))
return false;
return true;
}
public OracleDataReader ExecuteReader ()
{
return ExecuteReader (CommandBehavior.Default);
@@ -303,6 +313,8 @@ namespace System.Data.OracleClient {
AssertNoDataReader ();
bool hasRows = false;
this.behavior = behavior;
if (Transaction != null)
Transaction.AttachToServiceContext ();
@@ -314,8 +326,14 @@ namespace System.Data.OracleClient {
else
preparedStatement = null; // OracleDataReader releases the statement handle
bool isNonQuery = IsNonQuery (statement);
BindParameters (statement);
hasRows = statement.ExecuteQuery ();
if (isNonQuery)
ExecuteNonQueryInternal (statement, false);
else
hasRows = statement.ExecuteQuery ();
rd = new OracleDataReader (this, statement, hasRows);
}
@@ -1,3 +1,42 @@
2005-01-20 Sureshkumar T <[email protected]>
* OdbcDataReader.cs: case for type OdbcType.Double added in
GetValue. fixes bug #71173.
Thanks to patch given by "Appasamy T" <[email protected]>
2005-01-19 Sureshkumar T <[email protected]>
* OdbcDataReader.cs: Implement NextResultSet for multiple result
set queries.
* OdbcDataReader.cs: build column schema once creating reader and
then for each Next result set. Thanks to
[email protected] (Sebastien Robitaille) for
pointing out this optimization (bugzilla #70530).
* libodbc.cs: Added library calls SQLFreeStmt and SQLMoreResults
for mutiple resultsets.
2005-01-19 Sureshkumar T <[email protected]>
* OdbcDataReader.cs: Pass OdbcCType.SignedBigInt for accessing big
int columns.
* OdbcType.cs: Added a new enum for Odbc C DataTypes. This should
essentially be passed to drivers, since the public OdbcType types
differs from types expected in drivers in some cases.
* libodbc.cs : Added a ODBC method which takes OdbcCType
enumeration for SQLGetData for BigInt fields.
fixes bug #65342.
2005-01-11 Sureshkumar T <[email protected]>
* OdbcDataReader.cs: Connection has to be closed only after
Statement handle is freed. fixes bug #70048
2004-08-31 Umadevi S ([email protected])
* OdbcDataReader.cs - Fixed Decimal parsing
@@ -66,6 +66,7 @@ namespace System.Data.Odbc
short colcount=0;
libodbc.SQLNumResultCols(hstmt, ref colcount);
cols=new OdbcColumn[colcount];
GetSchemaTable ();
}
#endregion
@@ -132,11 +133,11 @@ namespace System.Data.Odbc
int i=0;
foreach (OdbcColumn col in cols)
{
if (col.ColumnName==colname)
if (col != null && col.ColumnName==colname)
return i;
i++;
}
return 0;
return -1;
}
// Dynamically load column descriptions as needed.
@@ -170,18 +171,21 @@ namespace System.Data.Odbc
public void Close ()
{
OdbcReturn ret=libodbc.SQLCloseCursor(hstmt);
// FIXME : have to implement output parameter binding
OdbcReturn ret = libodbc.SQLFreeStmt (hstmt, libodbc.SQLFreeStmtOptions.Close);
if ((ret!=OdbcReturn.Success) && (ret!=OdbcReturn.SuccessWithInfo))
throw new OdbcException(new OdbcError("SQLCloseCursor",OdbcHandleType.Stmt,hstmt));
open = false;
currentRow = -1;
if ((behavior & CommandBehavior.CloseConnection)==CommandBehavior.CloseConnection)
this.command.Connection.Close();
ret = libodbc.SQLFreeHandle( (ushort) OdbcHandleType.Stmt, hstmt);
if ((ret!=OdbcReturn.Success) && (ret!=OdbcReturn.SuccessWithInfo))
throw new OdbcException(new OdbcError("SQLFreeHandle",OdbcHandleType.Stmt,hstmt));
if ((behavior & CommandBehavior.CloseConnection)==CommandBehavior.CloseConnection)
this.command.Connection.Close();
}
~OdbcDataReader ()
@@ -335,9 +339,6 @@ namespace System.Data.Odbc
public int GetOrdinal (string name)
{
if (currentRow == -1)
throw new IndexOutOfRangeException ();
int i=ColIndex(name);
if (i==-1)
@@ -497,7 +498,7 @@ namespace System.Data.Odbc
break;
case OdbcType.BigInt:
long long_data=0;
ret=libodbc.SQLGetData(hstmt, ColIndex, OdbcType.BigInt, ref long_data, 0, ref outsize);
ret=libodbc.SQLGetData(hstmt, ColIndex, OdbcCType.SignedBigInt, ref long_data, 0, ref outsize);
DataValue=long_data;
break;
case OdbcType.NVarChar:
@@ -519,6 +520,11 @@ namespace System.Data.Odbc
ret=libodbc.SQLGetData(hstmt, ColIndex, OdbcType.Real, ref float_data, 0, ref outsize);
DataValue=float_data;
break;
case OdbcType.Double:
double double_data=0;
ret=libodbc.SQLGetData(hstmt, ColIndex, OdbcType.Double, ref double_data, 0, ref outsize);
DataValue=double_data;
break;
case OdbcType.Timestamp:
case OdbcType.DateTime:
case OdbcType.Date:
@@ -610,27 +616,45 @@ namespace System.Data.Odbc
return (GetValue(ordinal) is DBNull);
}
/// <remarks>
/// Move to the next result set.
/// </remarks>
public bool NextResult ()
{
OdbcReturn ret=libodbc.SQLFetch(hstmt);
if (ret!=OdbcReturn.Success)
currentRow=-1;
OdbcReturn ret = OdbcReturn.Success;
ret = libodbc.SQLMoreResults (hstmt);
if (ret == OdbcReturn.Success) {
short colcount = 0;
libodbc.SQLNumResultCols (hstmt, ref colcount);
cols = new OdbcColumn [colcount];
GetSchemaTable ();
}
return (ret==OdbcReturn.Success);
}
/// <remarks>
/// Load the next row in the current result set.
/// </remarks>
public bool NextRow ()
{
OdbcReturn ret=libodbc.SQLFetch (hstmt);
if (ret != OdbcReturn.Success)
currentRow = -1;
else
currentRow++;
GetSchemaTable();
// Clear cached values from last record
foreach (OdbcColumn col in cols)
{
if (col!=null)
col.Value=null;
if (col != null)
col.Value = null;
}
return (ret==OdbcReturn.Success);
return (ret == OdbcReturn.Success);
}
public bool Read ()
{
return NextResult();
return NextRow ();
}
#endregion
@@ -1,11 +1,11 @@
//
// System.Data.Odbc.OdbcType
//
// Author:
// Brian Ritchie
//
// Copyright (C) Brian Ritchie, 2002
//
//
// System.Data.Odbc.OdbcType
//
// Author:
// Brian Ritchie
//
// Copyright (C) Brian Ritchie, 2002
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
@@ -29,53 +29,62 @@
// 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.Data;
using System.Data.Common;
namespace System.Data.Odbc
{
// From the ODBC documentation:
//
// In ODBC 3.x, the identifiers for date, time, and timestamp SQL data types
// have changed from SQL_DATE, SQL_TIME, and SQL_TIMESTAMP (with instances of
// #define in the header file of 9, 10, and 11) to SQL_TYPE_DATE, SQL_TYPE_TIME,
// and SQL_TYPE_TIMESTAMP (with instances of #define in the header file of 91, 92, and 93),
// respectively.
// Unmapped SQL Types
//
//#define SQL_FLOAT 6
// could map to SQL_DOUBLE?
//#define SQL_INTERVAL 10
// could map to SmallDateTime?
using System.Data;
using System.Data.Common;
namespace System.Data.Odbc
{
// From the ODBC documentation:
//
// In ODBC 3.x, the identifiers for date, time, and timestamp SQL data types
// have changed from SQL_DATE, SQL_TIME, and SQL_TIMESTAMP (with instances of
// #define in the header file of 9, 10, and 11) to SQL_TYPE_DATE, SQL_TYPE_TIME,
// and SQL_TYPE_TIMESTAMP (with instances of #define in the header file of 91, 92, and 93),
// respectively.
// Unmapped SQL Types
//
//#define SQL_FLOAT 6
// could map to SQL_DOUBLE?
//#define SQL_INTERVAL 10
// could map to SmallDateTime?
public enum OdbcType
{
BigInt=-5, // SQL_BIGINT
Binary=-2, // SQL_BINARY
Bit=-7, // SQL_BIT
Char=1, // SQL_CHAR
Date=91, // SQL_TYPE_DATE
DateTime=9, // SQL_DATETIME
Decimal=3, // SQL_DECIMAL
Double=8, // SQL_DOUBLE
Image=-4, // SQL_LONGVARBINARY
Int=4, // SQL_INTEGER
NChar=-95, // SQL_UNICODE_CHAR
NText=-97, // SQL_UNICODE_LONGVARCHAR
Numeric=2, // SQL_NUMERIC
NVarChar=-96, // SQL_UNICODE_VARCHAR
Real=7, // SQL_REAL
SmallDateTime=0,// ??????????????????????????
SmallInt=5, // SQL_SMALLINT
Time=92, // SQL_TYPE_TIME
Text=-1, // SQL_LONGVARCHAR
Timestamp=93, // SQL_TYPE_TIMESTAMP
TinyInt=-6, // SQL_TINYINT
UniqueIdentifier=-11, // SQL_GUID
VarBinary=-3, // SQL_VARBINARY
VarChar=12 // SQL_VARCHAR
}
}
{
BigInt=-5, // SQL_BIGINT
Binary=-2, // SQL_BINARY
Bit=-7, // SQL_BIT
Char=1, // SQL_CHAR
Date=91, // SQL_TYPE_DATE
DateTime=9, // SQL_DATETIME
Decimal=3, // SQL_DECIMAL
Double=8, // SQL_DOUBLE
Image=-4, // SQL_LONGVARBINARY
Int=4, // SQL_INTEGER
NChar=-95, // SQL_UNICODE_CHAR
NText=-97, // SQL_UNICODE_LONGVARCHAR
Numeric=2, // SQL_NUMERIC
NVarChar=-96, // SQL_UNICODE_VARCHAR
Real=7, // SQL_REAL
SmallDateTime=0,// ??????????????????????????
SmallInt=5, // SQL_SMALLINT
Time=92, // SQL_TYPE_TIME
Text=-1, // SQL_LONGVARCHAR
Timestamp=93, // SQL_TYPE_TIMESTAMP
TinyInt=-6, // SQL_TINYINT
UniqueIdentifier=-11, // SQL_GUID
VarBinary=-3, // SQL_VARBINARY
VarChar=12 // SQL_VARCHAR
}
// This internal enum is used as mapping types into database drivers.
// This is essentially a map between public OdbcType to C types for
// Odbc to call into driver.
internal enum OdbcCType
{
SignedBigInt=-25 // SQL_C_SBIGINT
}
}
@@ -61,7 +61,7 @@ namespace System.Data.Odbc
CPMatch = 202
}
internal enum OdbcConnectionAttribute : int
internal enum OdbcConnectionAttribute : int
{
AutoCommit=102,
TransactionIsolation=108
@@ -210,27 +210,43 @@ namespace System.Data.Odbc
internal static extern OdbcReturn SQLCloseCursor(IntPtr StatementHandle);
[DllImport("odbc32")]
internal static extern OdbcReturn SQLError(IntPtr EnvironmentHandle,
IntPtr ConnectionHandle, IntPtr StatementHandle,
byte[] Sqlstate, ref int NativeError,
byte[] MessageText, short BufferLength,
ref short TextLength);
internal static extern OdbcReturn SQLError(IntPtr EnvironmentHandle,
IntPtr ConnectionHandle, IntPtr StatementHandle,
byte[] Sqlstate, ref int NativeError,
byte[] MessageText, short BufferLength,
ref short TextLength);
[DllImport("odbc32")]
internal static extern OdbcReturn SQLGetStmtAttr(IntPtr StatementHandle,
int Attribute, ref IntPtr Value, int BufLen, int StrLen);
[DllImport("odbc32")]
internal static extern OdbcReturn SQLGetStmtAttr(IntPtr StatementHandle,
int Attribute, ref IntPtr Value, int BufLen, int StrLen);
[DllImport("odbc32")]
internal static extern OdbcReturn SQLSetDescField(IntPtr DescriptorHandle,
short RecNumber, short FieldIdentifier, byte[] Value, int BufLen);
internal static extern OdbcReturn SQLSetDescField(IntPtr DescriptorHandle,
short RecNumber, short FieldIdentifier, byte[] Value, int BufLen);
[DllImport("odbc32")]
internal static extern OdbcReturn SQLGetDiagRec (OdbcHandleType HandleType,
IntPtr Handle, ushort RecordNumber,
byte [] Sqlstate, ref int NativeError,
byte [] MessageText, short BufferLength,
ref short TextLength);
internal static extern OdbcReturn SQLGetDiagRec (OdbcHandleType HandleType,
IntPtr Handle, ushort RecordNumber,
byte [] Sqlstate, ref int NativeError,
byte [] MessageText, short BufferLength,
ref short TextLength);
}
[DllImport("odbc32.dll")]
internal static extern OdbcReturn SQLGetData (IntPtr StatementHandle, ushort ColumnNumber, OdbcCType TargetType, ref long TargetPtr, int BufferLen, ref int Len);
[DllImport ("odbc32.dll")]
internal static extern OdbcReturn SQLMoreResults (IntPtr Handle);
internal enum SQLFreeStmtOptions : short
{
Close = 0,
Drop,
Unbind,
ResetParams
}
[DllImport ("odbc32.dll")]
internal static extern OdbcReturn SQLFreeStmt (IntPtr Handle, SQLFreeStmtOptions option);
}
}
@@ -1,3 +1,8 @@
2005-02-03 Sureshkumar T <[email protected]>
* SqlDateTime.cs : Parse : try with local culture first, then try
with invariant culture if it fails.
2004-06-18 Gert Driesen <[email protected]>
* SqlNullValueException.cs: fixed serialization
@@ -236,7 +236,19 @@ namespace System.Data.SqlTypes
public static SqlDateTime Parse (string s)
{
return new SqlDateTime (DateTime.Parse (s));
if (s == null)
throw new ArgumentNullException ("Argument cannot be null");
// try parsing in local culture
DateTimeFormatInfo fmtInfo = DateTimeFormatInfo.CurrentInfo;
try {
return new SqlDateTime (DateTime.Parse (s, fmtInfo));
} catch (Exception e) {
// try parsing in invariant culture
return new SqlDateTime (DateTime.Parse (s, CultureInfo.InvariantCulture));
}
throw new FormatException (String.Format ("String {0} is not recognized as "+
" valid DateTime.", s));
}
public SqlString ToSqlString ()
@@ -1,3 +1,62 @@
2005-02-01 Sureshkumar T <[email protected]>
Ankit Jain <[email protected]>
* DataRow.cs: SetParentRow (): use relation.ParentColumns &
relation.ChildColumns instead of relation.ChildKeyConstraint.*
because createConstrains flag may be false when creating data
relations.
2005-01-28 Sureshkumar T <[email protected]>
* DataRow.cs: CopyValuesToRow : set the column value with the
default version of the given row.
* DataTable.cs: ImportRow: Copy values before adding row.
* DataSet.cs: AddChangedRow: Add the row to the table after
copying values.
Fixes bug #67317. Patch by Ankit Jain.
2005-01-19 Sureshkumar T <[email protected]>
* DataRelationCollection.cs:
Method Remove : Donot throw exception if DataRelation argument is
null in DataRelationCollection.Remove method.
Method RemoveAt : Exception should be IndexOutOfRangeException if
row index is not in list range.
Fixes nunit failures DataRelationCollection.Remove and
DataRelationCollection.RemoveAt.
2005-01-19 Sureshkumar T <[email protected]>
* ConstraintCollection.cs: Donot throw exception if constraints
are null in AddRange method. Check for null before using the
argument.
fixes bug #69381.
2004-01-19 Atsushi Enomoto <[email protected]>
* XmlDiffLoader.cs : Ankit Jain <[email protected]> has a conflicting
patches and some good catches. Some attributes should be skipped,
and loaded value must be typed.
2004-01-19 Atsushi Enomoto <[email protected]>
* XmlConstants.cs,
XmlDataInferenceLoader.cs,
XmlDataReader.cs : use common const for http://www.w3.org/2000/xmlns/.
* XmlDiffLoader.cs : It was not handling attributes. Fixed bug #70961.
2004-01-12 Atsushi Enomoto <[email protected]>
* DataSet.cs : When serializing DataTable, BuildSchema() is passed
null relation collections.
Quick fix for XmlSerializer deserialization. It does not require
XML Schema included.
2004-11-10 Atsushi Enomoto <[email protected]>
* CustomDataClassGenerator.cs : generated foreign key constraint
@@ -264,6 +264,9 @@ namespace System.Data {
_mostRecentConstraints = constraints;
return;
}
if ( (constraints == null) || (constraints.Length == 0))
return;
// Check whether the constraint is UniqueConstraint
// And whether it was initialized with the special ctor
@@ -287,17 +290,9 @@ namespace System.Data {
}
if ( (constraints == null) || (constraints.Length == 0))
throw new ArgumentNullException ("Cannot add null");
else {
foreach (Constraint constraint in constraints)
Add (constraint);
}
}
foreach (Constraint constraint in constraints)
Add (constraint);
}
// Helper AddRange() - Call this function when EndInit is called
internal void PostEndInit()
@@ -541,7 +541,7 @@ namespace System.Data {
public void Remove (DataRelation relation)
{
if (relation == null)
throw new ArgumentNullException("Relation specified is null");
return;
// check if the list doesnot contains this relation.
if (!(List.Contains(relation)))
@@ -563,7 +563,7 @@ namespace System.Data {
public void RemoveAt (int index)
{
if (( index < 0 ) || (index >=List.Count))
throw new ArgumentException("There is no row at position "+index+".");
throw new IndexOutOfRangeException ("There is no row at position " + index + ".");
Remove(this[index]);
}
+6 -9
View File
@@ -1285,10 +1285,9 @@ namespace System.Data {
BeginEdit();
if (relation == null)
{
foreach (DataRelation parentRel in _table.ParentRelations)
{
DataColumn[] childCols = parentRel.ChildKeyConstraint.Columns;
DataColumn[] parentCols = parentRel.ChildKeyConstraint.RelatedColumns;
foreach (DataRelation parentRel in _table.ParentRelations) {
DataColumn[] childCols = parentRel.ChildColumns;
DataColumn[] parentCols = parentRel.ParentColumns;
for (int i = 0; i < parentCols.Length; i++)
{
@@ -1302,9 +1301,8 @@ namespace System.Data {
}
else
{
DataColumn[] childCols = relation.ChildKeyConstraint.Columns;
DataColumn[] parentCols = relation.ChildKeyConstraint.RelatedColumns;
DataColumn[] childCols = relation.ChildColumns;
DataColumn[] parentCols = relation.ParentColumns;
for (int i = 0; i < parentCols.Length; i++)
{
if (parentRow == null)
@@ -1355,8 +1353,7 @@ namespace System.Data {
}
//Saving the current value as the column value
row[index] = targetColumn[row._current];
row [index] = targetColumn [IndexFromVersion (DataRowVersion.Default)];
}
}
CopyState(row);
+15 -8
View File
@@ -490,8 +490,8 @@ namespace System.Data {
}
DataRow newRow = copyTable.NewRow ();
copyTable.Rows.Add (newRow);
row.CopyValuesToRow (newRow);
copyTable.Rows.Add (newRow);
newRow.XmlRowID = row.XmlRowID;
addedRows.Add (row,row);
}
@@ -1044,8 +1044,11 @@ namespace System.Data {
reader.MoveToContent ();
reader.ReadStartElement ();
reader.MoveToContent ();
ReadXmlSchema (reader);
reader.MoveToContent ();
if (reader.LocalName == "schema" &&
reader.NamespaceURI == XmlSchema.Namespace) {
ReadXmlSchema (reader);
reader.MoveToContent ();
}
ReadXml (reader, XmlReadMode.DiffGram);
reader.MoveToContent ();
reader.ReadEndElement ();
@@ -1406,7 +1409,7 @@ namespace System.Data {
nsmgr.AddNamespace (XmlConstants.TnsPrefix, Namespace);
nsmgr.AddNamespace (String.Empty, Namespace);
}
if (CheckExtendedPropertyExists ())
if (CheckExtendedPropertyExists (tables, relations))
nsmgr.AddNamespace (XmlConstants.MspropPrefix, XmlConstants.MspropNamespace);
if (atts.Count > 0)
@@ -1416,7 +1419,7 @@ namespace System.Data {
elem.Name = XmlConvert.EncodeName (DataSetName);
// Add namespaces used in DataSet components (tables, columns, ...)
foreach (DataTable dt in Tables) {
foreach (DataTable dt in tables) {
foreach (DataColumn col in dt.Columns)
CheckNamespace (col.Prefix, col.Namespace, nsmgr, schema);
CheckNamespace (dt.Prefix, dt.Namespace, nsmgr, schema);
@@ -1475,11 +1478,13 @@ namespace System.Data {
return schema;
}
private bool CheckExtendedPropertyExists ()
private bool CheckExtendedPropertyExists (
DataTableCollection tables,
DataRelationCollection relations)
{
if (ExtendedProperties.Count > 0)
return true;
foreach (DataTable dt in Tables) {
foreach (DataTable dt in tables) {
if (dt.ExtendedProperties.Count > 0)
return true;
foreach (DataColumn col in dt.Columns)
@@ -1489,7 +1494,9 @@ namespace System.Data {
if (c.ExtendedProperties.Count > 0)
return true;
}
foreach (DataRelation rel in Relations)
if (relations == null)
return false;
foreach (DataRelation rel in relations)
if (rel.ExtendedProperties.Count > 0)
return true;
return false;
@@ -948,9 +948,13 @@ namespace System.Data {
/// </summary>
public void ImportRow (DataRow row)
{
if (row.RowState == DataRowState.Detached)
return;
DataRow newRow = NewRow();
Rows.Add(newRow);
row.CopyValuesToRow(newRow);
row.CopyValuesToRow (newRow);
Rows.Add (newRow);
row.CopyState (newRow);
}
@@ -48,6 +48,7 @@ internal class XmlConstants
/// </summary>
public const string SchemaNamespace = "http://www.w3.org/2001/XMLSchema";
public const string XmlnsNS = "http://www.w3.org/2000/xmlns/";
//xs elements and values
//TODO - these must exist somwhere else???
@@ -146,8 +146,6 @@ namespace System.Data
internal class XmlDataInferenceLoader
{
const string XmlnsNS = "http://www.w3.org/2000/xmlns/";
public static void Infer (DataSet dataset, XmlDocument document, XmlReadMode mode, string [] ignoredNamespaces)
{
new XmlDataInferenceLoader (dataset, document, mode, ignoredNamespaces).ReadXml ();
@@ -348,7 +346,7 @@ namespace System.Data
bool hasText = false;
foreach (XmlAttribute attr in el.Attributes) {
if (attr.NamespaceURI == XmlnsNS)
if (attr.NamespaceURI == XmlConstants.XmlnsNS)
continue;
if (ignoredNamespaces.Contains (attr.NamespaceURI))
continue;
@@ -460,7 +458,7 @@ namespace System.Data
private ElementMappingType GetElementMappingType (XmlElement el)
{
foreach (XmlAttribute attr in el.Attributes) {
if (attr.NamespaceURI == XmlnsNS)
if (attr.NamespaceURI == XmlConstants.XmlnsNS)
continue;
if (ignoredNamespaces.Contains (attr.NamespaceURI))
continue;
@@ -481,7 +479,7 @@ namespace System.Data
{
XmlElement top = document.DocumentElement;
foreach (XmlAttribute attr in top.Attributes) {
if (attr.NamespaceURI == XmlnsNS)
if (attr.NamespaceURI == XmlConstants.XmlnsNS)
continue;
if (ignoredNamespaces.Contains (attr.NamespaceURI))
continue;
@@ -83,8 +83,6 @@ namespace System.Data
internal class XmlDataReader
{
const string xmlnsNS = "http://www.w3.org/2000/xmlns/";
public static void ReadXml (
DataSet dataset, XmlReader reader, XmlReadMode mode)
{
@@ -176,7 +174,7 @@ namespace System.Data
// Consume attributes
if (reader.MoveToFirstAttribute ()) {
do {
if (reader.NamespaceURI == xmlnsNS)
if (reader.NamespaceURI == XmlConstants.XmlnsNS)
continue;
ReadElementAttribute (row);
} while (reader.MoveToNextAttribute ());
@@ -39,6 +39,7 @@
using System;
using System.Data;
using System.Xml;
using System.Xml.Schema;
using System.Xml.XPath;
using System.Collections;
using System.Globalization;
@@ -211,7 +212,45 @@ namespace System.Data {
reader.ReadEndElement ();
}
private void LoadColumns (DataTable Table, DataRow Row, XmlReader reader, DataRowVersion loadType)
private void LoadColumns (DataTable Table, DataRow Row,
XmlReader reader, DataRowVersion loadType)
{
LoadColumnAttributes (Table, Row, reader, loadType);
LoadColumnChildren (Table, Row, reader, loadType);
}
private void LoadColumnAttributes (DataTable Table, DataRow Row,
XmlReader reader, DataRowVersion loadType)
{
if (!reader.HasAttributes // this check will be faster
|| !reader.MoveToFirstAttribute ())
return;
do {
switch (reader.NamespaceURI) {
case XmlConstants.XmlnsNS:
case XmlConstants.DiffgrNamespace:
case XmlConstants.MsdataNamespace:
case XmlConstants.MspropNamespace:
case XmlSchema.Namespace:
continue;
}
DataColumn c = Table.Columns [reader.LocalName];
if (c == null ||
c.ColumnMapping != MappingType.Attribute) continue;
if (c.Namespace == null && reader.NamespaceURI == String.Empty ||
c.Namespace == reader.NamespaceURI) {
object data = XmlDataLoader.StringToObject (c.DataType, reader.Value);
if (loadType == DataRowVersion.Current)
Row [c] = data;
else
Row.SetOriginalValue (c.ColumnName, data);
} // otherwise just ignore as well as unknown elements.
} while (reader.MoveToNextAttribute ());
reader.MoveToElement ();
}
private void LoadColumnChildren (DataTable Table, DataRow Row,
XmlReader reader, DataRowVersion loadType)
{
if (reader.IsEmptyElement) {
reader.Skip ();
@@ -1,3 +1,24 @@
2005-02-01 Sureshkumar T <[email protected]>
Ankit Jain <[email protected]>
* DataRowTest.cs: Added case for SetparentRow: create
DataRelations with createConstraints=false.
2005-01-28 Sureshkumar T <[email protected]>
* DataTableTest.cs: added test case for checking ImportRow when
the row state is detached. Test case by Ankit Jain.
2005-01-19 Sureshkumar T <[email protected]>
* DataRelationCollectionTest.cs:
"Remove" Method: Should not throw
exception while removing null data relaiton.
"RemoveAt" Method: Should throw only IndexOutRange exception
not ArgumentException.
This is same for all MS.NET versions.
2004-10-12 Atsushi Enomoto <[email protected]>
* DataSetTest.cs : now xs:schema contains xmlns="".
@@ -299,15 +299,7 @@ namespace MonoTests.System.Data
drcol.Add(dr1);
DataRelation drnull = null;
try
{
drcol.Remove(drnull);
Fail("Err:: drcol.Remove(null) must fail");
}
catch(Exception e)
{
AssertEquals("test#3", typeof (ArgumentNullException), e.GetType());
}
drcol.Remove(drnull);
DataRelation newdr = new DataRelation("newdr"
,_dataset.Tables["Customer"].Columns["custid"]
@@ -354,7 +346,7 @@ namespace MonoTests.System.Data
}
catch(Exception e)
{
AssertEquals ("test#1", typeof (ArgumentException), e.GetType ());
AssertEquals ("test#1", typeof (IndexOutOfRangeException), e.GetType ());
AssertEquals ("test#2", "There is no row at position -1.", e.Message);
}
try
@@ -364,7 +356,7 @@ namespace MonoTests.System.Data
}
catch(Exception e)
{
AssertEquals ("test#3", typeof (ArgumentException), e.GetType ());
AssertEquals ("test#3", typeof (IndexOutOfRangeException), e.GetType ());
AssertEquals ("test#4", "There is no row at position 101.",e.Message);
}
@@ -334,7 +334,24 @@ namespace MonoTests.System.Data
rowC.SetParentRow (table.Rows [0], dr);
AssertEquals ("#A44", table.Rows [0], (tableC.Rows [0]).GetParentRow (dr));
AssertEquals ("#PRT-01", table.Rows [0], (tableC.Rows [0]).GetParentRow (dr));
AssertEquals ("#PRT-02", tableC.Rows [0], (table.Rows [0]).GetChildRows (dr) [0]);
ds.Relations.Clear ();
dr = new DataRelation ("PO", table.Columns ["Id"], tableC.Columns ["Id"], false);
ds.Relations.Add (dr);
rowC.SetParentRow (table.Rows [0], dr);
AssertEquals ("#PRT-03", table.Rows [0], (tableC.Rows [0]).GetParentRow (dr));
AssertEquals ("#PRT-04", tableC.Rows [0], (table.Rows [0]).GetChildRows (dr) [0]);
ds.Relations.Clear ();
dr = new DataRelation ("PO", table.Columns ["Id"], tableC.Columns ["Id"], false);
tableC.ParentRelations.Add (dr);
rowC.SetParentRow (table.Rows [0]);
AssertEquals ("#PRT-05", table.Rows [0], (tableC.Rows [0]).GetParentRow (dr));
AssertEquals ("#PRT-06", tableC.Rows [0], (table.Rows [0]).GetChildRows (dr) [0]);
}
@@ -1111,6 +1111,28 @@ namespace MonoTests.System.Data
AssertEquals ("#A03", DataRowState.Modified, table.Rows [2].RowState);
AssertEquals ("#A04", DataRowState.Added, table.Rows [3].RowState);
}
public void ImportRow2 ()
{
DataTable table = new DataTable ();
DataColumn col = new DataColumn ();
col.ColumnName = "Id";
col.DataType = Type.GetType ("System.Int32");
table.Columns.Add (col);
table.PrimaryKey = new DataColumn [] {col};
col = new DataColumn ();
col.ColumnName = "Name";
col.DataType = Type.GetType ("System.String");
table.Columns.Add (col);
DataRow row = table.NewRow ();
row ["Id"] = 147;
row ["name"] = "Abc";
table.ImportRow (row);
}
[Test]
public void ClearReset () //To test Clear and Reset methods
{
@@ -1,3 +1,14 @@
2005-03-14 Gonzalo Paniagua Javier <[email protected]>
* DirectoryEntry.cs: username and password are now initialized to null.
Patch by Boris Kirzner (Mainsoft).
2005-03-14 Gonzalo Paniagua Javier <[email protected]>
* PropertyValueCollection.cs: the Value property for an empty collection
is now null and setting Value to null clears the collection. Patch by
Boris Kirzner (Mainsoft).
2004-06-15 Gert Driesen <[email protected]>
* DirectoryServicesPermission.cs: renamed field to match MS.NET
@@ -54,8 +54,8 @@ namespace System.DirectoryServices
private string _Path="";
private string _Name=null;
private DirectoryEntry _Parent=null;
private string _Username="";
private string _Password="";
private string _Username;
private string _Password;
//private string _Nativeguid;
private PropertyCollection _Properties = null;
private string _SchemaClassName=null;
@@ -157,25 +157,27 @@ namespace System.DirectoryServices
{
get
{
if(this.Count==1)
{
return (object) List[0];
}
else
{
switch (Count) {
case 0 :
return null;
case 1 :
return (object) List[0];
default :
// System.Object[] oArray= new System.Object[this.Count];
// object[] oArray= new object[this.Count];
// Array.Copy((System.Array)List,0,(System.Array)oArray,0,this.Count);
Array LArray = Array.CreateInstance( Type.GetType("System.Object"), this.Count );
for ( int i = LArray.GetLowerBound(0); i <= LArray.GetUpperBound(0); i++ )
LArray.SetValue( List[i], i );
return LArray;
Array LArray = Array.CreateInstance( Type.GetType("System.Object"), this.Count );
for ( int i = LArray.GetLowerBound(0); i <= LArray.GetUpperBound(0); i++ )
LArray.SetValue( List[i], i );
return LArray;
}
}
set
{
List.Clear();
Add(value);
if (value != null) {
Add(value);
}
}
}
@@ -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,10 @@
2004-12-17 Lluis Sanchez Gual <[email protected]>
* HttpHelper.cs: Removed unused method. Optimized CopyStream method.
* HttpServerChannel.cs: SendResponse does not return a bool any
more, it throws an exception when it fails.
* HttpServer.cs: Improved handling of errors.
2004-05-26 Lluis Sanchez Gual <[email protected]>
* HttpServerChannel.cs: Default port is 0.
@@ -326,9 +326,9 @@ namespace System.Runtime.Remoting.Channels.Http
requestHeaders [CommonTransportKeys.RequestUri] = uri;
CreateUrl(uri,out url);
HttpWebRequest httpWebRequest = CreateWebRequest(url,requestHeaders,requestStream);
HttpWebRequest httpWebRequest = CreateWebRequest (url,requestHeaders,requestStream);
SendAndRecieve(httpWebRequest,out responseHeaders,out responseStream);
SendAndRecieve (httpWebRequest,out responseHeaders,out responseStream);
}
@@ -567,15 +567,11 @@ namespace System.Runtime.Remoting.Channels.Http
}
Stream reqStream = request.GetRequestStream();
if (requestStream is MemoryStream)
{
MemoryStream memStream = (MemoryStream)requestStream;
reqStream.Write (memStream.GetBuffer(), 0, (int)memStream.Length);
}
else
try {
HttpHelper.CopyStream(requestStream, reqStream);
reqStream.Close();
} finally {
reqStream.Close();
}
return request;
}
@@ -602,17 +598,19 @@ namespace System.Runtime.Remoting.Channels.Http
private void ReceiveResponse (HttpWebResponse httpWebResponse, out ITransportHeaders responseHeaders, out Stream responseStream)
{
responseHeaders = new TransportHeaders();
Stream webStream = httpWebResponse.GetResponseStream();
try
{
Stream webStream = httpWebResponse.GetResponseStream();
if (httpWebResponse.ContentLength != -1)
{
byte[] buffer = new byte [httpWebResponse.ContentLength];
int nr = 0;
while (nr < buffer.Length)
nr += webStream.Read (buffer, nr, buffer.Length - nr);
while (nr < buffer.Length) {
int pr = webStream.Read (buffer, nr, buffer.Length - nr);
if (pr == 0) throw new RemotingException ("Connection closed");
nr += pr;
}
responseStream = new MemoryStream (buffer);
}
else
@@ -632,8 +630,8 @@ namespace System.Runtime.Remoting.Channels.Http
}
finally
{
if(httpWebResponse!=null)
httpWebResponse.Close();
webStream.Close ();
httpWebResponse.Close();
}
}
@@ -73,60 +73,18 @@ namespace System.Runtime.Remoting.Channels.Http
return false;
}
public static Stream CopyStream(Stream inStream)
public static void CopyStream (Stream inStream, Stream outStream)
{
Stream outStream = new MemoryStream();
int temp;
try
{
while(true)
{
temp = inStream.ReadByte();
if(temp==-1)
break;
outStream.WriteByte((byte)temp);
}
outStream.Flush();
outStream.Seek(0,SeekOrigin.Begin);
}
catch(Exception e)
{
Console.WriteLine(e);
}
return outStream;
}
byte[] buffer = new byte [1024];
public static bool CopyStream(Stream inStream, Stream outStream)
{
int temp;
int nr;
while ((nr = inStream.Read (buffer, 0, buffer.Length)) > 0)
outStream.Write (buffer, 0, nr);
try
{
while(true)
{
temp = inStream.ReadByte();
if(temp==-1)
break;
outStream.WriteByte((byte)temp);
}
outStream.Flush();
if(outStream.CanSeek)
outStream.Seek(0,SeekOrigin.Begin);
}
catch(Exception e)
{
Console.WriteLine(e);
return false;
}
return true;
outStream.Flush ();
if (outStream.CanSeek)
outStream.Seek (0,SeekOrigin.Begin);
}
public static String GetHostName()
@@ -59,12 +59,6 @@ namespace System.Runtime.Remoting.Channels.Http
Sink = sink;
}
public RequestArguments (Stream inputStream, Stream outputStream, HttpServerTransportSink sink)
{
InputStream = inputStream;
OutputStream = outputStream;
Sink = sink;
}
public Stream InputStream;
public Stream OutputStream;
public HttpServerTransportSink Sink;
@@ -105,9 +99,8 @@ namespace System.Runtime.Remoting.Channels.Http
else
buffer = new byte [0];
//Step (5)
SendRequestForChannel (reqArg, HeaderFields, CustomHeaders, buffer);
SendRequestForChannel (reqArg, HeaderFields, CustomHeaders, buffer);
}
private static ArrayList RecieveHeader (RequestArguments reqArg)
@@ -215,8 +208,7 @@ namespace System.Runtime.Remoting.Channels.Http
SendResponse (reqArg, 408, null, null);
break;
default :
//<Exception>
break;
throw e;
}
return false;
@@ -261,7 +253,7 @@ namespace System.Runtime.Remoting.Channels.Http
}
public static bool SendResponse (RequestArguments reqArg, int httpStatusCode, ITransportHeaders headers, Stream responseStream)
public static void SendResponse (RequestArguments reqArg, int httpStatusCode, ITransportHeaders headers, Stream responseStream)
{
byte [] headersBuffer = null;
byte [] entityBuffer = null;
@@ -309,22 +301,11 @@ namespace System.Runtime.Remoting.Channels.Http
headersBuffer = Encoding.ASCII.GetBytes (responseStr.ToString());
try
{
//send headersBuffer
reqArg.OutputStream.Write (headersBuffer, 0, headersBuffer.Length);
//send headersBuffer
reqArg.OutputStream.Write (headersBuffer, 0, headersBuffer.Length);
if (entityBuffer != null)
reqArg.OutputStream.Write (entityBuffer, 0, entityBuffer.Length);
}
catch
{
//<EXCEPTION>
//may be its the client's fault so just return with false
return false;
}
return true;
if (entityBuffer != null)
reqArg.OutputStream.Write (entityBuffer, 0, entityBuffer.Length);
}
internal static string GetReasonPhrase (int HttpStatusCode)
@@ -353,17 +353,11 @@ namespace System.Runtime.Remoting.Channels.Http
switch (processing)
{
case ServerProcessing.Complete:
if (!HttpServer.SendResponse (reqArg, 200, responseHeaders, responseStream))
{
//ooops couldnot send response !!!!!! and error occured
}
HttpServer.SendResponse (reqArg, 200, responseHeaders, responseStream);
break;
case ServerProcessing.OneWay:
if (!HttpServer.SendResponse (reqArg, 200, null, null))
{
//ooops couldnot send response !!!!!! and error occured
}
HttpServer.SendResponse (reqArg, 200, null, null);
break;
case ServerProcessing.Async:
@@ -1,3 +1,29 @@
2004-12-17 Lluis Sanchez Gual <[email protected]>
* TcpMessageIO.cs: Removed some more WriteByte calls.
* TcpClientTransportSink.cs: Flush the net stream after writing
a message.
2004-12-10 Lluis Sanchez Gual <[email protected]>
* TcpChannel.cs: Don't use regular expressions to parse the url, it's
too slow.
* TcpMessageIO.cs: Read byte chunks using the new StreamRead method,
which won't block if the connection is closed.
* TcpServerChannel.cs: Flush the stream after writing the response.
Wrap the close call in a try/catch (some bytes can be left in the
buffered stream if a connection is suddently closed, and it will fail
when trying to flush them).
2004-12-09 Lluis Sanchez Gual <[email protected]>
* TcpConnectionPool.cs: Access the socket stream through a
BufferedStream.
* TcpMessageIO.cs: Avoid ReadByte().
* TcpServerChannel.cs: Access the socket stream through a
BufferedStream. Abort the connection if an unknown message is received.
All this fixes performance bug #70337.
2004-07-15 Lluis Sanchez Gual <[email protected]>
* TcpServerChannel.cs: Set channel name from the provided properties.
@@ -140,17 +140,26 @@ namespace System.Runtime.Remoting.Channels.Tcp
objectURI = null;
port = 0;
Match m = Regex.Match (url, "tcp://([^:]+):([0-9]+)/?(.*)");
if (!url.StartsWith ("tcp://")) return null;
int colon = url.IndexOf (':', 6);
if (colon == -1) return null;
string host = url.Substring (6, colon - 6);
if (!m.Success)
return null;
int slash = url.IndexOf ('/', colon + 1);
if (slash == -1) slash = url.Length;
string port_str = url.Substring (colon + 1, slash - colon - 1);
string host = m.Groups[1].Value;
string port_str = m.Groups[2].Value;
objectURI = m.Groups[3].Value;
port = Convert.ToInt32 (port_str);
if (slash < url.Length)
objectURI = url.Substring (slash + 1);
if (objectURI == string.Empty) objectURI = null;
try {
port = Convert.ToInt32 (port_str);
} catch {
return null;
}
if (objectURI == string.Empty)
objectURI = null;
return host;
}
@@ -84,6 +84,7 @@ namespace System.Runtime.Remoting.Channels.Tcp
connection = TcpConnectionPool.GetConnection (_host, _port);
TcpMessageIO.SendMessageStream (connection.Stream, requestStream, headers, connection.Buffer);
connection.Stream.Flush ();
if (!isOneWay)
{
@@ -167,6 +168,7 @@ namespace System.Runtime.Remoting.Channels.Tcp
// Sends the message
connection = TcpConnectionPool.GetConnection (_host, _port);
TcpMessageIO.SendMessageStream (connection.Stream, requestStream, requestHeaders, connection.Buffer);
connection.Stream.Flush ();
// Reads the response
MessageStatus status = TcpMessageIO.ReceiveMessageStatus (connection.Stream);
@@ -151,7 +151,7 @@ namespace System.Runtime.Remoting.Channels.Tcp
{
_pool = pool;
_client = client;
_stream = client.GetStream();
_stream = new BufferedStream (client.GetStream());
_controlTime = DateTime.Now;
_buffer = new byte[TcpMessageIO.DefaultStreamBufferSize];
}
@@ -50,6 +50,14 @@ namespace System.Runtime.Remoting.Channels.Tcp
// Identifies an incoming message
public static MessageStatus ReceiveMessageStatus (Stream networkStream)
{
byte[] buffer = new byte[6];
try {
StreamRead (networkStream, buffer, 6);
} catch {
return MessageStatus.Unknown;
}
try
{
bool[] isOnTrack = new bool[_msgHeaders.Length];
@@ -59,7 +67,7 @@ namespace System.Runtime.Remoting.Channels.Tcp
while (atLeastOneOnTrack)
{
atLeastOneOnTrack = false;
byte c = (byte)networkStream.ReadByte();
byte c = buffer [i];
for (int n = 0; n<_msgHeaders.Length; n++)
{
if (i > 0 && !isOnTrack[n]) continue;
@@ -78,6 +86,18 @@ namespace System.Runtime.Remoting.Channels.Tcp
return MessageStatus.CancelSignal;
}
}
static bool StreamRead (Stream networkStream, byte[] buffer, int count)
{
int nr = 0;
do {
int pr = networkStream.Read (buffer, nr, count - nr);
if (pr == 0)
throw new RemotingException ("Connection closed");
nr += pr;
} while (nr < count);
return true;
}
public static void SendMessageStream (Stream networkStream, Stream data, ITransportHeaders requestHeaders, byte[] buffer)
{
@@ -127,6 +147,11 @@ namespace System.Runtime.Remoting.Channels.Tcp
}
}
}
static byte[] msgUriTransportKey = new byte[] { 4, 0, 1, 1 };
static byte[] msgContentTypeTransportKey = new byte[] { 6, 0, 1, 1 };
static byte[] msgDefaultTransportKey = new byte[] { 1, 0, 1 };
static byte[] msgHeaderTerminator = new byte[] { 0, 0 };
private static void SendHeaders(Stream networkStream, ITransportHeaders requestHeaders, byte[] buffer)
{
@@ -140,39 +165,34 @@ namespace System.Runtime.Remoting.Channels.Tcp
switch (hdr.Key.ToString())
{
case CommonTransportKeys.RequestUri:
buffer[0] = 4; buffer[1] = 0; buffer[2] = 1;
networkStream.Write(buffer, 0, 3);
networkStream.Write (msgUriTransportKey, 0, 4);
break;
case "Content-Type":
buffer[0] = 6; buffer[1] = 0; buffer[2] = 1;
networkStream.Write(buffer, 0, 3);
networkStream.Write (msgContentTypeTransportKey, 0, 4);
break;
default:
buffer[0] = 1; buffer[1] = 0; buffer[2] = 1;
networkStream.Write(buffer, 0, 3);
networkStream.Write (msgDefaultTransportKey, 0, 3);
SendString (networkStream, hdr.Key.ToString(), buffer);
networkStream.WriteByte (1);
break;
}
networkStream.WriteByte (1);
SendString (networkStream, hdr.Value.ToString(), buffer);
}
}
networkStream.WriteByte (0); // End of headers
networkStream.WriteByte (0);
networkStream.Write (msgHeaderTerminator, 0, 2); // End of headers
}
public static ITransportHeaders ReceiveHeaders (Stream networkStream, byte[] buffer)
{
byte headerType;
headerType = (byte) networkStream.ReadByte ();
networkStream.ReadByte ();
StreamRead (networkStream, buffer, 2);
byte headerType = buffer [0];
TransportHeaders headers = new TransportHeaders ();
while (headerType != 0)
{
string key;
networkStream.ReadByte (); // byte 1
StreamRead (networkStream, buffer, 1); // byte 1
switch (headerType)
{
case 4: key = CommonTransportKeys.RequestUri; break;
@@ -180,11 +200,11 @@ namespace System.Runtime.Remoting.Channels.Tcp
case 1: key = ReceiveString (networkStream, buffer); break;
default: throw new NotSupportedException ("Unknown header code: " + headerType);
}
networkStream.ReadByte (); // byte 1
StreamRead (networkStream, buffer, 1); // byte 1
headers[key] = ReceiveString (networkStream, buffer);
headerType = (byte) networkStream.ReadByte ();
networkStream.ReadByte ();
StreamRead (networkStream, buffer, 2);
headerType = buffer [0];
}
return headers;
@@ -197,31 +217,20 @@ namespace System.Runtime.Remoting.Channels.Tcp
if (buffer == null) buffer = new byte[DefaultStreamBufferSize];
// Reads header tag: 0 -> Stream with headers or 2 -> Response Stream
byte head = (byte)networkStream.ReadByte();
byte c = (byte)networkStream.ReadByte();
c = (byte)networkStream.ReadByte();
c = (byte)networkStream.ReadByte();
// +
// Gets the length of the data stream
int nr = 0;
while (nr < 4)
nr += networkStream.Read (buffer, nr, 4 - nr);
StreamRead (networkStream, buffer, 8);
int byteCount = (buffer [0] | (buffer [1] << 8) |
(buffer [2] << 16) | (buffer [3] << 24));
int byteCount = (buffer [4] | (buffer [5] << 8) |
(buffer [6] << 16) | (buffer [7] << 24));
// Reads the headers
headers = ReceiveHeaders (networkStream, buffer);
byte[] resultBuffer = new byte[byteCount];
StreamRead (networkStream, resultBuffer, byteCount);
nr = 0;
while (nr < byteCount)
nr += networkStream.Read (resultBuffer, nr, byteCount - nr);
return new MemoryStream(resultBuffer);
return new MemoryStream (resultBuffer);
}
private static void SendString (Stream networkStream, string str, byte[] buffer)
@@ -248,9 +257,7 @@ namespace System.Runtime.Remoting.Channels.Tcp
private static string ReceiveString (Stream networkStream, byte[] buffer)
{
int nr = 0;
while (nr < 4)
nr += networkStream.Read (buffer, nr, 4 - nr);
StreamRead (networkStream, buffer, 4);
// Reads the number of bytes (not chars!)
@@ -267,13 +274,10 @@ namespace System.Runtime.Remoting.Channels.Tcp
// Reads the string
nr = 0;
while (nr < byteCount)
nr += networkStream.Read (buffer, nr, byteCount - nr);
char[] chars = Encoding.UTF8.GetChars(buffer, 0, byteCount);
StreamRead (networkStream, buffer, byteCount);
char[] chars = Encoding.UTF8.GetChars (buffer, 0, byteCount);
return new string(chars);
return new string (chars);
}
}
@@ -304,7 +304,7 @@ namespace System.Runtime.Remoting.Channels.Tcp
public void ProcessMessages()
{
_stream = _client.GetStream();
_stream = new BufferedStream (_client.GetStream());
try
{
@@ -319,10 +319,12 @@ namespace System.Runtime.Remoting.Channels.Tcp
_sink.InternalProcessMessage (this);
break;
case MessageStatus.Unknown:
case MessageStatus.CancelSignal:
end = true;
break;
}
_stream.Flush ();
}
}
catch (Exception ex)
@@ -331,7 +333,10 @@ namespace System.Runtime.Remoting.Channels.Tcp
}
finally
{
_stream.Close();
try {
_stream.Close();
}
catch { }
_serverChannel.ReleaseConnection (Thread.CurrentThread);
}
}
@@ -1,3 +1,13 @@
2005-02-10 Lluis Sanchez Gual <[email protected]>
* SoapFormatter.cs: Don't store the SoapWriter in an instance field,
it is not needed and it is not thread safe. This fixes bug #72344.
* SoapReader.cs: Serialize byte arrays using base64 encoding.
GetComponentType should always return the type if
specified, GetId can now be !=0 for base64 arrrays.
* SoapTypeMapper.cs: Register byte[] as base64 xml type.
* SoapWriter.cs: Handle base64 encoded byte arrays.
2004-06-10 Lluis Sanchez Gual <[email protected]>
* SoapWriter.cs: In SerializeArray, consider 1 a valid id.
@@ -45,7 +45,6 @@ namespace System.Runtime.Serialization.Formatters.Soap {
}
public sealed class SoapFormatter: IRemotingFormatter, IFormatter {
private SoapWriter _soapWriter;
private SerializationBinder _binder;
private StreamingContext _context;
private ISurrogateSelector _selector;
@@ -102,11 +101,11 @@ namespace System.Runtime.Serialization.Formatters.Soap {
throw new SerializationException("Can't write in the serialization stream");
if(graph == null)
throw new ArgumentNullException("graph");
_soapWriter = new SoapWriter(serializationStream, _selector, _context, _topObject);
SoapWriter soapWriter = new SoapWriter(serializationStream, _selector, _context, _topObject);
CultureInfo savedCi = CultureInfo.CurrentCulture;
try {
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
_soapWriter.Serialize (graph, headers, _typeFormat, _assemblyFormat);
soapWriter.Serialize (graph, headers, _typeFormat, _assemblyFormat);
}
finally {
Thread.CurrentThread.CurrentCulture = savedCi;
@@ -193,10 +193,12 @@ namespace System.Runtime.Serialization.Formatters.Soap {
private Type GetComponentType()
{
Type type = null;
if(GetId() != 0) return typeof(string);
string strValue = xmlReader["type", XmlSchema.InstanceNamespace];
if(strValue == null) return null;
if(strValue == null) {
if(GetId() != 0) return typeof(string);
return null;
}
string[] strName = strValue.Split(':');
string namespaceURI = xmlReader.LookupNamespace(strName[0]);
type = mapper[new Element(string.Empty, strName[1], namespaceURI)];
@@ -325,6 +327,13 @@ namespace System.Runtime.Serialization.Formatters.Soap {
private object DeserializeArray(long id)
{
// Special case for base64 byte arrays
if (GetComponentType () == typeof(byte[])) {
byte[] data = Convert.FromBase64String (xmlReader.ReadElementString());
RegisterObject(id, data, null, 0, null, null);
return data;
}
// Get the array properties
string strArrayType = xmlReader["arrayType", SoapTypeMapper.SoapEncodingNamespace];
string[] arrayInfo = strArrayType.Split(':','[',',',']');
@@ -359,7 +359,10 @@ namespace System.Runtime.Serialization.Formatters.Soap {
xmlNodeToTypeTable.Add(element, elementType.AssemblyQualifiedName);
typeToXmlNodeTable.Add(elementType.AssemblyQualifiedName, element);
element = new Element("base64", SoapEncodingNamespace);
elementType = typeof(byte[]);
xmlNodeToTypeTable.Add(element, elementType.AssemblyQualifiedName);
typeToXmlNodeTable.Add(elementType.AssemblyQualifiedName, element);
}
public static string GetXsdValue (object value)
@@ -448,6 +448,13 @@ namespace System.Runtime.Serialization.Formatters.Soap {
Element xmlArrayType = _mapper[arrayType];
_xmlWriter.WriteStartElement(element.Prefix, element.LocalName, element.NamespaceURI);
if(currentArrayId > 0) Id(currentArrayId);
if (arrayType == typeof(byte)) {
EncodeType (currentArray.GetType());
_xmlWriter.WriteString (Convert.ToBase64String ((byte[])currentArray));
_xmlWriter.WriteFullEndElement();
return;
}
if(_xmlWriter.LookupPrefix(xmlArrayType.NamespaceURI) == null)
{
@@ -1,3 +1,23 @@
2005-02-07 Lluis Sanchez Gual <[email protected]>
* XmlReturnWriter.cs, SoapDocumentationHandler.cs: Use utf-8 encoding
when generating xml responses, wsdl documents and schemas. This fixes
bug #72202.
2004-12-09 Lluis Sanchez Gual <[email protected]>
* ValueCollectionParameterReader.cs: Parse parameters in the correct
way, Convert.ChangeType is not enough. This fixes bug #70266.
Removed some types that are not supported as parameters.
* MimeFormatter.cs: Added methods for xml <-> object conversion.
* UrlEncodedParameterWriter.cs: Use a more elaborate method for converting
from object to string, ToString() is not enough.
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.
@@ -30,6 +30,7 @@
//
using System.Web.Services;
using System.Xml;
namespace System.Web.Services.Protocols {
public abstract class MimeFormatter {
@@ -76,6 +77,55 @@ namespace System.Web.Services.Protocols {
public abstract void Initialize (object initializer);
internal static object StringToObj (Type type, string value)
{
switch (Type.GetTypeCode (type))
{
case TypeCode.Boolean: return XmlConvert.ToBoolean (value);
case TypeCode.Byte: return XmlConvert.ToByte (value);
case TypeCode.DateTime: return XmlConvert.ToDateTime (value);
case TypeCode.Decimal: return XmlConvert.ToDecimal (value);
case TypeCode.Double: return XmlConvert.ToDouble (value);
case TypeCode.Int16: return XmlConvert.ToInt16 (value);
case TypeCode.Int32: return XmlConvert.ToInt32 (value);
case TypeCode.Int64: return XmlConvert.ToInt64 (value);
case TypeCode.SByte: return XmlConvert.ToSByte (value);
case TypeCode.Single: return XmlConvert.ToSingle (value);
case TypeCode.UInt16: return XmlConvert.ToUInt16 (value);
case TypeCode.UInt32: return XmlConvert.ToUInt32 (value);
case TypeCode.UInt64: return XmlConvert.ToUInt64 (value);
case TypeCode.String: return value;
case TypeCode.Char:
if (value.Length != 1) throw new InvalidOperationException ("Invalid char value");
return value [0];
}
throw new InvalidOperationException ("Type not supported");
}
internal static string ObjToString (object value)
{
if (value == null) return "";
switch (Type.GetTypeCode (value.GetType ()))
{
case TypeCode.Boolean: return XmlConvert.ToString ((bool)value);
case TypeCode.Byte: return XmlConvert.ToString ((byte)value);
case TypeCode.Char: return XmlConvert.ToString ((char)value);
case TypeCode.DateTime: return XmlConvert.ToString ((DateTime)value);
case TypeCode.Decimal: return XmlConvert.ToString ((decimal)value);
case TypeCode.Double: return XmlConvert.ToString ((double)value);
case TypeCode.Int16: return XmlConvert.ToString ((Int16)value);
case TypeCode.Int32: return XmlConvert.ToString ((Int32)value);
case TypeCode.Int64: return XmlConvert.ToString ((Int64)value);
case TypeCode.SByte: return XmlConvert.ToString ((sbyte)value);
case TypeCode.Single: return XmlConvert.ToString ((Single)value);
case TypeCode.UInt16: return XmlConvert.ToString ((UInt16)value);
case TypeCode.UInt32: return XmlConvert.ToString ((UInt32)value);
case TypeCode.UInt64: return XmlConvert.ToString ((UInt64)value);
case TypeCode.String: return value as string;
}
throw new InvalidOperationException ("Type not supported");
}
#endregion // Methods
}
}
@@ -31,6 +31,8 @@
using System;
using System.Web;
using System.IO;
using System.Xml;
using System.Text;
using System.Xml.Serialization;
using System.Xml.Schema;
using System.Web.Services.Description;
@@ -68,7 +70,6 @@ namespace System.Web.Services.Protocols
string help = WSConfig.Instance.WsdlHelpPage;
string path = Path.GetDirectoryName (WSConfig.Instance.ConfigFilePath);
string file = Path.GetFileName (WSConfig.Instance.ConfigFilePath);
string appPath = AppDomain.CurrentDomain.GetData (".appPath").ToString ();
string vpath;
if (path.StartsWith (appPath)) {
@@ -127,7 +128,9 @@ namespace System.Web.Services.Protocols
if (wsdlId != null && wsdlId != "") di = int.Parse (wsdlId);
context.Response.ContentType = "text/xml; charset=utf-8";
GetDescriptions() [di].Write (context.Response.OutputStream);
XmlTextWriter xtw = new XmlTextWriter (context.Response.OutputStream, new UTF8Encoding (false));
xtw.Formatting = Formatting.Indented;
GetDescriptions() [di].Write (xtw);
}
void GenerateDiscoDocument (HttpContext context)
@@ -155,7 +158,9 @@ namespace System.Web.Services.Protocols
}
context.Response.ContentType = "text/xml; charset=utf-8";
doc.Write (context.Response.OutputStream);
XmlTextWriter xtw = new XmlTextWriter (context.Response.OutputStream, new UTF8Encoding (false));
xtw.Formatting = Formatting.Indented;
doc.Write (xtw);
}
void GenerateSchema (HttpContext context, string schemaId)
@@ -164,7 +169,9 @@ namespace System.Web.Services.Protocols
if (schemaId != null && schemaId != "") di = int.Parse (schemaId);
context.Response.ContentType = "text/xml; charset=utf-8";
GetSchemas() [di].Write (context.Response.OutputStream);
XmlTextWriter xtw = new XmlTextWriter (context.Response.OutputStream, new UTF8Encoding (false));
xtw.Formatting = Formatting.Indented;
GetSchemas() [di].Write (xtw);
}
void GenerateCode (HttpContext context, string langId)
@@ -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)
{
@@ -75,13 +75,13 @@ namespace System.Web.Services.Protocols {
{
writer.Write (HttpUtility.UrlEncode (name, requestEncoding));
writer.Write ("=");
writer.Write (HttpUtility.UrlEncode (value.ToString(), requestEncoding));
writer.Write (HttpUtility.UrlEncode (ObjToString (value), requestEncoding));
}
else
{
writer.Write (HttpUtility.UrlEncode (name));
writer.Write ("=");
writer.Write (HttpUtility.UrlEncode (value.ToString()));
writer.Write (HttpUtility.UrlEncode (ObjToString (value)));
}
}
@@ -80,10 +80,7 @@ namespace System.Web.Services.Protocols {
return ( type.IsPrimitive ||
type == typeof(string) ||
type == typeof(DateTime) ||
type == typeof(Guid) ||
type == typeof(XmlQualifiedName) ||
type == typeof(TimeSpan) ||
type == typeof(byte[])
type == typeof(Decimal)
);
}
@@ -96,18 +93,17 @@ namespace System.Web.Services.Protocols {
if (val == null) throw new InvalidOperationException ("Missing parameter: " + parameters[n].Name);
try
{
res [n] = Convert.ChangeType (val, parameters[n].ParameterType);
res [n] = StringToObj (parameters[n].ParameterType, val);
}
catch (Exception ex)
{
string error = "Cannot convert " + val + " to " + parameters[n].ParameterType.FullName + "\n";
string error = "Cannot convert '" + val + "' to " + parameters[n].ParameterType.FullName + "\n";
error += "Parameter name: " + parameters[n].Name + " --> " + ex.Message;
throw new InvalidOperationException (error);
}
}
return res;
}
#endregion // Methods
}
}
@@ -31,6 +31,8 @@
using System.IO;
using System.Web;
using System.Xml.Serialization;
using System.Xml;
using System.Text;
namespace System.Web.Services.Protocols {
internal class XmlReturnWriter : MimeReturnWriter {
@@ -77,7 +79,9 @@ namespace System.Web.Services.Protocols {
if (serializer != null)
{
response.ContentType = "text/xml; charset=utf-8";
serializer.Serialize (outputStream, returnValue);
XmlTextWriter xtw = new XmlTextWriter (outputStream, new UTF8Encoding (false));
xtw.Formatting = Formatting.Indented;
serializer.Serialize (xtw, returnValue);
}
outputStream.Close ();
}
+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]>
@@ -42,6 +42,7 @@ namespace System.Web.Caching {
private string custom;
private string key;
private ArrayList item_list;
private bool wildCardParams;
internal CachedVaryBy (HttpCachePolicy policy, string key)
{
@@ -50,6 +51,7 @@ namespace System.Web.Caching {
custom = policy.GetVaryByCustom ();
this.key = key;
item_list = new ArrayList ();
wildCardParams = policy.VaryByParams ["*"];
}
internal ArrayList ItemList {
@@ -82,6 +84,14 @@ namespace System.Web.Caching {
builder.Append (request.Params [prms [i]]);
builder.Append ('\n');
}
} else if (wildCardParams) {
foreach (string p in request.Params) {
builder.Append ("VP:");
builder.Append (p);
builder.Append ('=');
builder.Append (request.Params [p]);
builder.Append ('\n');
}
}
if (headers != null) {
@@ -1,3 +1,8 @@
2005-04-01 Gonzalo Paniagua Javier <[email protected]>
* CachedVaryBy.cs: fixed VaryByParam and wildcard (*). Patch by Ilya
Kharmatsky (Mainsoft).
2004-11-08 Gonzalo Paniagua Javier <[email protected]>
* CacheEntry.cs: convert the external DateTime to GMT, as everything
@@ -257,7 +257,7 @@ namespace System.Web.Compilation
if (stack.Count > 1)
throw new ParseException (stack.Builder.location,
"Expecting </" + stack.Builder.TagName + ">" + stack.Builder);
"Expecting </" + stack.Builder.TagName + "> " + stack.Builder);
BaseCompiler compiler = GetCompilerFromType ();
@@ -558,7 +558,8 @@ namespace System.Web.Compilation
bool CloseControl (string tagid)
{
ControlBuilder current = stack.Builder;
if (String.Compare (tagid, "tbody", true) == 0) {
string btag = current.TagName;
if (String.Compare (btag, "tbody", true) != 0 && String.Compare (tagid, "tbody", true) == 0) {
if (!current.ChildrenAsProperties) {
try {
TextParsed (location, location.PlainText);
@@ -568,7 +569,6 @@ namespace System.Web.Compilation
return true;
}
string btag = current.TagName;
if (0 != String.Compare (tagid, btag, true))
return false;
@@ -1,3 +1,7 @@
2005-02-11 Gonzalo Paniagua Javier <[email protected]>
* AspGenerator.cs: don't fail on <tbody runat=server>. Fixes bug #71856.
2004-10-29 Gonzalo Paniagua Javier <[email protected]>
* AspGenerator.cs: correctly process script tags that self-closing.
@@ -1,3 +1,17 @@
2004-12-15 Gonzalo Paniagua Javier <[email protected]>
* WebConfigurationSettings.cs: correctly detect web.config changes.
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;
@@ -271,10 +271,6 @@ namespace System.Web.Configuration
void SetChanged (object o, FileSystemEventArgs args)
{
lock (data) {
if (watcher.Filter == "*.config" &&
String.Compare (Path.GetFileName (args.FullPath), "web.config", true) != 0)
return;
cacheTable.Clear ();
data.Reset ();
if (args.ChangeType == WatcherChangeTypes.Created)
@@ -535,7 +531,7 @@ namespace System.Web.Configuration
XmlDocument doc = GetDocumentForSection (sectionName);
if (doc == null || doc.DocumentElement == null)
return parentConfig;
return iconf.Create (parentConfig, fileName, doc.DocumentElement);
}
@@ -1,3 +1,20 @@
2005-03-11 Gonzalo Paniagua Javier <[email protected]>
* FormsAuthenticationModule.cs: fix for bug 73545, which caused
authentication not to work when the cookie was not persistent.
Patch by Ilya Kharmatsky (Mainsoft).
2005-02-23 Gonzalo Paniagua Javier <[email protected]>
* FormsAuthentication.cs: make the string to be stored in a config.
file uppercase... See bug #72557.
2005-02-06 Gonzalo Paniagua Javier <[email protected]>
* FormsAuthentication.cs: fixed typo when getting the hash for the
password in SHA1 and MD5. Thanks to Tadas Dailyda.
Lock on a static object instead of typeof(FormsAuthentication).
2004-08-23 Gonzalo Paniagua Javier <[email protected]>
* FormsAuthentication.cs: patch by Jim Pease to fix the date on renewal.
@@ -47,6 +47,7 @@ namespace System.Web.Security
static string cookiePath;
static int timeout;
static FormsProtectionEnum protection;
static object locker = new object ();
#if NET_1_1
static bool requireSSL;
static bool slidingExpiration;
@@ -80,10 +81,10 @@ namespace System.Web.Security
/* Do nothing */
break;
case FormsAuthPasswordFormat.MD5:
stored = HashPasswordForStoringInConfigFile (stored, "MD5");
password = HashPasswordForStoringInConfigFile (password, "MD5");
break;
case FormsAuthPasswordFormat.SHA1:
stored = HashPasswordForStoringInConfigFile (stored, "SHA1");
password = HashPasswordForStoringInConfigFile (password, "SHA1");
break;
}
@@ -221,7 +222,7 @@ namespace System.Web.Security
{
StringBuilder result = new StringBuilder (bytes.Length * 2);
foreach (byte b in bytes)
result.AppendFormat ("{0:x2}", (int) b);
result.AppendFormat ("{0:X2}", (int) b);
return result.ToString ();
}
@@ -251,7 +252,7 @@ namespace System.Web.Security
if (initialized)
return;
lock (typeof (FormsAuthentication)) {
lock (locker) {
if (initialized)
return;
Loaded 100 of 332 files, more files were not shown because too many files have changed in this diff. Show more