mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 01:41:17 -10:00
Compare commits
259
Commits
bug_test_add
...
mono-1-0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1429f06a9e | ||
|
|
5d2ccdb028 | ||
|
|
4fd1ddf2b9 | ||
|
|
20ab2c4674 | ||
|
|
93f290d5a0 | ||
|
|
249179cdce | ||
|
|
e70f174d3c | ||
|
|
d5f96204e1 | ||
|
|
d90252b176 | ||
|
|
096136321d | ||
|
|
6ea3619f41 | ||
|
|
b52b9ca478 | ||
|
|
6a59211c47 | ||
|
|
7946cab2f8 | ||
|
|
7fe238facd | ||
|
|
b307466868 | ||
|
|
bc108ec04a | ||
|
|
72e49e4625 | ||
|
|
3fc4671ceb | ||
|
|
437cd20b37 | ||
|
|
e7e5d0b6b6 | ||
|
|
386ac21e4c | ||
|
|
5c3ba7981e | ||
|
|
727d3d79d7 | ||
|
|
c18c4cf88a | ||
|
|
2039ef93ce | ||
|
|
c9dbf3abd5 | ||
|
|
47dbd8a6f8 | ||
|
|
99ddff7492 | ||
|
|
0ea981862d | ||
|
|
0f789d4884 | ||
|
|
54f32d6ccb | ||
|
|
321aa195bb | ||
|
|
02f74b46a6 | ||
|
|
702b407556 | ||
|
|
5d12cc0c7f | ||
|
|
a9cd17cb6f | ||
|
|
550ef7500a | ||
|
|
ecc0aea9ae | ||
|
|
071575a9ef | ||
|
|
f3567689bc | ||
|
|
111de944a3 | ||
|
|
9832a66418 | ||
|
|
95a9a08b5d | ||
|
|
8cb68ba0cf | ||
|
|
5edaf037fb | ||
|
|
a8b5ec0a92 | ||
|
|
00790cd830 | ||
|
|
6b21676368 | ||
|
|
fa84087720 | ||
|
|
041f3217c6 | ||
|
|
b8ccbf21b7 | ||
|
|
b35faa74ef | ||
|
|
ddc5a7b388 | ||
|
|
3a2e93ef0d | ||
|
|
82a06303f2 | ||
|
|
fd3326b3b7 | ||
|
|
4cffed6891 | ||
|
|
5ec4e9b3b6 | ||
|
|
9935f5d5df | ||
|
|
a1ed913095 | ||
|
|
8b212efc30 | ||
|
|
13a43e7792 | ||
|
|
45bd71b7d8 | ||
|
|
31be035834 | ||
|
|
a9e37c8b3d | ||
|
|
3a73944449 | ||
|
|
97b4ea90ac | ||
|
|
045f16ce59 | ||
|
|
a0761c74c2 | ||
|
|
b0460e112b | ||
|
|
7cebb19054 | ||
|
|
0dbc3e0206 | ||
|
|
37c3a6ad08 | ||
|
|
24fafcee76 | ||
|
|
5f6ef46188 | ||
|
|
1c49304140 | ||
|
|
5a14404a49 | ||
|
|
02e3e3006c | ||
|
|
79fd08d5de | ||
|
|
2ef37435a6 | ||
|
|
2a7333427b | ||
|
|
0a7b322811 | ||
|
|
85957609af | ||
|
|
6c7c77a687 | ||
|
|
91d8288423 | ||
|
|
296b986374 | ||
|
|
287b6672f1 | ||
|
|
df49fe942b | ||
|
|
679c4b8044 | ||
|
|
e1eb581e8a | ||
|
|
fd0db3b590 | ||
|
|
5ae7f99470 | ||
|
|
287faa9e56 | ||
|
|
292676010f | ||
|
|
fef2b6723e | ||
|
|
a28363adf9 | ||
|
|
9c7cea69f6 | ||
|
|
c46b58028a | ||
|
|
edaaf203c5 | ||
|
|
b3649da6d8 | ||
|
|
706593bbd2 | ||
|
|
4878c6a2fc | ||
|
|
ff3d755b8b | ||
|
|
96057a1306 | ||
|
|
240f80d6c1 | ||
|
|
bf4c5178a3 | ||
|
|
d430dcb109 | ||
|
|
de3d462b56 | ||
|
|
4b4d4e3294 | ||
|
|
d4f579ab0b | ||
|
|
389b183bc7 | ||
|
|
531e7cd91f | ||
|
|
d3b0c4bd31 | ||
|
|
0998ee74e2 | ||
|
|
8c41b83d93 | ||
|
|
57a42d6d0d | ||
|
|
514ac424f5 | ||
|
|
4f0ea07f3d | ||
|
|
631bb74c09 | ||
|
|
2c20e28f89 | ||
|
|
974b4b8959 | ||
|
|
76f82a15ca | ||
|
|
09e00de01e | ||
|
|
b363a4da0f | ||
|
|
70191fac33 | ||
|
|
331fb64c5a | ||
|
|
8494cbf446 | ||
|
|
e6f5c6fafa | ||
|
|
b7ffe85112 | ||
|
|
5073c9eac4 | ||
|
|
8149ddc0dc | ||
|
|
bef9afa7e0 | ||
|
|
501bff4b28 | ||
|
|
9441155d29 | ||
|
|
388ab08ce7 | ||
|
|
ffdb6bc1b3 | ||
|
|
b9a06db813 | ||
|
|
97007fdaab | ||
|
|
2df4f9497c | ||
|
|
9886f44127 | ||
|
|
6a0c7b72ae | ||
|
|
fa037f5592 | ||
|
|
c632c4a99e | ||
|
|
a17df477d7 | ||
|
|
4e997ec5a9 | ||
|
|
b483058ea3 | ||
|
|
c96297b587 | ||
|
|
d9b6dc6151 | ||
|
|
3f95f8a3ba | ||
|
|
1cede3cba3 | ||
|
|
32a701dc4c | ||
|
|
57b3fe75e0 | ||
|
|
d6400d10a7 | ||
|
|
1a741c2b80 | ||
|
|
15b02a6f60 | ||
|
|
3461853696 | ||
|
|
ef6b6383f2 | ||
|
|
2c8cddad17 | ||
|
|
a4ff149320 | ||
|
|
9a2632e1ef | ||
|
|
b491f84400 | ||
|
|
84b9050333 | ||
|
|
e982daf3c5 | ||
|
|
e1645332ae | ||
|
|
7c30a22d95 | ||
|
|
fdd5c8f1ef | ||
|
|
914a6c7591 | ||
|
|
58ec72cc8e | ||
|
|
16c85760eb | ||
|
|
3257e26217 | ||
|
|
b0d5e6580b | ||
|
|
d1518010c1 | ||
|
|
ecd4a4a91b | ||
|
|
9af5b74c89 | ||
|
|
eb6c6eeb2c | ||
|
|
ebdbaa1a6b | ||
|
|
b80fb16653 | ||
|
|
f11407839d | ||
|
|
fbe08afa0a | ||
|
|
f4741866e0 | ||
|
|
90fb34509f | ||
|
|
3944dabece | ||
|
|
0252a4b423 | ||
|
|
caf2a1cdab | ||
|
|
f8aca10bb8 | ||
|
|
41b5ad6a5e | ||
|
|
6ccf1cf6f7 | ||
|
|
1e4a215c2d | ||
|
|
9d08ee3eb4 | ||
|
|
a0698673af | ||
|
|
a1af0eb692 | ||
|
|
3f13a7d7fa | ||
|
|
9515522172 | ||
|
|
110fdf3ba2 | ||
|
|
e259703198 | ||
|
|
226ae644f9 | ||
|
|
4bc298c411 | ||
|
|
575598549b | ||
|
|
8f2b0ac63e | ||
|
|
fc43c289a7 | ||
|
|
917cfd14e8 | ||
|
|
3f313cb9ec | ||
|
|
8848992453 | ||
|
|
039469b073 | ||
|
|
f5f0faa021 | ||
|
|
b8a27ac9db | ||
|
|
ebbae7a275 | ||
|
|
e614a203bf | ||
|
|
46575c2cbd | ||
|
|
28af3a955e | ||
|
|
f3447d3f0b | ||
|
|
3ce5fb0901 | ||
|
|
59d0d973b7 | ||
|
|
67986dc51c | ||
|
|
fde8977cf8 | ||
|
|
f5f748e56d | ||
|
|
28509a9519 | ||
|
|
93602830a2 | ||
|
|
33f67ca6a1 | ||
|
|
50640010d6 | ||
|
|
60939e21e9 | ||
|
|
7a891c80d7 | ||
|
|
2c3f55598b | ||
|
|
cef8cc61f1 | ||
|
|
61c7c6b281 | ||
|
|
4021c4970d | ||
|
|
cbb2e9d974 | ||
|
|
6917176796 | ||
|
|
72ffc50a2e | ||
|
|
318d4accb4 | ||
|
|
6c44824926 | ||
|
|
1d3031d872 | ||
|
|
eeb4b2e824 | ||
|
|
241d79e8a6 | ||
|
|
a0b22bb06c | ||
|
|
ffbda13a58 | ||
|
|
87305aaf57 | ||
|
|
e83ddf7ab6 | ||
|
|
4e82fecb76 | ||
|
|
6fba96d33d | ||
|
|
306c82c3c5 | ||
|
|
5e884040ce | ||
|
|
4cf437e20d | ||
|
|
34ad30d1f8 | ||
|
|
80c6aad05d | ||
|
|
67f7345766 | ||
|
|
3769fa3bf6 | ||
|
|
57cb4f1a11 | ||
|
|
5b2cd03616 | ||
|
|
a27026dfbc | ||
|
|
e93e7cbf52 | ||
|
|
dccf891071 | ||
|
|
6578727d5c | ||
|
|
32f56b9dc1 | ||
|
|
ffe2445a8e | ||
|
|
f6b9f3f2b6 | ||
|
|
e897489500 | ||
|
|
caf867582f |
No files matched your search
@@ -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
@@ -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
|
||||
|
||||
@@ -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"> <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%>">
|
||||
<input type="hidden" name="page" value="<%=CurrentPage%>">
|
||||
<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>
|
||||
|
||||
</form>
|
||||
<br>
|
||||
<span class="label"><%#CurrentProxytName%></span>
|
||||
<a href="<%#PageName + "?code=" + CurrentLanguage%>">Download</a>
|
||||
<span class="label"><%=CurrentProxytName%></span>
|
||||
<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>
|
||||
<span class="label"><%=CurrentDocumentName%></span>
|
||||
<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
File diff suppressed because it is too large.
Load diff
+7
-7
@@ -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
|
||||
|
||||
@@ -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'.
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
.makefrag
|
||||
.response
|
||||
library-deps.stamp
|
||||
Executable
+37
@@ -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")]
|
||||
|
||||
Executable
+10
@@ -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
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
AssemblyInfo.cs
|
||||
DataTools.cs
|
||||
Provider.cs
|
||||
ProviderCollection.cs
|
||||
ProviderFactory.cs
|
||||
ProviderSectionHandler.cs
|
||||
@@ -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.
@@ -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>
|
||||
@@ -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.
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
+6
-2
@@ -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]);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
+13
-11
@@ -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.
|
||||
|
||||
+14
-16
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+9
-51
@@ -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()
|
||||
|
||||
+7
-26
@@ -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)
|
||||
|
||||
+2
-8
@@ -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.
|
||||
|
||||
+17
-8
@@ -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;
|
||||
}
|
||||
|
||||
+2
@@ -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);
|
||||
|
||||
+1
-1
@@ -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];
|
||||
}
|
||||
|
||||
+48
-44
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+7
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
+10
@@ -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.
|
||||
|
||||
+2
-3
@@ -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;
|
||||
|
||||
+11
-2
@@ -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(':','[',',',']');
|
||||
|
||||
+4
-1
@@ -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)
|
||||
|
||||
+7
@@ -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
|
||||
}
|
||||
}
|
||||
+11
-4
@@ -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)
|
||||
|
||||
+7
-4
@@ -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)
|
||||
{
|
||||
|
||||
+2
-2
@@ -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)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+3
-7
@@ -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 ();
|
||||
}
|
||||
|
||||
@@ -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
Reference in new issue
Block a user