mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 11:21:08 -10:00
Compare commits
364
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32bcd6c6a9 | ||
|
|
794f7a7612 | ||
|
|
fe516ba0bd | ||
|
|
b2acee0ade | ||
|
|
8af44d2b16 | ||
|
|
f4cf17d61d | ||
|
|
8f3ddb716e | ||
|
|
a4cd00b333 | ||
|
|
cb6a2fc7ff | ||
|
|
c81fe5e84d | ||
|
|
1cf175e95c | ||
|
|
01d1582fb7 | ||
|
|
f177485aaf | ||
|
|
1d4fc17faa | ||
|
|
dc29ba37a6 | ||
|
|
8bcbd3cc89 | ||
|
|
24901ef720 | ||
|
|
b263d37e15 | ||
|
|
56267e8476 | ||
|
|
1afb931de6 | ||
|
|
63b57ba7a1 | ||
|
|
cbeae56621 | ||
|
|
f527b26e19 | ||
|
|
ebee14deca | ||
|
|
929575bb0e | ||
|
|
4fe608c216 | ||
|
|
6b8abfeb7c | ||
|
|
000682fe19 | ||
|
|
282e0fb6d3 | ||
|
|
4cadbfc272 | ||
|
|
2071615b87 | ||
|
|
cbc738c44d | ||
|
|
7f9739d414 | ||
|
|
4432d94f47 | ||
|
|
84a67e67e0 | ||
|
|
3d2159b391 | ||
|
|
2cc5ff0ef3 | ||
|
|
ab5dc2d67e | ||
|
|
b339b6677c | ||
|
|
a6db6112ca | ||
|
|
fd2303ecb6 | ||
|
|
490cc373e4 | ||
|
|
b65d1a9ffc | ||
|
|
8531639386 | ||
|
|
25ef6061fd | ||
|
|
066fde97d3 | ||
|
|
28a417c2c0 | ||
|
|
c97a3fcfd2 | ||
|
|
3acee7af00 | ||
|
|
b6cd01f017 | ||
|
|
67a2f14e73 | ||
|
|
8043db4c77 | ||
|
|
252415606d | ||
|
|
50f2938561 | ||
|
|
6425f06ff6 | ||
|
|
485d5205f9 | ||
|
|
582c5d77f0 | ||
|
|
bda280c5e8 | ||
|
|
287f4303f3 | ||
|
|
48d6bff3ae | ||
|
|
ad6ef5f4bc | ||
|
|
dd46212fc2 | ||
|
|
41ecc70a69 | ||
|
|
e9d3a69282 | ||
|
|
e7ce1807d7 | ||
|
|
eb7e8d4af8 | ||
|
|
94651df9ed | ||
|
|
d320c3a40a | ||
|
|
97d59f280a | ||
|
|
7f68119da8 | ||
|
|
9b3d1a60fc | ||
|
|
75aeec5fb9 | ||
|
|
a625b98e26 | ||
|
|
07ef3c251b | ||
|
|
fd85ac4fd1 | ||
|
|
667dcaa655 | ||
|
|
d6ba1ed4fc | ||
|
|
5b035af74a | ||
|
|
b69e232073 | ||
|
|
edd2d56a32 | ||
|
|
d4d81a3e02 | ||
|
|
1d1ec7d504 | ||
|
|
5fc8e28ffa | ||
|
|
de60f3b49e | ||
|
|
7f560b39c8 | ||
|
|
73c2e4322e | ||
|
|
13166f48a8 | ||
|
|
e5b06307ca | ||
|
|
be1b671b09 | ||
|
|
817a7e7bf7 | ||
|
|
6279df6d70 | ||
|
|
cbc419bb3e | ||
|
|
39a8a8f8c0 | ||
|
|
3c9a821c7e | ||
|
|
bb900edab1 | ||
|
|
36e3d93a52 | ||
|
|
4b49283a9c | ||
|
|
00ef078380 | ||
|
|
0a3ea22257 | ||
|
|
04419ee95b | ||
|
|
fc339c2777 | ||
|
|
35b2b68bdf | ||
|
|
009d1279a2 | ||
|
|
d8eb6c91a2 | ||
|
|
d451def6a5 | ||
|
|
f95909190c | ||
|
|
fc65bbe329 | ||
|
|
eb6386af15 | ||
|
|
8236cbe950 | ||
|
|
3505d310df | ||
|
|
c0c8d0bec4 | ||
|
|
3872a400b2 | ||
|
|
a6612b4c64 | ||
|
|
4db9028cb9 | ||
|
|
b6e231d521 | ||
|
|
1ec5966c89 | ||
|
|
9280bb5e19 | ||
|
|
d470d1abbf | ||
|
|
0e4d13f5b7 | ||
|
|
933ceae45c | ||
|
|
2f1b9e8aac | ||
|
|
f03dbfcae2 | ||
|
|
d9211fcb50 | ||
|
|
153467c0c6 | ||
|
|
a1cac02732 | ||
|
|
7be144c0b7 | ||
|
|
71936252fe | ||
|
|
ab0791102f | ||
|
|
be24ada60a | ||
|
|
9c991786ac | ||
|
|
019a83f88f | ||
|
|
33697c0568 | ||
|
|
fbb82d3923 | ||
|
|
733b51587e | ||
|
|
f66e71e01b | ||
|
|
262128c941 | ||
|
|
eeb68ca307 | ||
|
|
6471bbd6ef | ||
|
|
96a2b36e82 | ||
|
|
7a704f61c9 | ||
|
|
39150458f0 | ||
|
|
0b522087c2 | ||
|
|
911cc1d438 | ||
|
|
e4b08aa7c9 | ||
|
|
2db07ca754 | ||
|
|
0d8219ea4a | ||
|
|
a38a8e4ad4 | ||
|
|
d0b9d91817 | ||
|
|
fd6d8198f7 | ||
|
|
54260048cc | ||
|
|
34ba13146f | ||
|
|
00ea5f1e17 | ||
|
|
e75b24b807 | ||
|
|
ecf65f0093 | ||
|
|
35cb8bac8a | ||
|
|
33074493a0 | ||
|
|
c5d7419186 | ||
|
|
ccf4d32e12 | ||
|
|
89014568b7 | ||
|
|
9161e4e5a9 | ||
|
|
6ac4a68c46 | ||
|
|
1b5e0f7331 | ||
|
|
c8863e1d31 | ||
|
|
dd951e909a | ||
|
|
3c21a0f3dd | ||
|
|
f031c8fba3 | ||
|
|
442d000b6c | ||
|
|
2cdb7e8648 | ||
|
|
e72203782b | ||
|
|
00e3c897d5 | ||
|
|
52a5acbd88 | ||
|
|
778e04f2d9 | ||
|
|
93ecaeb2c6 | ||
|
|
49df11fd5f | ||
|
|
c8c8b16bfd | ||
|
|
6f83951d1c | ||
|
|
f2ae4658f9 | ||
|
|
faf4fe66af | ||
|
|
998759345f | ||
|
|
c88d2cce1f | ||
|
|
3e589e2c39 | ||
|
|
4c944bc86e | ||
|
|
d3e6c9d17f | ||
|
|
7379ac1bfb | ||
|
|
2a029615aa | ||
|
|
9c345b1b02 | ||
|
|
074a1228cf | ||
|
|
e3596928d8 | ||
|
|
ac71acfd52 | ||
|
|
8909c17d9c | ||
|
|
e5d16f01fd | ||
|
|
9874928b85 | ||
|
|
9e99e20001 | ||
|
|
b3e79ebc05 | ||
|
|
d30c17f44e | ||
|
|
2ca4575eeb | ||
|
|
51b93b6c23 | ||
|
|
ed9fb93c62 | ||
|
|
7d1644d234 | ||
|
|
010fce60af | ||
|
|
c3667fa861 | ||
|
|
cfdbdfc9eb | ||
|
|
077582d3f9 | ||
|
|
db51810499 | ||
|
|
5e23a773b4 | ||
|
|
1ca679877e | ||
|
|
9cb34c2a76 | ||
|
|
03c7f4f63b | ||
|
|
869a2b0121 | ||
|
|
0e409c5558 | ||
|
|
010fcfb9ec | ||
|
|
045232ef52 | ||
|
|
a560146b7c | ||
|
|
02db562b69 | ||
|
|
1b35e551d5 | ||
|
|
65b5d9b115 | ||
|
|
76f0a58429 | ||
|
|
572e868f97 | ||
|
|
313d06b169 | ||
|
|
74524d8b92 | ||
|
|
5b88ecbe0b | ||
|
|
a17afc056b | ||
|
|
d5eb1e5aed | ||
|
|
74c86ff4cc | ||
|
|
4ad2d48197 | ||
|
|
cbf2e5be18 | ||
|
|
135e4ddf27 | ||
|
|
6d298d47f9 | ||
|
|
a75c5db541 | ||
|
|
34a4ffcc45 | ||
|
|
798a08c1f1 | ||
|
|
cbd180afe6 | ||
|
|
c4aa50d2e1 | ||
|
|
84fe1a5774 | ||
|
|
819026f391 | ||
|
|
45e66c5362 | ||
|
|
cef99c3837 | ||
|
|
f7e0f70b7d | ||
|
|
feb90c6d43 | ||
|
|
b1b5ab0524 | ||
|
|
fd201644a0 | ||
|
|
97e9bbae7e | ||
|
|
d466cb5fa5 | ||
|
|
828d2adff9 | ||
|
|
37fe83f6ea | ||
|
|
e06781fb7a | ||
|
|
1782b291f8 | ||
|
|
7b51e84dc5 | ||
|
|
0f00eb3e59 | ||
|
|
2769d84822 | ||
|
|
966d8f2a57 | ||
|
|
b3901be2f6 | ||
|
|
ee90fc601e | ||
|
|
621faafcaf | ||
|
|
4e72eaacaa | ||
|
|
3a0d3e1169 | ||
|
|
da76a7b803 | ||
|
|
a7c31c9805 | ||
|
|
73f3ee63cc | ||
|
|
5c7f10154f | ||
|
|
992525a6df | ||
|
|
76e2c3227f | ||
|
|
5b4ccf033f | ||
|
|
071c3f5697 | ||
|
|
9a08e45324 | ||
|
|
574f482506 | ||
|
|
500eec69c7 | ||
|
|
5d50b36c5f | ||
|
|
89ceb247c4 | ||
|
|
2d57bab36b | ||
|
|
ed0b9b227b | ||
|
|
0cac21043d | ||
|
|
44b7efbee0 | ||
|
|
0a0da6cbe1 | ||
|
|
310b69ce3d | ||
|
|
0a3a12b9aa | ||
|
|
30f9a22f08 | ||
|
|
84bac28050 | ||
|
|
93e74ce434 | ||
|
|
f48e4357c9 | ||
|
|
a377fa737c | ||
|
|
aa7df40d0c | ||
|
|
5467391bbc | ||
|
|
94db1a63f0 | ||
|
|
414e98156a | ||
|
|
565d626c05 | ||
|
|
31ec985a6f | ||
|
|
4f1514cc22 | ||
|
|
a661eb8c9d | ||
|
|
b9b72e5947 | ||
|
|
b4b33c06e6 | ||
|
|
49a83d0b72 | ||
|
|
c271644e20 | ||
|
|
c96819eb25 | ||
|
|
3b9f8e8d77 | ||
|
|
ef239e765e | ||
|
|
2d403b3a44 | ||
|
|
3b3017dbe4 | ||
|
|
2dabc3e221 | ||
|
|
940944dcde | ||
|
|
182f7c33c1 | ||
|
|
e3ede19ce7 | ||
|
|
e6fc657342 | ||
|
|
a957ab18a3 | ||
|
|
bde8ce85e0 | ||
|
|
76849c1cfb | ||
|
|
1d115c6cd1 | ||
|
|
d1add5e846 | ||
|
|
b11e90f2f7 | ||
|
|
fe1c006f59 | ||
|
|
64cb61349f | ||
|
|
091181ba1d | ||
|
|
19631350a2 | ||
|
|
c2a7bb4598 | ||
|
|
d62228e521 | ||
|
|
7075c21582 | ||
|
|
581e33fcb6 | ||
|
|
f787cfb2ba | ||
|
|
0ec79ec49e | ||
|
|
52acc12919 | ||
|
|
631d4e0052 | ||
|
|
e1354fd956 | ||
|
|
2d7ce926aa | ||
|
|
8b9eaf7a72 | ||
|
|
a61c283115 | ||
|
|
4a78d5cb13 | ||
|
|
beb36c6a31 | ||
|
|
a0fc3f4dcf | ||
|
|
872976e6c6 | ||
|
|
f285740333 | ||
|
|
3b2da24533 | ||
|
|
ab98a01bac | ||
|
|
1516837c58 | ||
|
|
99c93cbe85 | ||
|
|
29741a40cb | ||
|
|
a796ce400d | ||
|
|
506e60cf63 | ||
|
|
3f527c012d | ||
|
|
027da05f20 | ||
|
|
eb18b8c0de | ||
|
|
88a90e5c20 | ||
|
|
48d1ebf570 | ||
|
|
d0b38e1871 | ||
|
|
836194d63b | ||
|
|
ea0f582d72 | ||
|
|
aaf9fd3dbd | ||
|
|
ab514a67ee | ||
|
|
323fcec547 | ||
|
|
3877878670 | ||
|
|
afffab3b5c | ||
|
|
5e5e381907 | ||
|
|
11917e41a8 | ||
|
|
b79a891772 | ||
|
|
8884492839 | ||
|
|
eec0a66009 | ||
|
|
e05343ddf5 | ||
|
|
45f1fb7d50 | ||
|
|
414b5fc644 | ||
|
|
0fd8ecd055 | ||
|
|
28a16d28a0 | ||
|
|
32eb3111ee | ||
|
|
d99cf6b096 | ||
|
|
7283aded35 | ||
|
|
c51f5516ce |
No files matched your search
@@ -26,9 +26,6 @@
|
||||
[submodule "external/nuget-buildtasks"]
|
||||
path = external/nuget-buildtasks
|
||||
url = git://github.com/mono/NuGet.BuildTasks
|
||||
[submodule "external/buildtools"]
|
||||
path = external/buildtools
|
||||
url = git://github.com/mono/buildtools.git
|
||||
[submodule "external/cecil-legacy"]
|
||||
path = external/cecil-legacy
|
||||
url = git://github.com/mono/cecil.git
|
||||
|
||||
+1
-6
@@ -50,14 +50,9 @@ noinst_DATA = mono-uninstalled.pc
|
||||
DISTCLEANFILES= mono-uninstalled.pc
|
||||
|
||||
# building with monolite
|
||||
mcslib = $(mcs_topdir)/class/lib
|
||||
monolite_url = https://download.mono-project.com/monolite/monolite-$(MONO_CORLIB_VERSION)-latest.tar.gz
|
||||
.PHONY: get-monolite-latest
|
||||
get-monolite-latest:
|
||||
-rm -fr $(mcslib)/monolite/$(MONO_CORLIB_VERSION)
|
||||
-mkdir -p $(mcslib)/monolite
|
||||
cd $(mcslib) && { (wget -O- $(monolite_url) || curl -L $(monolite_url)) | gzip -d | tar xf - ; }
|
||||
cd $(mcslib) && mv -f monolite-* monolite/$(MONO_CORLIB_VERSION)
|
||||
$(MAKE) -C $(mcs_topdir)/class get-monolite-latest
|
||||
|
||||
if BITCODE
|
||||
BITCODE_CHECK=yes
|
||||
|
||||
+16
-107
@@ -1,7 +1,7 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
#AC_PREREQ([2.62])
|
||||
|
||||
AC_INIT(mono, [5.3.0],
|
||||
AC_INIT(mono, [5.4.0],
|
||||
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
|
||||
|
||||
AC_CONFIG_SRCDIR([README.md])
|
||||
@@ -40,8 +40,8 @@ MONO_VERSION_BUILD=`echo $VERSION | cut -d . -f 3`
|
||||
# This can be reset to 0 when Mono's version number is bumped
|
||||
# since it's part of the corlib version (the prefix '1' in the full
|
||||
# version number is to ensure the number isn't treated as octal in C)
|
||||
MONO_CORLIB_COUNTER=1
|
||||
MONO_CORLIB_VERSION=`printf "1%02d%02d%02d%03d" $MONO_VERSION_MAJOR $MONO_VERSION_MINOR $MONO_VERSION_BUILD $MONO_CORLIB_COUNTER`
|
||||
MONO_CORLIB_COUNTER=3
|
||||
MONO_CORLIB_VERSION=`printf "1%02d%02d%02d%03d" $MONO_VERSION_MAJOR $MONO_VERSION_MINOR 0 $MONO_CORLIB_COUNTER`
|
||||
|
||||
AC_DEFINE_UNQUOTED(MONO_CORLIB_VERSION,$MONO_CORLIB_VERSION,[Version of the corlib-runtime interface])
|
||||
AC_SUBST(MONO_CORLIB_VERSION)
|
||||
@@ -264,17 +264,8 @@ case "$host" in
|
||||
with_sgen_default_concurrent=yes
|
||||
;;
|
||||
*-*-nacl*)
|
||||
CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
|
||||
if test "x$disable_munmap" != "xyes"; then
|
||||
CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
|
||||
fi
|
||||
libmono_cflags="-D_REENTRANT"
|
||||
libdl=
|
||||
libgc_threads=pthreads
|
||||
use_sigposix=yes
|
||||
ikvm_native=no
|
||||
AC_DEFINE(DISABLE_SOCKETS,1,[Disable sockets support])
|
||||
AC_DEFINE(DISABLE_ATTACH, 1, [Disable agent attach support])
|
||||
echo "nacl no longer supported."
|
||||
exit 1
|
||||
;;
|
||||
*-*-hpux*)
|
||||
CPPFLAGS="$CPPFLAGS -DGC_HPUX_THREADS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_REENTRANT"
|
||||
@@ -743,10 +734,6 @@ fi
|
||||
|
||||
AM_CONDITIONAL(DISABLE_LIBRARIES, test x$enable_libraries = xno)
|
||||
|
||||
case $host in
|
||||
*nacl* ) with_shared_mono=yes;;
|
||||
esac
|
||||
|
||||
if test "x$host_win32" = "xyes"; then
|
||||
# Boehm GC requires the runtime to be in its own dll
|
||||
with_static_mono=no
|
||||
@@ -1371,8 +1358,6 @@ AC_TRY_COMPILE([
|
||||
AC_DEFINE_UNQUOTED(MONO_ZERO_LEN_ARRAY, 1, [Length of zero length arrays])
|
||||
])
|
||||
|
||||
AC_CHECK_HEADERS(nacl/nacl_dyncode.h)
|
||||
|
||||
dnl ***********************************
|
||||
dnl *** Checks for signals
|
||||
dnl ***********************************
|
||||
@@ -2220,13 +2205,11 @@ if test x$host_win32 = xno; then
|
||||
dnl **********************************
|
||||
dnl *** epoll ***
|
||||
dnl **********************************
|
||||
if test "x$ac_cv_header_nacl_nacl_dyncode_h" = "xno"; then
|
||||
AC_CHECK_HEADERS(sys/epoll.h)
|
||||
haveepoll=no
|
||||
AC_CHECK_FUNCS(epoll_ctl, [haveepoll=yes], )
|
||||
if test "x$haveepoll" = "xyes" -a "x$ac_cv_header_sys_epoll_h" = "xyes"; then
|
||||
AC_DEFINE(HAVE_EPOLL, 1, [epoll supported])
|
||||
fi
|
||||
AC_CHECK_HEADERS(sys/epoll.h)
|
||||
haveepoll=no
|
||||
AC_CHECK_FUNCS(epoll_ctl, [haveepoll=yes], )
|
||||
if test "x$haveepoll" = "xyes" -a "x$ac_cv_header_sys_epoll_h" = "xyes"; then
|
||||
AC_DEFINE(HAVE_EPOLL, 1, [epoll supported])
|
||||
fi
|
||||
|
||||
havekqueue=no
|
||||
@@ -2859,40 +2842,6 @@ fi
|
||||
AM_CONDITIONAL(ENABLE_DTRACE, [test x$enable_dtrace = xyes])
|
||||
AM_CONDITIONAL(DTRACE_G_REQUIRED, [test x$dtrace_g = xyes])
|
||||
|
||||
dnl **************
|
||||
dnl *** NaCl ***
|
||||
dnl **************
|
||||
|
||||
AC_ARG_ENABLE(nacl_codegen, [ --enable-nacl-codegen Enable Native Client code generation], enable_nacl_codegen=$enableval, enable_nacl_codegen=no)
|
||||
AC_ARG_ENABLE(nacl_gc, [ --enable-nacl-gc Enable Native Client garbage collection], enable_nacl_gc=$enableval, enable_nacl_gc=no)
|
||||
|
||||
AM_CONDITIONAL(NACL_CODEGEN, test x$enable_nacl_codegen != xno)
|
||||
|
||||
dnl
|
||||
dnl Hack to use system mono for operations in build/install not allowed in NaCl.
|
||||
dnl
|
||||
nacl_self_host=""
|
||||
if test "x$ac_cv_header_nacl_nacl_dyncode_h" = "xyes"; then
|
||||
nacl_self_host="nacl_self_host"
|
||||
fi
|
||||
AC_SUBST(nacl_self_host)
|
||||
|
||||
if test "x$enable_nacl_codegen" = "xyes"; then
|
||||
MONO_NACL_ALIGN_MASK_OFF=1
|
||||
AC_DEFINE(TARGET_NACL, 1, [...])
|
||||
AC_DEFINE(__native_client_codegen__, 1, [...])
|
||||
fi
|
||||
if test "x$enable_nacl_gc" = "xyes"; then
|
||||
if test "x$TARGET" = "xAMD64" -o "x$TARGET" = "xX86"; then
|
||||
INSTRUMENT_CFLAG="-finstrument-for-thread-suspension"
|
||||
else
|
||||
# Not yet implemented
|
||||
INSTRUMENT_CFLAG=""
|
||||
fi
|
||||
CPPFLAGS="$CPPFLAGS $INSTRUMENT_CFLAG -D__native_client_gc__"
|
||||
fi
|
||||
AC_SUBST(MONO_NACL_ALIGN_MASK_OFF)
|
||||
|
||||
dnl **************************
|
||||
dnl *** AOT cross offsets ***
|
||||
dnl **************************
|
||||
@@ -3155,12 +3104,6 @@ case "$host" in
|
||||
mingw*)
|
||||
;;
|
||||
esac
|
||||
case "$host" in
|
||||
x86_64-*-nacl*)
|
||||
AC_DEFINE(__mono_ilp32__, 1, [64 bit mode with 4 byte longs and pointers])
|
||||
sizeof_register=8
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
sparc*-*-*)
|
||||
if test "x$ac_cv_sizeof_void_p" = "x8"; then
|
||||
@@ -3241,13 +3184,6 @@ case "$host" in
|
||||
ACCESS_UNALIGNED="no"
|
||||
CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
|
||||
;;
|
||||
# TODO: make proper support for NaCl host.
|
||||
# arm*-*nacl)
|
||||
# TARGET=ARM;
|
||||
# arch_target=arm;
|
||||
# ACCESS_UNALIGNED="no"
|
||||
# AOT_SUPPORTED="no"
|
||||
# ;;
|
||||
aarch64-*)
|
||||
# https://lkml.org/lkml/2012/7/15/133
|
||||
TARGET=ARM64
|
||||
@@ -3308,38 +3244,6 @@ if test "x$host" != "x$target"; then
|
||||
sizeof_register=8
|
||||
target_byte_order=G_BIG_ENDIAN
|
||||
;;
|
||||
x86_64-*-nacl)
|
||||
TARGET=AMD64
|
||||
arch_target=amd64
|
||||
AC_DEFINE(TARGET_AMD64, 1, [...])
|
||||
AC_DEFINE(__mono_ilp32__, 1, [64 bit mode with 4 byte longs and pointers])
|
||||
sizeof_register=8
|
||||
;;
|
||||
# TODO: make proper support for NaCl target.
|
||||
# arm*-*nacl)
|
||||
# TARGET=ARM
|
||||
# arch_target=arm
|
||||
# AC_DEFINE(TARGET_ARM, 1, [...])
|
||||
# ACCESS_UNALIGNED="no"
|
||||
# sizeof_register=4
|
||||
# CPPFLAGS="$CPPFLAGS \
|
||||
# -D__ARM_EABI__ \
|
||||
# -D__arm__ \
|
||||
# -D__portable_native_client__ \
|
||||
# -Dtimezone=_timezone \
|
||||
# -DDISABLE_SOCKETS \
|
||||
# -DDISABLE_ATTACH \
|
||||
# -DUSE_NEWLIB"
|
||||
# Can't use tls, since it depends on the runtime detection of tls offsets
|
||||
# in mono-compiler.h
|
||||
# with_tls=pthread
|
||||
# ;;
|
||||
i686-*-nacl)
|
||||
TARGET=X86
|
||||
arch_target=x86
|
||||
AC_DEFINE(TARGET_X86, 1, [...])
|
||||
sizeof_register=4
|
||||
;;
|
||||
arm*-linux-*)
|
||||
TARGET=ARM;
|
||||
arch_target=arm;
|
||||
@@ -3630,6 +3534,11 @@ fi
|
||||
|
||||
AM_CONDITIONAL(ENABLE_INTERPRETER, [test x$enable_interpreter = xyes])
|
||||
|
||||
if test "x$enable_interpreter" = "xyes" || test "x$mono_feature_disable_jit" != "xyes"; then
|
||||
AC_DEFINE(HAVE_ONLINE_VES, 1, [Some VES is available at runtime])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(HAVE_ONLINE_VES, [test x$enable_interpreter = xyes] || [test x$mono_feature_disable_jit != xyes])
|
||||
|
||||
dnl
|
||||
dnl Simple Generational checks (sgen)
|
||||
@@ -4231,7 +4140,7 @@ AC_SUBST(mono_build_root)
|
||||
mono_runtime=mono/mini/mono
|
||||
AC_SUBST(mono_runtime)
|
||||
|
||||
CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.2.1.0/tools/csc.exe
|
||||
CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.2.3.1/tools/csc.exe
|
||||
|
||||
if test $csc_compiler = mcs; then
|
||||
CSC=$mcs_topdir/class/lib/build/mcs.exe
|
||||
|
||||
@@ -32,7 +32,7 @@ typedef signed @GSIZE@ gssize;
|
||||
#define G_HAVE_ISO_VARARGS
|
||||
#endif
|
||||
|
||||
#if defined (__native_client__) || defined (HOST_WATCHOS)
|
||||
#if defined (HOST_WATCHOS)
|
||||
#undef G_BREAKPOINT
|
||||
#define G_BREAKPOINT()
|
||||
#endif
|
||||
|
||||
@@ -154,15 +154,6 @@ g_file_open_tmp (const gchar *tmpl, gchar **name_used, GError **error)
|
||||
gchar *
|
||||
g_get_current_dir (void)
|
||||
{
|
||||
#ifdef __native_client__
|
||||
char *buffer;
|
||||
if ((buffer = g_getenv("NACL_PWD"))) {
|
||||
buffer = g_strdup(buffer);
|
||||
} else {
|
||||
buffer = g_strdup(".");
|
||||
}
|
||||
return buffer;
|
||||
#else
|
||||
int s = 32;
|
||||
char *buffer = NULL, *r;
|
||||
gboolean fail;
|
||||
@@ -181,5 +172,4 @@ g_get_current_dir (void)
|
||||
* so we return the buffer here since it has a pointer to the valid string
|
||||
*/
|
||||
return buffer;
|
||||
#endif
|
||||
}
|
||||
Vendored
+1
-1
Submodule external/api-snapshot updated: ba90b3440d...b09033be33.
Vendored
+1
-1
Submodule external/bockbuild updated: 31c98f3cab...a7fadd170e.
Vendored
+1
-1
Submodule external/boringssl updated: c06ac6b33d...3e0770e188.
Vendored
-1
Submodule external/buildtools deleted from b5cc6e6ab5.
Vendored
+1
-1
Submodule external/cecil updated: 0b523fa7e0...c0eb983dac.
Vendored
+1
-1
Submodule external/corefx updated: 5b7e0d739f...9ad53d674e.
Vendored
+1
-1
Submodule external/corert updated: 814f76de6a...48dba73801.
Vendored
+1
-1
Submodule external/ikdasm updated: 88b67c42ca...1d7d436037.
Vendored
+1
-1
Submodule external/ikvm updated: 7c1e61bec8...847e05fced.
Vendored
+1
-1
Submodule external/linker updated: 21e445c26c...99354bf5c1.
Vendored
+1
-1
Submodule external/nuget-buildtasks updated: 8d307472ea...9e04cc7f41.
Vendored
+1
-1
Submodule external/roslyn-binaries updated: 1e3dfe1003...1904c7d068.
Vendored
+1
-1
Submodule external/xunit-binaries updated: b8e20d265b...d4433b0972.
+10
@@ -181,6 +181,16 @@ Gives the path for the temporary LLVM bitcode file created during AOT.
|
||||
.I info
|
||||
Print the architecture the AOT in this copy of Mono targets and quit.
|
||||
.TP
|
||||
.I interp
|
||||
Generates all required wrappers, so that it is possible to run --interpreter without
|
||||
any code generation at runtime. This option only makes sense with \fBmscorlib.dll\fR.
|
||||
Embedders can set
|
||||
|
||||
.nf
|
||||
mono_jit_set_aot_mode (MONO_AOT_MODE_INTERP);
|
||||
.fi
|
||||
.ne
|
||||
.TP
|
||||
.I ld-flags
|
||||
Additional flags to pass to the C linker (if the current AOT mode calls for invoking it).
|
||||
.TP
|
||||
|
||||
+1
-3
@@ -1,7 +1,5 @@
|
||||
This list of authors is outdated. For a full list of contributors
|
||||
see:
|
||||
|
||||
http://www.go-mono.com/archive/mono-1.0.html
|
||||
check out the git history.
|
||||
|
||||
C# Compiler:
|
||||
Miguel de Icaza ([email protected])
|
||||
|
||||
+1
-340
@@ -1,340 +1 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
||||
See LICENSE file in the project root for full license information.
|
||||
+1
-477
@@ -1,477 +1 @@
|
||||
* Coding Style for the Mono C# source code.
|
||||
|
||||
* Class Libraries and Assembly Layout
|
||||
|
||||
The class libraries are grouped together in the assemblies
|
||||
they belong.
|
||||
|
||||
Each directory here represents an assembly, and inside each
|
||||
directory we divide the code based on the namespace they
|
||||
implement.
|
||||
|
||||
In addition, each assembly directory contains a Test directory
|
||||
that holds the NUnit tests for that assembly.
|
||||
|
||||
We use a new build system which is described by various README
|
||||
files in mcs/build
|
||||
|
||||
The build process typically builds an assembly, but in some
|
||||
cases it also builds special versions of the assemblies
|
||||
intended to be used for testing.
|
||||
|
||||
* Missing implementation bits
|
||||
|
||||
If you implement a class and you are missing implementation bits,
|
||||
please use the attribute [MonoTODO]. This attribute can be used
|
||||
to programatically generate our status web pages:
|
||||
|
||||
[MonoTODO("My Function is not available on Mono")]
|
||||
int MyFunction ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
Ideally, write a human description of the reason why there is
|
||||
a MonoTODO, this will be useful in the future for our
|
||||
automated tools that can assist in developers porting their code.
|
||||
|
||||
* Tagging buggy code
|
||||
|
||||
If there is a bug in your implementation tag the problem by using
|
||||
the word "FIXME" in the code, together with a description of the
|
||||
problem.
|
||||
|
||||
Do not use XXX or obscure descriptions, because otherwise people
|
||||
will not be able to understand what you mean.
|
||||
|
||||
* Tagging Problematic specs.
|
||||
|
||||
If the documentation and the Microsoft implementation do
|
||||
differ (you wrote a test case to prove this), I suggest that you edit
|
||||
the file `mcs/class/doc/API-notes' so we can keep track of these problems
|
||||
and submit our comments to ECMA or Microsoft and seek clarification.
|
||||
|
||||
Sometimes the documentation might be buggy, and sometimes the implementation
|
||||
might be buggy. Lets try to identify and pinpoint which one
|
||||
is the correct one.
|
||||
|
||||
Sometimes the specification will be lame (consider Version.ToString (fieldCount)
|
||||
where there is no way of knowing how many fields are available, making the API
|
||||
not only stupid, but leading to unreliable code).
|
||||
|
||||
In those cases, use the keyword "LAMESPEC".
|
||||
|
||||
|
||||
* Coding considerations and style.
|
||||
|
||||
In order to keep the code consistent, please use the following
|
||||
conventions. From here on `good' and `bad' are used to attribute
|
||||
things that would make the coding style match, or not match. It is not
|
||||
a judgement call on your coding abilities, but more of a style and
|
||||
look call. Please try to follow these guidelines to ensure prettiness.
|
||||
|
||||
Use 8 space tabs for writing your code (hopefully we can keep
|
||||
this consistent). If you are modifying someone else's code, try
|
||||
to keep the coding style similar.
|
||||
|
||||
Since we are using 8-space tabs, you might want to consider the Linus
|
||||
Torvals trick to reduce code nesting. Many times in a loop, you will
|
||||
find yourself doing a test, and if the test is true, you will nest.
|
||||
Many times this can be changed. Example:
|
||||
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
if (something (i)) {
|
||||
do_more ();
|
||||
}
|
||||
}
|
||||
|
||||
This take precious space, instead write it like this:
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
if (!something (i))
|
||||
continue;
|
||||
do_more ();
|
||||
}
|
||||
|
||||
* Performance and readability
|
||||
|
||||
It is more important to be correct than to be fast.
|
||||
|
||||
It is more important to be maintainable than to be fast.
|
||||
|
||||
Fast code that is difficult to maintain is likely going to
|
||||
be looked down upon.
|
||||
|
||||
* Style Guidelines
|
||||
|
||||
* Use a space before an opening parenthesis when calling
|
||||
functions, or indexing, like this:
|
||||
|
||||
method (a);
|
||||
b [10];
|
||||
|
||||
* Do not put a space after the opening parenthesis and the
|
||||
closing one, ie:
|
||||
|
||||
good: method (a); array [10];
|
||||
|
||||
bad: method ( a ); array[ 10 ];
|
||||
|
||||
* Inside a code block, put the opening brace on the same line
|
||||
as the statement:
|
||||
|
||||
good:
|
||||
if (a) {
|
||||
code ();
|
||||
code ();
|
||||
}
|
||||
|
||||
bad:
|
||||
if (a)
|
||||
{
|
||||
code ();
|
||||
code ();
|
||||
}
|
||||
|
||||
* Avoid using unnecessary open/close braces, vertical space
|
||||
is usually limited:
|
||||
|
||||
good:
|
||||
if (a)
|
||||
code ();
|
||||
|
||||
bad:
|
||||
if (a) {
|
||||
code ();
|
||||
}
|
||||
|
||||
* When defining a method, use the C style for brace placement,
|
||||
that means, use a new line for the brace, like this:
|
||||
|
||||
good:
|
||||
void Method ()
|
||||
{
|
||||
}
|
||||
|
||||
bad:
|
||||
void Method () {
|
||||
}
|
||||
|
||||
* Properties and indexers are an exception, keep the
|
||||
brace on the same line as the property declaration.
|
||||
Rationale: this makes it visually
|
||||
simple to distinguish them.
|
||||
|
||||
good:
|
||||
int Property {
|
||||
get {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
bad:
|
||||
int Property
|
||||
{
|
||||
get {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
Notice how the accessor "get" also keeps its brace on the same
|
||||
line.
|
||||
|
||||
For very small properties, you can compress things:
|
||||
|
||||
ok:
|
||||
int Property {
|
||||
get { return value; }
|
||||
set { x = value; }
|
||||
}
|
||||
|
||||
* Use white space in expressions liberally, except in the presence
|
||||
of parenthesis:
|
||||
|
||||
good:
|
||||
|
||||
if (a + 5 > method (blah () + 4))
|
||||
|
||||
bad:
|
||||
if (a+5>method(blah()+4))
|
||||
|
||||
* For any new files, please use a descriptive introduction, like
|
||||
this:
|
||||
|
||||
//
|
||||
// System.Comment.cs: Handles comments in System files.
|
||||
//
|
||||
// Author:
|
||||
// Juan Perez ([email protected])
|
||||
//
|
||||
// (C) 2002 Address, Inc (http://www.address.com)
|
||||
//
|
||||
|
||||
* If you are modyfing someone else's code, and your contribution
|
||||
is significant, please add yourself to the Authors list.
|
||||
|
||||
* Switch statements have the case at the same indentation as the
|
||||
switch:
|
||||
|
||||
switch (x) {
|
||||
case 'a':
|
||||
...
|
||||
case 'b':
|
||||
...
|
||||
}
|
||||
|
||||
* Argument names should use the camel casing for
|
||||
identifiers, like this:
|
||||
|
||||
good:
|
||||
void Method (string myArgument)
|
||||
|
||||
bad:
|
||||
void Method (string lpstrArgument)
|
||||
void Method (string my_string)
|
||||
|
||||
* Empty methods: They should have the body of code using two
|
||||
lines, in consistency with the rest:
|
||||
|
||||
good:
|
||||
void EmptyMethod ()
|
||||
{
|
||||
}
|
||||
|
||||
bad:
|
||||
void EmptyMethod () {}
|
||||
|
||||
void EmptyMethod ()
|
||||
{}
|
||||
|
||||
* Line length: The line length for C# source code is 134 columns.
|
||||
|
||||
|
||||
If your function declaration arguments go beyond
|
||||
this point, please align your arguments to match the
|
||||
opening brace, like this:
|
||||
|
||||
void Function (int arg, string argb,
|
||||
int argc)
|
||||
{
|
||||
}
|
||||
|
||||
When invoking functions, the rule is different, the
|
||||
arguments are not aligned with the previous
|
||||
argument, instead they begin at the tabbed position,
|
||||
like this:
|
||||
|
||||
void M ()
|
||||
{
|
||||
MethodCall ("Very long string that will force",
|
||||
"Next argument on the 8-tab pos",
|
||||
"Just like this one")
|
||||
|
||||
}
|
||||
|
||||
* Variable declaration indentation.
|
||||
|
||||
Sometimes it is convenient to indent the variables to make the code
|
||||
look pretier, but do not add gratuitous space, try to use the minimally
|
||||
necessary space, for example:
|
||||
|
||||
Good:
|
||||
|
||||
void Method ()
|
||||
{
|
||||
string b;
|
||||
int a;
|
||||
byte c;
|
||||
}
|
||||
|
||||
Bad:
|
||||
|
||||
void Method ()
|
||||
{
|
||||
string b;
|
||||
int a;
|
||||
byte c;
|
||||
}
|
||||
|
||||
* Braces and the `else' clause
|
||||
|
||||
If there are braces closing or opening next to the else clause,
|
||||
they go on the same line as the word `else', for example:
|
||||
|
||||
Good:
|
||||
|
||||
if (..) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
Bad:
|
||||
|
||||
if (..) {
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
Bad:
|
||||
|
||||
if (..) {
|
||||
|
||||
} else
|
||||
{
|
||||
}
|
||||
|
||||
Bad:
|
||||
|
||||
if (..) {
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
* RCS and CVS tags
|
||||
|
||||
Some users like to use the special RCS/CVS tags in their
|
||||
source code: $id$, $log$ and so on.
|
||||
|
||||
The use of these is not permitted on the Mono source code
|
||||
repository. This metadata belongs on a ChangeLog or in the
|
||||
SVN metadata.
|
||||
|
||||
* File formats
|
||||
|
||||
Historically our repository has used a mix of line-endings,
|
||||
this is a mistake that we are trying hard to fix.
|
||||
|
||||
For existing files, please make sure that you do not convert
|
||||
the file, as that causes us to loose precious history (the
|
||||
full file is commited).
|
||||
|
||||
For new files that you create, please make sure that you use
|
||||
Subversion's support for mapping the line endings
|
||||
automatically, after adding your file:
|
||||
|
||||
$ svn add file.cs
|
||||
|
||||
Execute this command:
|
||||
|
||||
$ svn propset svn:eol-style native file.cs
|
||||
|
||||
Which will make the file automatically receive the proper
|
||||
treatment from that point on.
|
||||
|
||||
Please verify before commiting that your changes wont loose
|
||||
history, you can do this by running:
|
||||
|
||||
$ svn diff
|
||||
|
||||
And examining the output.
|
||||
|
||||
* Warnings
|
||||
|
||||
Avoid commiting code with warnings to the repository, the use
|
||||
of #pragmas to disable warnings is strongly discouraged, but
|
||||
can be used on unique cases. Please justify the use of the
|
||||
warning ignore clause on a comment.
|
||||
|
||||
Do not commit changes to the Makefiles that removes warnings,
|
||||
if anything warnings should be eliminated one at a time, and
|
||||
if not possible, they must be flagged.
|
||||
|
||||
|
||||
* Examples:
|
||||
|
||||
class X : Y {
|
||||
|
||||
bool Method (int argument_1, int argument_2)
|
||||
{
|
||||
if (argument_1 == argument_2)
|
||||
throw new Exception (Locale.GetText ("They are equal!");
|
||||
|
||||
if (argument_1 < argument_2) {
|
||||
if (argument_1 * 3 > 4)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// This sample helps keep your sanity while using 8-spaces for tabs
|
||||
//
|
||||
VeryLongIdentifierWhichTakesManyArguments (
|
||||
Argument1, Argument2, Argument3,
|
||||
NestedCallHere (
|
||||
MoreNested));
|
||||
}
|
||||
|
||||
bool MyProperty {
|
||||
get {
|
||||
return x;
|
||||
}
|
||||
|
||||
set {
|
||||
x = value;
|
||||
}
|
||||
}
|
||||
|
||||
void AnotherMethod ()
|
||||
{
|
||||
if ((a + 5) != 4) {
|
||||
}
|
||||
|
||||
while (blah) {
|
||||
if (a)
|
||||
continue;
|
||||
b++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
* Conditional compilation
|
||||
|
||||
Ideally we would not need conditional compilation, and the use
|
||||
of #ifdef is strongly discouraged. But due to our support for
|
||||
old C# 1.0 compilers we have to use it in a few places.
|
||||
|
||||
Try to avoid negative tests that have an else clause, for
|
||||
example:
|
||||
|
||||
#if !NET_2_0
|
||||
CODE_FOR_1_0
|
||||
#else
|
||||
CODE_FOR_2_0
|
||||
#endif
|
||||
|
||||
Instead use:
|
||||
|
||||
#if NET_2_0
|
||||
CODE_FOR_2_0
|
||||
#else
|
||||
CODE_FOR_1_0
|
||||
#endif
|
||||
|
||||
When a major feature differs across compilation targets, try
|
||||
to factor out the code into a separate class, a helper class
|
||||
or a separate file, and include that in your profile while
|
||||
surrounding that helper file/class with the ifdefs to reduce
|
||||
the amount of ifdefs in the code.
|
||||
|
||||
For instance, this is used for some parts of Grasshopper where
|
||||
the code is ifdefed out, when large parts of a file would have
|
||||
been ifdefed out, we moved the code into a MyOtherFile.jvm.cs
|
||||
|
||||
For 2.0 classes, this is even simpler as code can be trivially
|
||||
factored out into
|
||||
|
||||
MyHelperClass.cli.cs
|
||||
MyHelperClass.jvm.cs
|
||||
|
||||
By using partial classes.
|
||||
Please see http://www.mono-project.com/community/contributing/coding-guidelines/ for latest guidelines.
|
||||
+4
-108
@@ -23,7 +23,7 @@ compilers and tools.
|
||||
* *
|
||||
*********************************************************************
|
||||
|
||||
If you only want to build a snapshot or a fresh CVS checkout of the
|
||||
If you only want to build a snapshot or a fresh checkout of the
|
||||
sources, you should go into the `mono' sibling directory and issue the
|
||||
make command, like this:
|
||||
|
||||
@@ -35,72 +35,6 @@ make command, like this:
|
||||
The compilation is bundled with the build due to dependencies on the
|
||||
class libraries on the runtime.
|
||||
|
||||
Build Features for Developers of Mono.
|
||||
======================================
|
||||
|
||||
These instructions apply to both Linux and Windows. To build this
|
||||
package, you must already have a C# compiler installed. This means
|
||||
that to build on Linux, you need to get a distribution of the MCS
|
||||
binaries; these are called monocharges. They can be found at
|
||||
www.go-mono.com/daily. On Windows, you can just use the
|
||||
Microsoft compiler. You also need GNU make to build the software (on
|
||||
Windows, you will need for example the Cygwin environment setup).
|
||||
|
||||
You can customize your MCS configuration by using:
|
||||
|
||||
./configure [--prefix=PREFIX] [--profile=PROFILE]
|
||||
|
||||
If you do not run the above, the defaults are /usr/local for the
|
||||
prefix, and `default' for the profile.
|
||||
|
||||
To build the compiler and class libraries, run:
|
||||
|
||||
make
|
||||
|
||||
The libraries will be placed in the directory class/lib/ and the mcs
|
||||
compiler executable in mcs/.
|
||||
|
||||
To install them, run the following:
|
||||
|
||||
make install
|
||||
|
||||
If you get "corlib out of sync" errors, try
|
||||
|
||||
make PROFILE="atomic"
|
||||
|
||||
A better alternative would be to fire off a 'make' from a sibling or
|
||||
parent 'mono/' tree.
|
||||
|
||||
Troubleshooting
|
||||
===============
|
||||
|
||||
We try to maintain the CVS tree such that it is bootstrapable from the
|
||||
latest released version of mono and mcs. Occasionally, something in the
|
||||
compiler or runtime changes enough that an existing installation cannot
|
||||
complete a bootstrap from cvs. In this case, go to
|
||||
http://go-mono.com/daily and download a monocharge or monolite tarball.
|
||||
Unpack and copy the .dlls to $prefix/lib and .exes to $prefix/bin/.
|
||||
Then you should be able to complete the build normally (i.e. using make
|
||||
bootstrap).
|
||||
|
||||
wget http://go-mono.com/daily/monolite-20040505.tar.gz
|
||||
tar -zxvf monolite-20040505.tar.gz
|
||||
cd monolite-20040505
|
||||
env prefix=/usr/local sh recharge.sh
|
||||
|
||||
Monocharges
|
||||
===========
|
||||
|
||||
If you are tracking Mono's development, you may sometimes need to share
|
||||
the compiled libraries with others, you can do:
|
||||
|
||||
make monocharge
|
||||
|
||||
Or a light version, which contains only the essential libraries and
|
||||
results in a much smaller file:
|
||||
|
||||
make monocharge-lite
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
@@ -110,48 +44,15 @@ place your configuration options in build/config.make
|
||||
A list of variables that control the build are listed in the file
|
||||
build/config-default.make.
|
||||
|
||||
Build profiles? What?
|
||||
======================
|
||||
|
||||
Don't worry about them too much. If you're wondering which to use:
|
||||
use the default if you can (that's why it's the default!) and use
|
||||
the atomic if you have to.
|
||||
|
||||
The default profile uses the C# compiler and class libaries as they
|
||||
are built. This lets you build MCS without needing to have already
|
||||
installed it, but can fail if the libraries change significantly.
|
||||
(This is the source of the dreaded "corlib out of sync" warning, most
|
||||
of the time.)
|
||||
|
||||
The atomic profile tries to use the system compiler and preexisting
|
||||
MCS libraries. New libaries are built against this constant reference
|
||||
point, so if a newly built library has a binary incompatibility, the
|
||||
rest of your build can proceed.
|
||||
|
||||
If you want to always use the atomic profile, run this command:
|
||||
|
||||
./configure --profile=atomic
|
||||
|
||||
More About the Build System
|
||||
===========================
|
||||
|
||||
More information is found in build/README.*. Here's a quick rundown
|
||||
of the features:
|
||||
|
||||
* Unified build system for Windows and Linux. Windows is still
|
||||
fairly untested, but "should work." Unfortunately I don't
|
||||
have a Windows machine to test on, but Gonzalo can get
|
||||
corlib to build I think and that's about as complicated as
|
||||
it gets.
|
||||
|
||||
* Profile support. 'make PROFILE=profilename' or 'export
|
||||
PROFILE=profilename ; make' will work. Profiles are defined
|
||||
in build/profiles/profilename.make ; right now there isn't
|
||||
too much going on. The 'bootstrap' profile will build the
|
||||
way makefile.gnu did on Linux, by setting MONO_PATH and
|
||||
using mcs/mcs.exe; the default profile will build against
|
||||
the existing system libraries and compile with 'mcs', which
|
||||
should reduce a lot of 'corlib out of sync' warnings.
|
||||
in build/profiles/profilename.make ;
|
||||
|
||||
* Important variables are shared among makefiles now; you can
|
||||
edit build/config.make (see build/config-default.make for a
|
||||
@@ -164,16 +65,11 @@ of the features:
|
||||
|
||||
* Test libraries now live in class/Library/Library_test.dll,
|
||||
not class/Library/Test. 'make test' will build the test DLL,
|
||||
'make run-test' will actually run the nunit tests. Set the
|
||||
variable TEST_HARNESS to run with a program other than
|
||||
nunit-console (for example, nunit-gtk).
|
||||
'make run-test' will actually run the nunit tests.
|
||||
|
||||
* Standardized recursive targets: all, clean, install, test,
|
||||
run-test. Read build/README.makefiles for definitions of
|
||||
what they should do
|
||||
|
||||
* (Relatively) sane 'make dist' target; 'make distcheck'
|
||||
support; cute 'make monocharge' and 'make monocharge-lite'
|
||||
targets. They're made possible because 'make install' now
|
||||
supports DESTDIR a la automake, which I'm sure someone cares
|
||||
about.
|
||||
support;
|
||||
+2
-25
@@ -95,8 +95,7 @@ DISTFILES = \
|
||||
mkinstalldirs \
|
||||
MonoIcon.png \
|
||||
README \
|
||||
ScalableMonoIcon.svg \
|
||||
winexe.in
|
||||
ScalableMonoIcon.svg
|
||||
|
||||
dist-local: dist-default
|
||||
|
||||
@@ -138,34 +137,12 @@ distcheck: dist-tarball
|
||||
rm -f before.list after.list distdist.list ; \
|
||||
rm -rf $(package) InstallTest
|
||||
|
||||
monocharge:
|
||||
chargedir=monocharge-`date -u +%Y%m%d` ; \
|
||||
mkdir "$$chargedir" ; \
|
||||
DESTDIR=`cd "$$chargedir" && pwd` ; \
|
||||
$(MAKE) install DESTDIR="$$DESTDIR" || exit 1 ; \
|
||||
tar cvjf "$$chargedir".tar.bz2 "$$chargedir" ; \
|
||||
rm -rf "$$chargedir"
|
||||
|
||||
# A bare-bones monocharge.
|
||||
|
||||
monocharge-lite:
|
||||
chargedir=monocharge-lite-`date -u +%Y%m%d` ; \
|
||||
mkdir "$$chargedir" ; \
|
||||
DESTDIR=`cd "$$chargedir" && pwd` ; \
|
||||
$(MAKE) -C mcs install DESTDIR="$$DESTDIR" || exit 1; \
|
||||
$(MAKE) -C class/corlib install DESTDIR="$$DESTDIR" || exit 1; \
|
||||
$(MAKE) -C class/System install DESTDIR="$$DESTDIR" || exit 1; \
|
||||
$(MAKE) -C class/System.XML install DESTDIR="$$DESTDIR" || exit 1; \
|
||||
$(MAKE) -C class/Mono.CSharp.Debugger install DESTDIR="$$DESTDIR" || exit 1; \
|
||||
tar cvjf "$$chargedir".tar.bz2 "$$chargedir" ; \
|
||||
rm -rf "$$chargedir"
|
||||
|
||||
# Targets for creating API diffs of the framework
|
||||
|
||||
MONO_API_SNAPSHOT_PATH := $(topdir)../external/api-snapshot/
|
||||
GENAPI := $(MONO_API_SNAPSHOT_PATH)tools/genapi/GenAPI.exe
|
||||
MONO_API_SNAPSHOT_PROFILE_PATH := $(MONO_API_SNAPSHOT_PATH)profiles/$(PROFILE)/
|
||||
MONO_API_ASSEMBLIES_IGNORED := $(addprefix $(topdir)class/lib/$(PROFILE)/, SystemWebTestShim.dll standalone-runner-support.dll nunit.core.dll nunit.core.extensions.dll nunit.core.interfaces.dll nunit.framework.dll nunit.framework.extensions.dll nunit.mocks.dll nunit.util.dll nunit-console-runner.dll nunitlite.dll)
|
||||
MONO_API_ASSEMBLIES_IGNORED := $(addprefix $(topdir)class/lib/$(PROFILE)/, Mono.CSharp.dll SystemWebTestShim.dll standalone-runner-support.dll nunit.core.dll nunit.core.extensions.dll nunit.core.interfaces.dll nunit.framework.dll nunit.framework.extensions.dll nunit.mocks.dll nunit.util.dll nunit-console-runner.dll nunitlite.dll)
|
||||
MONO_API_ASSEMBLIES := $(filter-out $(MONO_API_ASSEMBLIES_IGNORED), $(wildcard $(topdir)class/lib/$(PROFILE)/*.dll)) $(wildcard $(topdir)class/lib/$(PROFILE)/Facades/*.dll)
|
||||
MONO_API_ASSEMBLIES_CS := $(MONO_API_ASSEMBLIES:$(topdir)class/lib/$(PROFILE)/%.dll=$(MONO_API_SNAPSHOT_PROFILE_PATH)%.cs)
|
||||
|
||||
|
||||
+20
-19
@@ -19,31 +19,34 @@ package module which drives the compilation of this directory.
|
||||
class/
|
||||
The class libraries.
|
||||
|
||||
docs/
|
||||
Some notes on the compiler and the class libraries.
|
||||
|
||||
errors/
|
||||
Sample programs that should generate errors by the C# compiler.
|
||||
|
||||
ilasm/
|
||||
The IL assembler.
|
||||
|
||||
jay/
|
||||
Yacc-based parser generator.
|
||||
|
||||
mcs/
|
||||
The Mono C# compiler
|
||||
|
||||
nunit24/
|
||||
An old copy of the NUnit 2.4 library that we ship for historical reasons.
|
||||
|
||||
packages/
|
||||
Integrates some packages from NuGet (like Roslyn) into the build system.
|
||||
|
||||
tests/
|
||||
Regression test suite for the C# compiler
|
||||
|
||||
docs/
|
||||
Some notes on the compiler and the class libraries.
|
||||
|
||||
nant/
|
||||
A copy of nant source code, used during the build process
|
||||
on Windows.
|
||||
|
||||
tools/
|
||||
Various small development tools: CorCompare used to compare
|
||||
two assemblies for differences in the API; TypeReflector is
|
||||
a tool used to introspect types from assemblies from the
|
||||
command line; MonoStyle helps you keep your code indendented
|
||||
with the Mono programming style.
|
||||
two assemblies for differences in the API; csharp is a C# REPL;
|
||||
cil-strip trims IL from assemblies.
|
||||
|
||||
* Building Individual Directories
|
||||
=================================
|
||||
@@ -51,14 +54,14 @@ package module which drives the compilation of this directory.
|
||||
You can build individual components in the hierarchy by running the command
|
||||
"make", and to install it use "make install".
|
||||
|
||||
By default, the 2.x profile is built, if you want to build the net 1.1 profile,
|
||||
By default, the 4.x profile is built, if you want to build other profiles,
|
||||
use the following command:
|
||||
|
||||
make PROFILE=net_1_1
|
||||
make PROFILE=<profilename>
|
||||
|
||||
And to install:
|
||||
|
||||
make PROFILE=net_1_1 install
|
||||
make PROFILE=<profilename> install
|
||||
|
||||
To turn on verbose mode in the build (for example to diagnose a
|
||||
problem), you can use the V=1 flag, like this:
|
||||
@@ -68,16 +71,14 @@ problem), you can use the V=1 flag, like this:
|
||||
* Running Unit tests
|
||||
====================
|
||||
|
||||
You can run unit tests in individual components by running the command
|
||||
"make run-test". If you want to run tests for a different profile (say
|
||||
'net_1_1')
|
||||
You can run unit tests in individual components by running the command:
|
||||
|
||||
make run-test PROFILE=net_1_1
|
||||
make run-test
|
||||
|
||||
If you want to only run the tests in a single fixture (say
|
||||
'MonoTests.System.TypeTest'), you can use
|
||||
|
||||
make run-test TEST_HARNESS_FLAGS=/fixture:MonoTests.System.TypeTest
|
||||
make run-test TEST_FIXTURE=System.TypeTest
|
||||
|
||||
* Acknowledgements
|
||||
==================
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\ExtensionPack\MSBuild.ExtensionPack.tasks"/>
|
||||
<Target Name="Build">
|
||||
<Copy SourceFiles="common\Consts.cs.in" DestinationFiles="common\Consts.cs"/>
|
||||
<MSBuild.ExtensionPack.FileSystem.File TaskAction="Replace" RegexPattern="@MONO_VERSION@" Replacement="2.7.0.0" Files="common\Consts.cs"/>
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -1,2 +0,0 @@
|
||||
/Mono.Common.targets -crlf
|
||||
/Mono.Default.targets -crlf
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\ExtensionPack\MSBuild.ExtensionPack.tasks"/>
|
||||
<PropertyGroup Condition=" '$(USE_MONO_COMPILER)' == '1' ">
|
||||
<CscToolExe>gmcs.bat</CscToolExe>
|
||||
<CscToolPath>C:\MonoExperimental2.5.0\bin</CscToolPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" ('$(Configuration)' == 'basic' Or '$(Configuration)' == 'basic_XML_DEP') ">
|
||||
<OutputPath Condition=" '$(OutputPath)' == '' ">$(MSBuildProjectDirectory)\..\lib\basic\</OutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'net_2_0_bootstrap' ">
|
||||
<OutputPath Condition=" '$(OutputPath)' == '' ">$(MSBuildProjectDirectory)\..\lib\net_2_0_bootstrap\</OutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutputPath Condition=" '$(OutputPath)' == '' ">$(MSBuildProjectDirectory)\..\lib\$(Configuration)\</OutputPath>
|
||||
</PropertyGroup>
|
||||
<Target Name="SetupProject">
|
||||
<Copy SourceFiles="$(ResponseFile)" DestinationFiles="$(ResponseFile).msbuild"/>
|
||||
<MSBuild.ExtensionPack.FileSystem.File TaskAction="Replace" RegexPattern="/" Replacement="\" Files="$(ResponseFile).msbuild"/>
|
||||
<MakeDir Directories="$(OutputDirectory)"/>
|
||||
</Target>
|
||||
<PropertyGroup Condition=" '$(ResponseFile)' == '' ">
|
||||
<ResponseFile>$(MSBuildProjectName).dll.sources</ResponseFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<CompilerResponseFile>$(ResponseFile).msbuild</CompilerResponseFile>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition="'$(Configuration)' == ''">net_2_0</Configuration>
|
||||
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- makefile -*-
|
||||
|
||||
monolite_path := $(topdir)/class/lib/monolite/$(MONO_CORLIB_VERSION)
|
||||
monolite_path := $(topdir)/class/lib/monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)
|
||||
|
||||
with_mono_path_monolite = MONO_PATH="$(monolite_path)$(PLATFORM_PATH_SEPARATOR)$(monolite_path)/Facades$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH"
|
||||
|
||||
@@ -90,7 +90,7 @@ ifdef use_monolite
|
||||
do-get-monolite:
|
||||
|
||||
do-profile-check-monolite:
|
||||
@echo "*** The contents of your 'monolite/$(MONO_CORLIB_VERSION)' directory may be out-of-date" 1>&2
|
||||
@echo "*** The contents of your 'monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)' directory may be out-of-date" 1>&2
|
||||
@echo "*** You may want to try 'make get-monolite-latest'" 1>&2
|
||||
rm -f $(monolite_flag)
|
||||
exit 1
|
||||
@@ -98,12 +98,12 @@ do-profile-check-monolite:
|
||||
else
|
||||
|
||||
do-get-monolite:
|
||||
@echo "*** Downloading bootstrap required 'monolite/$(MONO_CORLIB_VERSION)'" 1>&2
|
||||
$(MAKE) $(MAKE_Q) -C $(mono_build_root) get-monolite-latest
|
||||
@echo "*** Downloading bootstrap required 'monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)'" 1>&2
|
||||
$(MAKE) $(MAKE_Q) -C $(topdir)/class get-monolite-latest
|
||||
|
||||
do-profile-check-monolite: $(depsdir)/.stamp
|
||||
@echo "*** The runtime '$(PROFILE_RUNTIME)' doesn't appear to be usable." 1>&2
|
||||
@echo "*** Trying the 'monolite/$(MONO_CORLIB_VERSION)' directory." 1>&2
|
||||
@echo "*** Trying the 'monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)' directory." 1>&2
|
||||
@echo dummy > $(monolite_flag)
|
||||
$(MAKE) do-profile-check
|
||||
|
||||
|
||||
@@ -6,12 +6,14 @@ BUILD_TOOLS_PROFILE = basic
|
||||
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_CSC)
|
||||
MCS = $(BOOTSTRAP_MCS)
|
||||
|
||||
PLATFORMS = darwin linux win32
|
||||
|
||||
# nuttzing!
|
||||
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
|
||||
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/mscorlib.dll
|
||||
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES)
|
||||
|
||||
NO_SIGN_ASSEMBLY = yes
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
include $(topdir)/build/profiles/net_4_x.make
|
||||
|
||||
PLATFORMS:=
|
||||
|
||||
PARENT_PROFILE = ../net_4_x$(if $(PROFILE_PLATFORM),-$(PROFILE_PLATFORM))/
|
||||
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/net_4_x$(if $(PROFILE_PLATFORM),-$(PROFILE_PLATFORM))/mscorlib.dll
|
||||
PROFILE_MCS_FLAGS += -d:XBUILD_12
|
||||
|
||||
@@ -20,9 +20,10 @@ TEST_RUNTIME_WRAPPERS_PATH = $(shell dirname $(RUNTIME))/_tmpinst/bin
|
||||
ifndef NO_TEST
|
||||
|
||||
test_nunit_lib = nunitlite.dll
|
||||
xunit_core := xunit.core xunit.abstractions xunit.assert
|
||||
xunit_core := xunit.core xunit.abstractions xunit.assert Xunit.NetCore.Extensions
|
||||
xunit_deps := System.Runtime
|
||||
xunit_class_deps := Xunit.NetCore.Extensions
|
||||
xunit_src := $(patsubst %,$(topdir)/../external/xunit-binaries/%,BenchmarkAttribute.cs BenchmarkDiscover.cs)
|
||||
xunit_class_deps :=
|
||||
|
||||
xunit_libs_ref = $(patsubst %,-r:$(topdir)/../external/xunit-binaries/%.dll,$(xunit_core))
|
||||
xunit_libs_ref += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/Facades/%.dll,$(xunit_deps))
|
||||
@@ -89,9 +90,6 @@ endif
|
||||
|
||||
tests_CLEAN_FILES += $(topdir)/build/deps/nunit-$(PROFILE).stamp
|
||||
|
||||
$(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)Xunit.NetCore.Extensions.dll:
|
||||
$(MAKE) -C $(topdir)/class/Xunit.NetCore.Extensions
|
||||
|
||||
endif
|
||||
|
||||
test_assemblies :=
|
||||
@@ -222,8 +220,8 @@ run-xunit-test-lib: xunit-test-local
|
||||
$$ok
|
||||
@rm -f xunit.execution.desktop.dll
|
||||
|
||||
$(xunit_test_lib): $(the_assembly) $(xtest_response) $(xunit_libs_dep)
|
||||
$(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response)
|
||||
$(xunit_test_lib): $(the_assembly) $(xtest_response) $(xunit_libs_dep) $(xunit_src)
|
||||
$(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response) $(xunit_src)
|
||||
|
||||
xtest_response_preprocessed = $(xtest_response)_preprocessed
|
||||
|
||||
|
||||
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
|
||||
[assembly: AssemblyCompany ("Xamarin, Inc.")]
|
||||
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
|
||||
[assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
|
||||
[assembly: AssemblyVersion ("4.1.0.0")]
|
||||
[assembly: AssemblyVersion ("4.2.1.0")]
|
||||
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
|
||||
[assembly: AssemblyFileVersion ("4.0.0.0")]
|
||||
@@ -21,39 +21,159 @@
|
||||
//
|
||||
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.DBNull))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.AcceptRejectRule))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.CommandBehavior))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.CommandType))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.CatalogLocation))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DataAdapter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DataColumnMapping))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DataColumnMappingCollection))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DataTableMapping))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DataTableMappingCollection))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbColumn))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbCommand))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbCommandBuilder))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbConnection))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbConnectionStringBuilder))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbDataAdapter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbDataReader))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbDataReaderExtensions))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbDataRecord))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbDataSourceEnumerator))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbEnumerator))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbMetaDataCollectionNames))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbMetaDataColumnNames))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbParameter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbParameterCollection))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbProviderFactory))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbProviderSpecificTypePropertyAttribute))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbTransaction))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.GroupByBehavior))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.IDbColumnSchemaGenerator))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.IdentifierCase))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.RowUpdatedEventArgs))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.RowUpdatingEventArgs))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.SchemaTableColumn))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.SchemaTableOptionalColumn))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.SupportedJoinOperators))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.ConflictOption))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.ConnectionState))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Constraint))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.ConstraintCollection))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.ConstraintException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DBConcurrencyException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataColumn))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataColumnChangeEventArgs))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataColumnChangeEventHandler))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataColumnCollection))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRelation))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRelationCollection))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRow))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRowAction))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRowBuilder))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRowChangeEventArgs))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRowChangeEventHandler))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRowCollection))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRowState))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRowVersion))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRowView))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataSet))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataSetDateTime))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataSysDescriptionAttribute))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataTable))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataTableClearEventArgs))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataTableClearEventHandler))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataTableCollection))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataTableNewRowEventArgs))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataTableNewRowEventHandler))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataTableReader))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataView))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataViewManager))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataViewRowState))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataViewSetting))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataViewSettingCollection))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DbType))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DeletedRowInaccessibleException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DuplicateNameException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.EvaluateException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.FillErrorEventArgs))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.FillErrorEventHandler))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.ForeignKeyConstraint))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IColumnMapping))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IColumnMappingCollection))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDataAdapter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDataParameter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDataParameterCollection))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDataReader))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDataRecord))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDbCommand))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDbConnection))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDbDataAdapter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDbDataParameter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDbTransaction))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.ITableMapping))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.ITableMappingCollection))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.InRowChangingEventException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.InternalDataCollectionBase))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.InvalidConstraintException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.InvalidExpressionException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IsolationLevel))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.KeyRestrictionBehavior))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.LoadOption))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.MappingType))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.MergeFailedEventArgs))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.MergeFailedEventHandler))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.MissingMappingAction))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.MissingPrimaryKeyException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.MissingSchemaAction))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.NoNullAllowedException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.ParameterDirection))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.PropertyCollection))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.ReadOnlyException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.RowNotInTableException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Rule))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SchemaSerializationMode))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SchemaType))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SerializationFormat))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlDbType))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.INullable))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlAlreadyFilledException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlBinary))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlBoolean))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlByte))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlBytes))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlChars))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlCompareOptions))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlDateTime))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlDecimal))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlDouble))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlGuid))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlInt16))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlInt32))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlInt64))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlMoney))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlNotFilledException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlNullValueException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlSingle))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlString))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlTruncateException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlTypeException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlXml))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.StorageState))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.StateChangeEventArgs))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.StateChangeEventHandler))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.StatementCompletedEventArgs))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.StatementCompletedEventHandler))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.StatementType))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.StrongTypingException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SyntaxErrorException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.UniqueConstraint))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.UpdateRowSource))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.UpdateStatus))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.VersionNotFoundException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.XmlReadMode))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.XmlWriteMode))]
|
||||
|
||||
|
||||
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
|
||||
[assembly: AssemblyCompany ("Xamarin, Inc.")]
|
||||
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
|
||||
[assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
|
||||
[assembly: AssemblyVersion ("4.0.2.0")]
|
||||
[assembly: AssemblyVersion ("4.1.1.0")]
|
||||
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
|
||||
[assembly: AssemblyFileVersion ("4.0.0.0")]
|
||||
@@ -22,4 +22,19 @@
|
||||
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.StackFrame))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.StackTrace))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.ISymbolBinder))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.ISymbolBinder1))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.ISymbolDocument))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.ISymbolDocumentWriter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.ISymbolMethod))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.ISymbolNamespace))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.ISymbolReader))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.ISymbolScope))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.ISymbolVariable))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.ISymbolWriter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.SymAddressKind))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.SymDocumentType))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.SymLanguageType))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.SymLanguageVendor))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.SymbolToken))]
|
||||
|
||||
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
|
||||
[assembly: AssemblyCompany ("Xamarin, Inc.")]
|
||||
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
|
||||
[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")]
|
||||
[assembly: AssemblyVersion ("4.1.0.0")]
|
||||
[assembly: AssemblyVersion ("4.2.1.0")]
|
||||
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
|
||||
[assembly: AssemblyFileVersion ("4.0.0.0")]
|
||||
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
|
||||
[assembly: AssemblyCompany ("Xamarin, Inc.")]
|
||||
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
|
||||
[assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
|
||||
[assembly: AssemblyVersion ("4.0.1.0")]
|
||||
[assembly: AssemblyVersion ("4.1.1.0")]
|
||||
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
|
||||
[assembly: AssemblyFileVersion ("4.0.0.0")]
|
||||
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
|
||||
[assembly: AssemblyCompany ("Xamarin, Inc.")]
|
||||
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
|
||||
[assembly: AssemblyCopyright ("Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)")]
|
||||
[assembly: AssemblyVersion ("4.0.0.0")]
|
||||
[assembly: AssemblyVersion ("4.0.1.0")]
|
||||
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
|
||||
[assembly: AssemblyFileVersion ("4.0.0.0")]
|
||||
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
|
||||
[assembly: AssemblyCompany ("Xamarin, Inc.")]
|
||||
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
|
||||
[assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
|
||||
[assembly: AssemblyVersion ("4.1.0.0")]
|
||||
[assembly: AssemblyVersion ("4.2.1.0")]
|
||||
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
|
||||
[assembly: AssemblyFileVersion ("4.0.0.0")]
|
||||
@@ -27,6 +27,7 @@
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.LingerOption))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.MulticastOption))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.NetworkStream))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.ProtocolFamily))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.ProtocolType))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.SelectMode))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.SendPacketsElement))]
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ using System.Runtime.CompilerServices;
|
||||
[assembly: AssemblyCompany ("Xamarin, Inc.")]
|
||||
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
|
||||
[assembly: AssemblyCopyright ("Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)")]
|
||||
[assembly: AssemblyVersion ("4.0.1.0")]
|
||||
[assembly: AssemblyVersion ("4.0.3.0")]
|
||||
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
|
||||
[assembly: AssemblyFileVersion ("4.0.0.0")]
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ LIBRARY = System.Runtime.InteropServices.RuntimeInformation.dll
|
||||
RESX_RESOURCE_STRING = ../../../../external/corefx/src/System.Runtime.InteropServices.RuntimeInformation/src/Resources/Strings.resx
|
||||
|
||||
KEY_FILE = ../../msfinal.pub
|
||||
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
|
||||
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699,436
|
||||
LIB_REFS = System
|
||||
LIB_MCS_FLAGS = $(SIGN_FLAGS) /unsafe
|
||||
|
||||
|
||||
+1
-4
@@ -35,12 +35,9 @@ namespace System.Runtime.InteropServices
|
||||
{
|
||||
public static class RuntimeInformation
|
||||
{
|
||||
[DllImport ("__Internal")]
|
||||
extern static string mono_get_runtime_build_info ();
|
||||
|
||||
public static string FrameworkDescription {
|
||||
get {
|
||||
return mono_get_runtime_build_info ();
|
||||
return "Mono " + Mono.Runtime.GetDisplayName ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
|
||||
[assembly: AssemblyCompany ("Xamarin, Inc.")]
|
||||
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
|
||||
[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")]
|
||||
[assembly: AssemblyVersion ("4.1.1.0")]
|
||||
[assembly: AssemblyVersion ("4.2.1.0")]
|
||||
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
|
||||
[assembly: AssemblyFileVersion ("4.0.0.0")]
|
||||
@@ -25,7 +25,11 @@
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.DataContractAttribute))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.DataMemberAttribute))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.EnumMemberAttribute))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.ExportOptions))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.ExtensionDataObject))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.IExtensibleDataObject))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.IgnoreDataMemberAttribute))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.InvalidDataContractException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.KnownTypeAttribute))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.OnDeserializedAttribute))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.OnDeserializingAttribute))]
|
||||
@@ -33,4 +37,13 @@
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.OnSerializingAttribute))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.SerializationException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.StreamingContext))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.InvalidDataContractException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.StreamingContextStates))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.XmlSerializableServices))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.XPathQueryGenerator))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.XsdDataContractExporter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.IFragmentCapableXmlDictionaryWriter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.IStreamProvider))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.IXmlBinaryReaderInitializer))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.IXmlBinaryWriterInitializer))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.IXmlTextReaderInitializer))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.IXmlTextWriterInitializer))]
|
||||
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
|
||||
[assembly: AssemblyCompany ("Xamarin, Inc.")]
|
||||
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
|
||||
[assembly: AssemblyCopyright ("Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)")]
|
||||
[assembly: AssemblyVersion ("4.2.0.0")]
|
||||
[assembly: AssemblyVersion ("4.3.1.0")]
|
||||
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
|
||||
[assembly: AssemblyFileVersion ("4.0.0.0")]
|
||||
@@ -21,27 +21,55 @@
|
||||
//
|
||||
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Aes))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.AesManaged))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.AsymmetricKeyExchangeDeformatter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.AsymmetricKeyExchangeFormatter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.AsymmetricSignatureDeformatter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.AsymmetricSignatureFormatter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CryptoConfig))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.DeriveBytes))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.DES))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.DSA))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.DSAParameters))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.DSASignatureDeformatter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.DSASignatureFormatter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ECCurve))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ECDiffieHellmanPublicKey))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ECDsa))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ECParameters))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ECPoint))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.HMACMD5))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.HMACSHA1))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.HMACSHA256))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.HMACSHA384))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.HMACSHA512))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.MaskGenerationMethod))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.MD5))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.PKCS1MaskGenerationMethod))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RandomNumberGenerator))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RC2))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Rfc2898DeriveBytes))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Rijndael))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RijndaelManaged))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSA))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSAEncryptionPadding))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSAEncryptionPaddingMode))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSAOAEPKeyExchangeDeformatter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSAOAEPKeyExchangeFormatter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSAParameters))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSAPKCS1KeyExchangeFormatter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSAPKCS1SignatureDeformatter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSAPKCS1SignatureFormatter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSASignaturePadding))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSASignaturePaddingMode))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SHA1))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SHA1Managed))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SHA256))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SHA256Managed))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SHA384))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SHA384Managed))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SHA512))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SHA512Managed))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SignatureDescription))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.TripleDES))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ECCurve))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ECParameters))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ECPoint))]
|
||||
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
|
||||
[assembly: AssemblyCompany ("Xamarin, Inc.")]
|
||||
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
|
||||
[assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
|
||||
[assembly: AssemblyVersion ("4.0.0.0")]
|
||||
[assembly: AssemblyVersion ("4.1.1.0")]
|
||||
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
|
||||
[assembly: AssemblyFileVersion ("4.0.0.0")]
|
||||
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
|
||||
[assembly: AssemblyCompany ("Xamarin, Inc.")]
|
||||
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
|
||||
[assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
|
||||
[assembly: AssemblyVersion ("4.0.1.0")]
|
||||
[assembly: AssemblyVersion ("4.1.1.0")]
|
||||
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
|
||||
[assembly: AssemblyFileVersion ("4.0.0.0")]
|
||||
@@ -22,5 +22,6 @@
|
||||
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.IOCompletionCallback))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.NativeOverlapped))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Overlapped))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.PreAllocatedOverlapped))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.ThreadPoolBoundHandle))]
|
||||
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
|
||||
[assembly: AssemblyCompany ("Xamarin, Inc.")]
|
||||
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
|
||||
[assembly: AssemblyCopyright ("Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)")]
|
||||
[assembly: AssemblyVersion ("4.0.1.0")]
|
||||
[assembly: AssemblyVersion ("4.0.3.0")]
|
||||
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
|
||||
[assembly: AssemblyFileVersion ("4.0.0.0")]
|
||||
@@ -30,7 +30,7 @@ using System.Runtime.CompilerServices;
|
||||
[assembly: AssemblyCompany ("Xamarin, Inc.")]
|
||||
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
|
||||
[assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
|
||||
[assembly: AssemblyVersion ("4.0.1.0")]
|
||||
[assembly: AssemblyVersion ("4.1.1.0")]
|
||||
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
|
||||
[assembly: AssemblyFileVersion ("4.0.0.0")]
|
||||
|
||||
+1
-25
@@ -1,25 +1 @@
|
||||
The MIT X11 License covers most of the class libraries in the Mono
|
||||
project. Some third party libraries come from different projects, and
|
||||
are licensed under their own terms.
|
||||
|
||||
|
||||
Copyright (c) 2001, 2002, 2003 The Mono Project
|
||||
|
||||
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.
|
||||
See LICENSE file in the project root for full license information.
|
||||
+25
-8
@@ -381,8 +381,7 @@ DISTFILES = \
|
||||
MicrosoftAjaxLibrary/License.htm \
|
||||
test-helpers/NetworkHelpers.cs \
|
||||
test-helpers/SocketResponder.cs \
|
||||
lib/$(monolite_dir)/mcs.exe \
|
||||
$(monolite_files)
|
||||
$(foreach HOST_PLATFORM,darwin linux win32,lib/$(monolite_dir)/mcs.exe $(monolite_files))
|
||||
|
||||
.PHONY: all-local $(STD_TARGETS:=-local)
|
||||
all-local $(STD_TARGETS:=-local):
|
||||
@@ -390,7 +389,7 @@ all-local $(STD_TARGETS:=-local):
|
||||
|
||||
all-local-aot:
|
||||
|
||||
monolite_dir := monolite/$(MONO_CORLIB_VERSION)
|
||||
monolite_dir = monolite-$(HOST_PLATFORM)/$(MONO_CORLIB_VERSION)
|
||||
|
||||
# Files needed to bootstrap C# compiler
|
||||
build_files = mscorlib.dll System.dll System.Xml.dll Mono.Security.dll System.Core.dll System.Security.dll System.Configuration.dll \
|
||||
@@ -413,24 +412,42 @@ lib/$(monolite_dir)/Facades:
|
||||
|
||||
$(monolite_files): | lib/$(monolite_dir)
|
||||
$(monolite_files): | lib/$(monolite_dir)/Facades
|
||||
$(monolite_files): lib/$(monolite_dir)/%: lib/build/%
|
||||
$(monolite_files): lib/$(monolite_dir)/%: lib/build-$(HOST_PLATFORM)/%
|
||||
cp -p $< $@
|
||||
|
||||
lib/$(monolite_dir)/mcs.exe:
|
||||
$(MAKE) -C ../mcs PROFILE=build
|
||||
cp -p lib/build/mcs.exe lib/$(monolite_dir)
|
||||
cp -p lib/build-$(HOST_PLATFORM)/mcs.exe lib/$(monolite_dir)
|
||||
|
||||
$(build_files:%=lib/build/%):
|
||||
$(build_files:%=lib/build-$(HOST_PLATFORM)/%):
|
||||
cd $(topdir) && $(MAKE) profile-do--build--all NO_DIR_CHECK=1 SKIP_AOT=1
|
||||
|
||||
dist-monolite: $(monolite_files) lib/$(monolite_dir)/mcs.exe
|
||||
|
||||
dist-monolite-all-platforms:
|
||||
$(MAKE) dist-monolite HOST_PLATFORM=darwin
|
||||
$(MAKE) dist-monolite HOST_PLATFORM=linux
|
||||
$(MAKE) dist-monolite HOST_PLATFORM=win32
|
||||
|
||||
package-monolite-latest:
|
||||
MONOLITE=monolite-$(MONO_CORLIB_VERSION)-latest; \
|
||||
MONOLITE=monolite-$(HOST_PLATFORM)-$(MONO_CORLIB_VERSION)-latest; \
|
||||
$(MAKE) dist-monolite monolite_dir=$$MONOLITE; \
|
||||
tar zcvpf $$MONOLITE.tar.gz --directory=lib $$MONOLITE/
|
||||
|
||||
dist-default: dist-monolite
|
||||
package-monolite-latest-all-platforms:
|
||||
$(MAKE) package-monolite-latest HOST_PLATFORM=darwin
|
||||
$(MAKE) package-monolite-latest HOST_PLATFORM=linux
|
||||
$(MAKE) package-monolite-latest HOST_PLATFORM=win32
|
||||
|
||||
monolite_url = https://download.mono-project.com/monolite/monolite-$(BUILD_PLATFORM)-$(MONO_CORLIB_VERSION)-latest.tar.gz
|
||||
|
||||
get-monolite-latest:
|
||||
-rm -fr lib/monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)
|
||||
-mkdir -p lib/monolite-$(BUILD_PLATFORM)
|
||||
cd lib && { (wget -O- $(monolite_url) || curl -L $(monolite_url)) | gzip -d | tar xf - ; }
|
||||
cd lib && mv -f monolite-$(BUILD_PLATFORM)-$(MONO_CORLIB_VERSION)-latest monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)
|
||||
|
||||
dist-default: dist-monolite-all-platforms
|
||||
|
||||
dist-local: dist-default
|
||||
|
||||
|
||||
@@ -58,9 +58,6 @@ corefx/SR.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Conversions.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/COperators.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Declarations/AggregateDeclaration.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Declarations/Declaration.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Declarations/GlobalAttributeDeclaration.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Declarations/NamespaceDeclaration.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ExplicitConversion.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ExpressionBinder.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ExpressionKind.cs
|
||||
@@ -91,7 +88,6 @@ corefx/SR.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/EventSymbol.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/FieldSymbol.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/IndexerSymbol.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/LabelSymbol.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/LocalVariableSymbol.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/MethodOrPropertySymbol.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/MethodSymbol.cs
|
||||
@@ -109,13 +105,11 @@ corefx/SR.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/SymbolTable.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/SymFactory.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/SymFactoryBase.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/TransparentIdentifierMemberSymbol.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/TypeParameterSymbol.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/UnresolvedAggregateSymbol.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/VariableSymbol.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ArrayIndex.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ArrayInitialization.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ArrayLength.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Assignment.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/BinaryOperator.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Block.cs
|
||||
@@ -125,7 +119,6 @@ corefx/SR.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Class.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/CompoundOperator.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Concatenate.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ConditionalOperator.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Constant.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Event.cs
|
||||
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/EXPR.cs
|
||||
|
||||
@@ -228,7 +228,7 @@ namespace MonoTests.Mono.Options
|
||||
e.Run = (args) => e.CommandSet.Out.WriteLine (string.Join (" ", args));
|
||||
|
||||
var o = new StringWriter ();
|
||||
var c = new CommandSet ("set", output:o) {
|
||||
var c = new CommandSet ("set", output:o, error: Console.Error) {
|
||||
e,
|
||||
};
|
||||
Assert.AreEqual (0, c.Run (new [] { "help", "echo" }));
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace MonoTests.Mono.Options
|
||||
c, v => { string ignore = v.OptionValues [0]; });
|
||||
c.Option = p [0];
|
||||
Utils.AssertException (typeof(ArgumentOutOfRangeException),
|
||||
"Specified argument was out of the range of valid values.\nParameter name: index",
|
||||
$"Specified argument was out of the range of valid values.{Environment.NewLine}Parameter name: index",
|
||||
c, v => { string ignore = v.OptionValues [2]; });
|
||||
c.OptionName = "-a";
|
||||
Utils.AssertException (typeof(OptionException),
|
||||
|
||||
@@ -374,10 +374,10 @@ namespace MonoTests.Mono.Options
|
||||
p, v => { v.Parse (_("-a", "-b")); });
|
||||
Assert.AreEqual (a, "-b");
|
||||
Utils.AssertException (typeof(ArgumentNullException),
|
||||
"Value cannot be null.\nParameter name: option",
|
||||
$"Value cannot be null.{Environment.NewLine}Parameter name: option",
|
||||
p, v => { v.Add ((Option) null); });
|
||||
Utils.AssertException (typeof(ArgumentNullException),
|
||||
"Value cannot be null.\nParameter name: header",
|
||||
$"Value cannot be null.{Environment.NewLine}Parameter name: header",
|
||||
p, v => { v.Add ((string) null); });
|
||||
|
||||
// bad type
|
||||
@@ -394,10 +394,10 @@ namespace MonoTests.Mono.Options
|
||||
p, v => { v.Parse (_("-cz", "extra")); });
|
||||
|
||||
Utils.AssertException (typeof(ArgumentNullException),
|
||||
"Value cannot be null.\nParameter name: action",
|
||||
$"Value cannot be null.{Environment.NewLine}Parameter name: action",
|
||||
p, v => { v.Add ("foo", (Action<string>) null); });
|
||||
Utils.AssertException (typeof(ArgumentException),
|
||||
"Cannot provide maxValueCount of 2 for OptionValueType.None.\nParameter name: maxValueCount",
|
||||
$"Cannot provide maxValueCount of 2 for OptionValueType.None.{Environment.NewLine}Parameter name: maxValueCount",
|
||||
p, v => { v.Add ("foo", (k, val) => {/* ignore */}); });
|
||||
}
|
||||
|
||||
@@ -772,7 +772,7 @@ namespace MonoTests.Mono.Options
|
||||
Utils.AssertException (typeof(ArgumentException), "prototypes must be null!",
|
||||
p, v => { v.Add ("N|NUM=", (int n) => {}); });
|
||||
Utils.AssertException (typeof(ArgumentNullException),
|
||||
"Value cannot be null.\nParameter name: option",
|
||||
$"Value cannot be null.{Environment.NewLine}Parameter name: option",
|
||||
p, v => { v.GetOptionForName (null); });
|
||||
}
|
||||
|
||||
|
||||
@@ -66,60 +66,60 @@ namespace MonoTests.Mono.Options
|
||||
{
|
||||
object p = null;
|
||||
Utils.AssertException (typeof(ArgumentNullException),
|
||||
"Value cannot be null.\nParameter name: prototype",
|
||||
$"Value cannot be null.{Environment.NewLine}Parameter name: prototype",
|
||||
p, v => { new DefaultOption (null, null); });
|
||||
Utils.AssertException (typeof(ArgumentException),
|
||||
"Cannot be the empty string.\nParameter name: prototype",
|
||||
$"Cannot be the empty string.{Environment.NewLine}Parameter name: prototype",
|
||||
p, v => { new DefaultOption ("", null); });
|
||||
Utils.AssertException (typeof(ArgumentException),
|
||||
"Empty option names are not supported.\nParameter name: prototype",
|
||||
$"Empty option names are not supported.{Environment.NewLine}Parameter name: prototype",
|
||||
p, v => { new DefaultOption ("a|b||c=", null); });
|
||||
Utils.AssertException (typeof(ArgumentException),
|
||||
"Conflicting option types: '=' vs. ':'.\nParameter name: prototype",
|
||||
$"Conflicting option types: '=' vs. ':'.{Environment.NewLine}Parameter name: prototype",
|
||||
p, v => { new DefaultOption ("a=|b:", null); });
|
||||
Utils.AssertException (typeof(ArgumentException),
|
||||
"The default option handler '<>' cannot require values.\nParameter name: prototype",
|
||||
$"The default option handler '<>' cannot require values.{Environment.NewLine}Parameter name: prototype",
|
||||
p, v => { new DefaultOption ("<>=", null); });
|
||||
Utils.AssertException (typeof(ArgumentException),
|
||||
"The default option handler '<>' cannot require values.\nParameter name: prototype",
|
||||
$"The default option handler '<>' cannot require values.{Environment.NewLine}Parameter name: prototype",
|
||||
p, v => { new DefaultOption ("<>:", null); });
|
||||
Utils.AssertException (null, null,
|
||||
p, v => { new DefaultOption ("t|<>=", null, 1); });
|
||||
Utils.AssertException (typeof(ArgumentException),
|
||||
"The default option handler '<>' cannot require values.\nParameter name: prototype",
|
||||
$"The default option handler '<>' cannot require values.{Environment.NewLine}Parameter name: prototype",
|
||||
p, v => { new DefaultOption ("t|<>=", null, 2); });
|
||||
Utils.AssertException (null, null,
|
||||
p, v => { new DefaultOption ("a|b=", null, 2); });
|
||||
Utils.AssertException (typeof(ArgumentOutOfRangeException),
|
||||
"Specified argument was out of the range of valid values.\nParameter name: maxValueCount",
|
||||
$"Specified argument was out of the range of valid values.{Environment.NewLine}Parameter name: maxValueCount",
|
||||
p, v => { new DefaultOption ("a", null, -1); });
|
||||
Utils.AssertException (typeof(ArgumentException),
|
||||
"Cannot provide maxValueCount of 0 for OptionValueType.Required or " +
|
||||
"OptionValueType.Optional.\nParameter name: maxValueCount",
|
||||
$"OptionValueType.Optional.{Environment.NewLine}Parameter name: maxValueCount",
|
||||
p, v => { new DefaultOption ("a=", null, 0); });
|
||||
Utils.AssertException (typeof(ArgumentException),
|
||||
"Ill-formed name/value separator found in \"a={\".\nParameter name: prototype",
|
||||
"Ill-formed name/value separator found in \"a={\"." + Environment.NewLine + "Parameter name: prototype",
|
||||
p, v => { new DefaultOption ("a={", null); });
|
||||
Utils.AssertException (typeof(ArgumentException),
|
||||
"Ill-formed name/value separator found in \"a=}\".\nParameter name: prototype",
|
||||
"Ill-formed name/value separator found in \"a=}\"." + Environment.NewLine + "Parameter name: prototype",
|
||||
p, v => { new DefaultOption ("a=}", null); });
|
||||
Utils.AssertException (typeof(ArgumentException),
|
||||
"Ill-formed name/value separator found in \"a={{}}\".\nParameter name: prototype",
|
||||
"Ill-formed name/value separator found in \"a={{}}\"." + Environment.NewLine + "Parameter name: prototype",
|
||||
p, v => { new DefaultOption ("a={{}}", null); });
|
||||
Utils.AssertException (typeof(ArgumentException),
|
||||
"Ill-formed name/value separator found in \"a={}}\".\nParameter name: prototype",
|
||||
"Ill-formed name/value separator found in \"a={}}\"." + Environment.NewLine + "Parameter name: prototype",
|
||||
p, v => { new DefaultOption ("a={}}", null); });
|
||||
Utils.AssertException (typeof(ArgumentException),
|
||||
"Ill-formed name/value separator found in \"a={}{\".\nParameter name: prototype",
|
||||
"Ill-formed name/value separator found in \"a={}{\"." + Environment.NewLine + "Parameter name: prototype",
|
||||
p, v => { new DefaultOption ("a={}{", null); });
|
||||
Utils.AssertException (typeof(ArgumentException),
|
||||
"Cannot provide key/value separators for Options taking 1 value(s).\nParameter name: prototype",
|
||||
$"Cannot provide key/value separators for Options taking 1 value(s).{Environment.NewLine}Parameter name: prototype",
|
||||
p, v => { new DefaultOption ("a==", null); });
|
||||
Utils.AssertException (typeof(ArgumentException),
|
||||
"Cannot provide key/value separators for Options taking 1 value(s).\nParameter name: prototype",
|
||||
$"Cannot provide key/value separators for Options taking 1 value(s).{Environment.NewLine}Parameter name: prototype",
|
||||
p, v => { new DefaultOption ("a={}", null); });
|
||||
Utils.AssertException (typeof(ArgumentException),
|
||||
"Cannot provide key/value separators for Options taking 1 value(s).\nParameter name: prototype",
|
||||
$"Cannot provide key/value separators for Options taking 1 value(s).{Environment.NewLine}Parameter name: prototype",
|
||||
p, v => { new DefaultOption ("a=+-*/", null); });
|
||||
Utils.AssertException (null, null,
|
||||
p, v => { new DefaultOption ("a", null, 0); });
|
||||
|
||||
@@ -34,9 +34,16 @@ using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Permissions;
|
||||
|
||||
[assembly: AssemblyVersion (Consts.FxVersion)]
|
||||
|
||||
|
||||
#if MONO_POSIX_NETSTANDARD_BUILD
|
||||
[assembly: AssemblyVersion ("1.0.0.0")]
|
||||
[assembly: AssemblyTitle("Mono.Posix.NETStandard.dll")]
|
||||
#else
|
||||
[assembly: AssemblyVersion (Consts.FxVersion)]
|
||||
[assembly: AssemblyTitle("Mono.Posix.dll")]
|
||||
#endif
|
||||
|
||||
[assembly: AssemblyDescription("Unix Integration Classes")]
|
||||
|
||||
[assembly: CLSCompliant (true)]
|
||||
@@ -48,9 +55,11 @@ using System.Security.Permissions;
|
||||
|
||||
*/
|
||||
|
||||
#if !MONO_POSIX_NETSTANDARD_BUILD
|
||||
// We are using ../Open.snk for MONO_POSIX_NETSTANDARD_BUILD
|
||||
[assembly: AssemblyDelaySign (true)]
|
||||
[assembly: AssemblyKeyFile ("../mono.pub")]
|
||||
|
||||
#endif
|
||||
/*
|
||||
* TODO:
|
||||
*
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<AssemblyName>Mono.Posix.NETStandard</AssemblyName>
|
||||
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
|
||||
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
|
||||
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
|
||||
<EnableDefaultItems>false</EnableDefaultItems>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<DelaySign>true</DelaySign>
|
||||
<AssemblyOriginatorKeyFile>..\Open.snk</AssemblyOriginatorKeyFile>
|
||||
<!--<BaseIntermediateOutputPath>obj-netstandard2.0</BaseIntermediateOutputPath>
|
||||
<IntermediateOutputPath>obj-netstandard2.0</IntermediateOutputPath>-->
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<DefineConstants>$(DefineConstants);MONO_POSIX_NETSTANDARD_BUILD</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(ForceUseLibC)' == 'true'">
|
||||
<DefineConstants>$(DefineConstants);FORCE_USE_LIBC_NOT_MSVC</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include=".\Assembly\**\*.cs" />
|
||||
<Compile Include=".\Mono.Posix\**\*.cs" />
|
||||
<Compile Include=".\Mono.Unix\**\*.cs" />
|
||||
<Compile Include=".\Mono.Unix.Native\**\*.cs" />
|
||||
<Compile Include="..\..\build\common\Locale.cs" />
|
||||
<Compile Remove=".\Mono.Unix.Native\CdeclFunction.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -309,6 +309,7 @@ namespace Mono.Unix.Native {
|
||||
public delegate void SignalHandler (int signal);
|
||||
|
||||
|
||||
#if !NETSTANDARD2_0
|
||||
internal class XPrintfFunctions
|
||||
{
|
||||
internal delegate object XPrintf (object[] parameters);
|
||||
@@ -335,6 +336,7 @@ namespace Mono.Unix.Native {
|
||||
syslog = new XPrintf (_syslog.Invoke);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// Convention: Functions that are part of the C standard library go here.
|
||||
@@ -378,7 +380,11 @@ namespace Mono.Unix.Native {
|
||||
//
|
||||
public class Stdlib
|
||||
{
|
||||
#if FORCE_USE_LIBC_NOT_MSVC
|
||||
internal const string LIBC = "c";
|
||||
#else
|
||||
internal const string LIBC = "msvcrt";
|
||||
#endif
|
||||
internal const string MPH = "MonoPosixHelper";
|
||||
|
||||
// It is possible for Mono.Posix and MonoPosixHelper to get out of sync,
|
||||
@@ -771,6 +777,7 @@ namespace Mono.Unix.Native {
|
||||
return sys_fprintf (stream, "%s", message);
|
||||
}
|
||||
|
||||
#if !NETSTANDARD2_0
|
||||
[Obsolete ("Not necessarily portable due to cdecl restrictions.\n" +
|
||||
"Use fprintf (IntPtr, string) instead.")]
|
||||
public static int fprintf (IntPtr stream, string format, params object[] parameters)
|
||||
@@ -781,6 +788,7 @@ namespace Mono.Unix.Native {
|
||||
Array.Copy (parameters, 0, _parameters, 2, parameters.Length);
|
||||
return (int) XPrintfFunctions.fprintf (_parameters);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* SKIP: fscanf(3) */
|
||||
|
||||
@@ -793,6 +801,7 @@ namespace Mono.Unix.Native {
|
||||
return sys_printf ("%s", message);
|
||||
}
|
||||
|
||||
#if !NETSTANDARD2_0
|
||||
[Obsolete ("Not necessarily portable due to cdecl restrictions.\n" +
|
||||
"Use printf (string) instead.")]
|
||||
public static int printf (string format, params object[] parameters)
|
||||
@@ -802,6 +811,7 @@ namespace Mono.Unix.Native {
|
||||
Array.Copy (parameters, 0, _parameters, 1, parameters.Length);
|
||||
return (int) XPrintfFunctions.printf (_parameters);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* SKIP: scanf(3) */
|
||||
|
||||
@@ -823,6 +833,7 @@ namespace Mono.Unix.Native {
|
||||
return sys_snprintf (s, (ulong) s.Capacity, "%s", message);
|
||||
}
|
||||
|
||||
#if !NETSTANDARD2_0
|
||||
[CLSCompliant (false)]
|
||||
[Obsolete ("Not necessarily portable due to cdecl restrictions.\n" +
|
||||
"Use snprintf (StringBuilder, string) instead.")]
|
||||
@@ -853,6 +864,7 @@ namespace Mono.Unix.Native {
|
||||
Array.Copy (parameters, 0, _parameters, 3, parameters.Length);
|
||||
return (int) XPrintfFunctions.snprintf (_parameters);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* SKIP:
|
||||
|
||||
@@ -4387,6 +4387,7 @@ namespace Mono.Unix.Native {
|
||||
return UnixMarshal.EscapeFormatString (message, new char[]{'m'});
|
||||
}
|
||||
|
||||
#if !NETSTANDARD2_0
|
||||
[Obsolete ("Not necessarily portable due to cdecl restrictions.\n" +
|
||||
"Use syslog(SyslogFacility, SyslogLevel, string) instead.")]
|
||||
public static int syslog (SyslogFacility facility, SyslogLevel level,
|
||||
@@ -4415,6 +4416,7 @@ namespace Mono.Unix.Native {
|
||||
Array.Copy (parameters, 0, _parameters, 2, parameters.Length);
|
||||
return (int) XPrintfFunctions.syslog (_parameters);
|
||||
}
|
||||
#endif
|
||||
|
||||
[DllImport (MPH, SetLastError=true,
|
||||
EntryPoint="Mono_Posix_Syscall_closelog")]
|
||||
|
||||
@@ -300,17 +300,35 @@ public class UnixEncoding : Encoding
|
||||
throw new ArgumentOutOfRangeException ("byteIndex", _("ArgRange_Array"));
|
||||
}
|
||||
|
||||
unsafe {
|
||||
fixed (char* p = s) {
|
||||
fixed (byte* b = bytes) {
|
||||
return GetBytes (p + charIndex, charCount, b + byteIndex, bytes.Length - byteIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe override int GetBytes(char* chars, int charCount, byte* bytes, int byteCount)
|
||||
{
|
||||
if (bytes == null || chars == null)
|
||||
throw new ArgumentNullException (bytes == null ? "bytes" : "chars");
|
||||
|
||||
if (charCount < 0 || byteCount < 0)
|
||||
throw new ArgumentOutOfRangeException (charCount < 0 ? "charCount" : "byteCount");
|
||||
|
||||
// Convert the characters into bytes.
|
||||
char ch;
|
||||
int length = bytes.Length;
|
||||
int length = byteCount;
|
||||
uint pair;
|
||||
int posn = byteIndex;
|
||||
int posn = 0;
|
||||
int charIndex = 0;
|
||||
while (charCount > 0) {
|
||||
// Fetch the next UTF-16 character pair value.
|
||||
ch = s[charIndex++];
|
||||
ch = chars [charIndex++];
|
||||
if (ch >= '\uD800' && ch <= '\uDBFF' && charCount > 1) {
|
||||
// This may be the start of a surrogate pair.
|
||||
pair = (uint)(s[charIndex]);
|
||||
pair = (uint)(chars[charIndex]);
|
||||
if (pair >= (uint)0xDC00 && pair <= (uint)0xDFFF) {
|
||||
pair = (pair - (uint)0xDC00) +
|
||||
((((uint)ch) - (uint)0xD800) << 10) +
|
||||
@@ -326,7 +344,7 @@ public class UnixEncoding : Encoding
|
||||
}
|
||||
charCount -= 2;
|
||||
if (charCount >= 0) {
|
||||
bytes[posn++] = (byte) s [charIndex++];
|
||||
bytes[posn++] = (byte)chars [charIndex++];
|
||||
}
|
||||
continue;
|
||||
} else {
|
||||
@@ -365,7 +383,7 @@ public class UnixEncoding : Encoding
|
||||
}
|
||||
|
||||
// Return the final count to the caller.
|
||||
return posn - byteIndex;
|
||||
return posn;
|
||||
}
|
||||
|
||||
// Internal version of "GetCharCount" which can handle a rolling
|
||||
@@ -394,7 +412,7 @@ public class UnixEncoding : Encoding
|
||||
uint leftSoFar = (leftOverCount & (uint)0x0F);
|
||||
uint leftSize = ((leftOverCount >> 4) & (uint)0x0F);
|
||||
while (count > 0) {
|
||||
ch = (uint)(bytes[index++]);
|
||||
ch = (uint)(bytes [index++]);
|
||||
++next_raw;
|
||||
--count;
|
||||
if (leftSize == 0) {
|
||||
|
||||
@@ -325,27 +325,42 @@ namespace Mono.Unix {
|
||||
if (encoding == null)
|
||||
throw new ArgumentNullException ("encoding");
|
||||
|
||||
int min_byte_count = encoding.GetMaxByteCount(1);
|
||||
char[] copy = s.ToCharArray (index, count);
|
||||
byte[] marshal = new byte [encoding.GetByteCount (copy) + min_byte_count];
|
||||
if (index < 0 || count < 0)
|
||||
throw new ArgumentOutOfRangeException ((index < 0 ? "index" : "count"),
|
||||
"Non - negative number required.");
|
||||
|
||||
int bytes_copied = encoding.GetBytes (copy, 0, copy.Length, marshal, 0);
|
||||
if (s.Length - index < count)
|
||||
throw new ArgumentOutOfRangeException ("s", "Index and count must refer to a location within the string.");
|
||||
|
||||
if (bytes_copied != (marshal.Length-min_byte_count))
|
||||
throw new NotSupportedException ("encoding.GetBytes() doesn't equal encoding.GetByteCount()!");
|
||||
int null_terminator_count = encoding.GetMaxByteCount (1);
|
||||
int length_without_null = encoding.GetByteCount (s);
|
||||
int marshalLength = checked (length_without_null + null_terminator_count);
|
||||
|
||||
IntPtr mem = AllocHeap (marshal.Length);
|
||||
IntPtr mem = AllocHeap (marshalLength);
|
||||
if (mem == IntPtr.Zero)
|
||||
throw new UnixIOException (Native.Errno.ENOMEM);
|
||||
|
||||
bool copied = false;
|
||||
try {
|
||||
Marshal.Copy (marshal, 0, mem, marshal.Length);
|
||||
copied = true;
|
||||
}
|
||||
finally {
|
||||
if (!copied)
|
||||
FreeHeap (mem);
|
||||
unsafe {
|
||||
fixed (char* p = s) {
|
||||
byte* marshal = (byte*)mem;
|
||||
int bytes_copied;
|
||||
|
||||
try {
|
||||
bytes_copied = encoding.GetBytes (p + index, count, marshal, marshalLength);
|
||||
} catch {
|
||||
FreeHeap (mem);
|
||||
throw;
|
||||
}
|
||||
|
||||
if (bytes_copied != length_without_null) {
|
||||
FreeHeap (mem);
|
||||
throw new NotSupportedException ("encoding.GetBytes() doesn't equal encoding.GetByteCount()!");
|
||||
}
|
||||
|
||||
marshal += length_without_null;
|
||||
for (int i = 0; i < null_terminator_count; ++i)
|
||||
marshal[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return mem;
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace MonoTests.Mono.Unix.Native {
|
||||
Assert.IsFalse (NativeConvert.ToSignum (st.signalReceived) == Signum.SIGURG,
|
||||
"#IH: Signal Handler invoked when it should have been removed!");
|
||||
}
|
||||
|
||||
#if !NETCOREAPP2_0
|
||||
[Test]
|
||||
// MSVCRT.DLL doesn't export snprintf(3).
|
||||
[Category ("NotDotNet")]
|
||||
@@ -92,6 +92,7 @@ namespace MonoTests.Mono.Unix.Native {
|
||||
Assert.AreEqual (s.ToString(), expected,
|
||||
"#SNPF: printf of many builtin types failed");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,6 +86,8 @@ namespace Mono.Security.Interface
|
||||
|
||||
void EndWrite (IAsyncResult asyncResult);
|
||||
|
||||
Task ShutdownAsync ();
|
||||
|
||||
TransportContext TransportContext {
|
||||
get;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ Mono.Security.Cryptography/PKCS8Test.cs
|
||||
Mono.Security.Cryptography/RSAManagedTest.cs
|
||||
Mono.Security.Cryptography/SHA224ManagedTest.cs
|
||||
Mono.Security.Cryptography/SHA224Test.cs
|
||||
Mono.Security.Interface/TestProvider.cs
|
||||
Mono.Security.Protocol.Ntlm/ChallengeResponseTest.cs
|
||||
Mono.Security.Protocol.Ntlm/MessageBaseTest.cs
|
||||
Mono.Security.Protocol.Ntlm/Type1MessageTest.cs
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// TestProvider.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// Copyright (c) 2017 Xamarin, Inc.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
using Mono.Security;
|
||||
using Mono.Security.Interface;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace MonoTests.Mono.Security
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestProvider
|
||||
{
|
||||
[Test]
|
||||
public void GetProvider ()
|
||||
{
|
||||
var provider = MonoTlsProviderFactory.GetProvider ();
|
||||
Assert.IsNotNull (provider, "TLS Provider");
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-257
@@ -35,15 +35,6 @@ testing.
|
||||
of comments in the source code for that purpose, and if the
|
||||
problem requires to be followed up on, file a bug.
|
||||
|
||||
* Supporting .NET 1.2, .NET 1.1 and .NET 1.0 builds
|
||||
|
||||
The defines NET_1_1 and NET_2_0 are used to include
|
||||
features. When NET_2_0 is defined, it also implies that the
|
||||
NET_1_1 is defined.
|
||||
|
||||
To have code which is only available in an old version, use ONLY_1_0,
|
||||
ONLY_1_1
|
||||
|
||||
* Tagging buggy code
|
||||
|
||||
If there is a bug in your implementation tag the problem by using
|
||||
@@ -69,255 +60,8 @@ testing.
|
||||
not only stupid, but leading to unreliable code).
|
||||
|
||||
In those cases, use the keyword "LAMESPEC".
|
||||
|
||||
|
||||
* Coding considerations and style.
|
||||
|
||||
In order to keep the code consistent, please use the following
|
||||
conventions. From here on `good' and `bad' are used to attribute
|
||||
things that would make the coding style match, or not match. It is not
|
||||
a judgement call on your coding abilities, but more of a style and
|
||||
look call. Please try to follow these guidelines to ensure prettiness.
|
||||
|
||||
Use 8 space tabs for writing your code (hopefully we can keep
|
||||
this consistent). If you are modifying someone else's code, try
|
||||
to keep the coding style similar.
|
||||
|
||||
Since we are using 8-space tabs, you might want to consider the Linus
|
||||
Torvals trick to reduce code nesting. Many times in a loop, you will
|
||||
find yourself doing a test, and if the test is true, you will nest.
|
||||
Many times this can be changed. Example:
|
||||
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
if (something (i)) {
|
||||
do_more ();
|
||||
}
|
||||
}
|
||||
|
||||
This take precious space, instead write it like this:
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
if (!something (i))
|
||||
continue;
|
||||
do_more ();
|
||||
}
|
||||
|
||||
A few guidelines:
|
||||
|
||||
* Use a space before an opening parenthesis when calling
|
||||
functions, or indexing, like this:
|
||||
|
||||
method (a);
|
||||
b [10];
|
||||
|
||||
* Do not put a space after the opening parenthesis and the
|
||||
closing one, ie:
|
||||
|
||||
good: method (a); array [10];
|
||||
|
||||
bad: method ( a ); array[ 10 ];
|
||||
|
||||
* Inside a code block, put the opening brace on the same line
|
||||
as the statement:
|
||||
|
||||
good:
|
||||
if (a) {
|
||||
code ();
|
||||
code ();
|
||||
}
|
||||
|
||||
bad:
|
||||
if (a)
|
||||
{
|
||||
code ();
|
||||
code ();
|
||||
}
|
||||
|
||||
* Avoid using unnecessary open/close braces, vertical space
|
||||
is usually limited:
|
||||
|
||||
good:
|
||||
if (a)
|
||||
code ();
|
||||
|
||||
bad:
|
||||
if (a) {
|
||||
code ();
|
||||
}
|
||||
|
||||
* When defining a method, use the C style for brace placement,
|
||||
that means, use a new line for the brace, like this:
|
||||
|
||||
good:
|
||||
void Method ()
|
||||
{
|
||||
}
|
||||
|
||||
bad:
|
||||
void Method () {
|
||||
}
|
||||
|
||||
* Properties and indexers are an exception, keep the
|
||||
brace on the same line as the property declaration.
|
||||
Rationale: this makes it visually
|
||||
simple to distinguish them.
|
||||
|
||||
good:
|
||||
int Property {
|
||||
get {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
bad:
|
||||
int Property
|
||||
{
|
||||
get {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
Notice how the accessor "get" also keeps its brace on the same
|
||||
line.
|
||||
|
||||
For very small properties, you can compress things:
|
||||
|
||||
ok:
|
||||
int Property {
|
||||
get { return value; }
|
||||
set { x = value; }
|
||||
}
|
||||
|
||||
* Use white space in expressions liberally, except in the presence
|
||||
of parenthesis:
|
||||
|
||||
good:
|
||||
|
||||
if (a + 5 > method (blah () + 4))
|
||||
|
||||
bad:
|
||||
if (a+5>method(blah()+4))
|
||||
|
||||
* For any new files, please use a descriptive introduction, like
|
||||
this:
|
||||
|
||||
//
|
||||
// System.Comment.cs: Handles comments in System files.
|
||||
//
|
||||
// Author:
|
||||
// Juan Perez ([email protected])
|
||||
//
|
||||
// (C) 2002 Address, Inc (http://www.address.com)
|
||||
//
|
||||
|
||||
* If you are modyfing someone else's code, and your contribution
|
||||
is significant, please add yourself to the Authors list.
|
||||
|
||||
* Switch statements have the case at the same indentation as the
|
||||
switch:
|
||||
|
||||
switch (x) {
|
||||
case 'a':
|
||||
...
|
||||
case 'b':
|
||||
...
|
||||
}
|
||||
|
||||
* Argument names should use the camel casing for
|
||||
identifiers, like this:
|
||||
|
||||
good:
|
||||
void Method (string myArgument)
|
||||
|
||||
bad:
|
||||
void Method (string lpstrArgument)
|
||||
void Method (string my_string)
|
||||
|
||||
* Empty methods: They should have the body of code using two
|
||||
lines, in consistency with the rest:
|
||||
|
||||
good:
|
||||
void EmptyMethod ()
|
||||
{
|
||||
}
|
||||
|
||||
bad:
|
||||
void EmptyMethod () {}
|
||||
|
||||
void EmptyMethod ()
|
||||
{}
|
||||
|
||||
* Line length: The line length for C# source code is 134 columns.
|
||||
|
||||
|
||||
If your function declaration arguments go beyond
|
||||
this point, please align your arguments to match the
|
||||
opening brace, like this:
|
||||
|
||||
void Function (int arg, string argb,
|
||||
int argc)
|
||||
{
|
||||
}
|
||||
|
||||
When invoking functions, the rule is different, the
|
||||
arguments are not aligned with the previous
|
||||
argument, instead they begin at the tabbed position,
|
||||
like this:
|
||||
|
||||
void M ()
|
||||
{
|
||||
MethodCall ("Very long string that will force",
|
||||
"Next argument on the 8-tab pos",
|
||||
"Just like this one")
|
||||
|
||||
}
|
||||
|
||||
Here are a couple of examples:
|
||||
|
||||
class X : Y {
|
||||
|
||||
bool Method (int argument_1, int argument_2)
|
||||
{
|
||||
if (argument_1 == argument_2)
|
||||
throw new Exception (Locale.GetText ("They are equal!");
|
||||
|
||||
if (argument_1 < argument_2) {
|
||||
if (argument_1 * 3 > 4)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// This sample helps keep your sanity while using 8-spaces for tabs
|
||||
//
|
||||
VeryLongIdentifierWhichTakesManyArguments (
|
||||
Argument1, Argument2, Argument3,
|
||||
NestedCallHere (
|
||||
MoreNested));
|
||||
}
|
||||
|
||||
bool MyProperty {
|
||||
get {
|
||||
return x;
|
||||
}
|
||||
|
||||
set {
|
||||
x = value;
|
||||
}
|
||||
}
|
||||
|
||||
void AnotherMethod ()
|
||||
{
|
||||
if ((a + 5) != 4) {
|
||||
}
|
||||
|
||||
while (blah) {
|
||||
if (a)
|
||||
continue;
|
||||
b++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
conventions: http://www.mono-project.com/community/contributing/coding-guidelines/
|
||||
@@ -310,19 +310,20 @@ namespace System.IO.MemoryMappedFiles
|
||||
[MonoLimitation ("Named mappings scope is process local")]
|
||||
public static MemoryMappedFile OpenExisting (string mapName)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
return OpenExisting (mapName, MemoryMappedFileRights.ReadWrite);
|
||||
}
|
||||
|
||||
[MonoLimitation ("Named mappings scope is process local")]
|
||||
public static MemoryMappedFile OpenExisting (string mapName, MemoryMappedFileRights desiredAccessRights)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
return OpenExisting (mapName, desiredAccessRights, HandleInheritability.None);
|
||||
}
|
||||
|
||||
[MonoLimitation ("Named mappings scope is process local")]
|
||||
public static MemoryMappedFile OpenExisting (string mapName, MemoryMappedFileRights desiredAccessRights, HandleInheritability inheritability)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
// FIXME: Actually use desiredAccessRights
|
||||
return CoreShmCreate (mapName, 0, MemoryMappedFileAccess.ReadWrite, MemoryMappedFileOptions.None, null, inheritability, FileMode.Open);
|
||||
}
|
||||
|
||||
public MemoryMappedViewStream CreateViewStream ()
|
||||
@@ -393,10 +394,9 @@ namespace System.IO.MemoryMappedFiles
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public SafeMemoryMappedFileHandle SafeMemoryMappedFileHandle {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
return handle;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -301,9 +301,12 @@ namespace MonoTests.System.IO.MemoryMappedFiles {
|
||||
var name = MkNamedMapping ();
|
||||
using (var m0 = MemoryMappedFile.CreateNew(name, 4096, MemoryMappedFileAccess.ReadWrite)) {
|
||||
using (var m1 = MemoryMappedFile.CreateOrOpen (name, 4096, MemoryMappedFileAccess.ReadWrite)) {
|
||||
using (MemoryMappedViewAccessor v0 = m0.CreateViewAccessor (), v1 = m1.CreateViewAccessor ()) {
|
||||
v0.Write (10, 0x12345);
|
||||
Assert.AreEqual (0x12345, v1.ReadInt32 (10));
|
||||
using (var m2 = MemoryMappedFile.OpenExisting (name)) {
|
||||
using (MemoryMappedViewAccessor v0 = m0.CreateViewAccessor (), v1 = m1.CreateViewAccessor (), v2 = m2.CreateViewAccessor ()) {
|
||||
v0.Write (10, 0x12345);
|
||||
Assert.AreEqual (0x12345, v1.ReadInt32 (10));
|
||||
Assert.AreEqual (0x12345, v2.ReadInt32 (10));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -466,5 +469,13 @@ namespace MonoTests.System.IO.MemoryMappedFiles {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void OpenExistingWithNoExistingThrows()
|
||||
{
|
||||
Assert.Throws<FileNotFoundException>(() => {
|
||||
MemoryMappedFile.OpenExisting (MkNamedMapping ());
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -375,8 +375,9 @@ namespace System.Net.Http
|
||||
|
||||
wrequest.ResendContentFactory = content.CopyTo;
|
||||
|
||||
var stream = await wrequest.GetRequestStreamAsync ().ConfigureAwait (false);
|
||||
await request.Content.CopyToAsync (stream).ConfigureAwait (false);
|
||||
using (var stream = await wrequest.GetRequestStreamAsync ().ConfigureAwait (false)) {
|
||||
await request.Content.CopyToAsync (stream).ConfigureAwait (false);
|
||||
}
|
||||
} else if (HttpMethod.Post.Equals (request.Method) || HttpMethod.Put.Equals (request.Method) || HttpMethod.Delete.Equals (request.Method)) {
|
||||
// Explicitly set this to make sure we're sending a "Content-Length: 0" header.
|
||||
// This fixes the issue that's been reported on the forums:
|
||||
|
||||
@@ -6,7 +6,7 @@ LIBRARY = System.Numerics.dll
|
||||
LIB_REFS = System
|
||||
LIB_MCS_FLAGS = /unsafe
|
||||
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
|
||||
XTEST_LIB_REFS = System Facades/System.Threading.Tasks System.Runtime.InteropServices.RuntimeInformation System.Core System.Numerics.Vectors Microsoft.CSharp
|
||||
XTEST_LIB_REFS = System Facades/System.Threading.Tasks Facades/System.Runtime.InteropServices.RuntimeInformation System.Core System.Numerics.Vectors Microsoft.CSharp
|
||||
XTEST_LIB_FLAGS = -unsafe
|
||||
|
||||
RESX_RESOURCE_STRING = \
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
../../../external/corefx/src/Common/tests/System/AssertExtensions.cs
|
||||
../../../external/corefx/src/Common/tests/System/PlatformDetection.cs
|
||||
|
||||
# ../../../external/corefx/src/System.Runtime.Numerics/tests/*.cs
|
||||
|
||||
@@ -58,13 +58,13 @@ namespace MonoTests.System.ServiceProcess
|
||||
static ServiceInfo DISK_DRIVER_SERVICE = new ServiceInfo { ServiceName = "disk", DisplayName = "Disk Driver", ServiceType = ServiceType.KernelDriver };
|
||||
static ServiceInfo ROUTING_AND_REMOTE_ACCESS_SERVICE = new ServiceInfo { ServiceName = "RemoteAccess", DisplayName = "Routing and Remote Access", DependedOn = new [] { "bfe", "http", "rasman", "rpcss" } };
|
||||
static ServiceInfo SECONDARY_LOGON_SERVICE = new ServiceInfo { ServiceName = "seclogon", DisplayName = "Secondary Logon", Dependents = new [] { "te.service" } };
|
||||
static ServiceInfo SECURITY_ACCOUNTS_MANAGER_SERVICE = new ServiceInfo { ServiceName = "SamSs", DisplayName = "Security Accounts Manager", Dependents = new [] { "browser", "ktmrm", "lanmanserver", "msdtc" }, DependedOn = new [] { "rpcss" } };
|
||||
static ServiceInfo SECURITY_ACCOUNTS_MANAGER_SERVICE = new ServiceInfo { ServiceName = "SamSs", DisplayName = "Security Accounts Manager", Dependents = new [] { "ktmrm", "lanmanserver", "msdtc" }, DependedOn = new [] { "rpcss" } };
|
||||
static ServiceInfo COMPLUS_EVENTSYSTEM_SERVICE = new ServiceInfo { ServiceName = "EventSystem", DisplayName = "COM+ Event System", ServiceType = ServiceType.Win32ShareProcess, Dependents = new [] { "comsysapp", "sens" }, DependedOn = new [] { "rpcss" } };
|
||||
static ServiceInfo WINDOWS_IMAGE_ACQUISITION_SERVICE = new ServiceInfo { ServiceName = "stisvc", DisplayName = "Windows Image Acquisition (WIA)", ServiceType = ServiceType.Win32OwnProcess, DependedOn = new [] { "rpcss" } };
|
||||
static ServiceInfo WINDOWS_SEARCH_SERVICE = new ServiceInfo { ServiceName = "WSearch", DisplayName = "Windows Search", ServiceType = ServiceType.Win32OwnProcess, Dependents = new [] { "wmpnetworksvc", "workfolderssvc" }, DependedOn = new [] { "rpcss" } };
|
||||
static ServiceInfo WINDOWS_TIME_SERVICE = new ServiceInfo { ServiceName = "W32Time", DisplayName = "Windows Time" };
|
||||
static ServiceInfo WINDOWS_UPDATE_SERVICE = new ServiceInfo { ServiceName = "wuauserv", DisplayName = "Windows Update", DependedOn = new [] { "rpcss" } };
|
||||
static ServiceInfo WORKSTATION_SERVICE = new ServiceInfo { ServiceName = "LanmanWorkstation", DisplayName = "Workstation", Dependents = new [] { "browser", "netlogon", "sessionenv" }, DependedOn = new [] { "bowser", "mrxsmb20", "nsi" } };
|
||||
static ServiceInfo WORKSTATION_SERVICE = new ServiceInfo { ServiceName = "LanmanWorkstation", DisplayName = "Workstation", Dependents = new [] { "netlogon", "sessionenv" }, DependedOn = new [] { "bowser", "mrxsmb20", "nsi" } };
|
||||
|
||||
// A service which is expected to be disabled by default on all supported Windows versions.
|
||||
static ServiceInfo DISABLED_SERVICE = ROUTING_AND_REMOTE_ACCESS_SERVICE;
|
||||
|
||||
@@ -36,7 +36,11 @@ namespace Mono.AppleTls
|
||||
*/
|
||||
var certificate2 = certificate as X509Certificate2;
|
||||
if (certificate2 != null)
|
||||
#if MONOTOUCH
|
||||
return SecIdentity.Import (certificate2);
|
||||
#else
|
||||
return SecImportExport.ItemImport (certificate2);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Reading Certificates from the Mac Keychain
|
||||
@@ -129,28 +133,28 @@ namespace Mono.AppleTls
|
||||
targetHost = targetHost.Substring (0, pos);
|
||||
}
|
||||
|
||||
var policy = SecPolicy.CreateSslPolicy (!serverMode, targetHost);
|
||||
var trust = new SecTrust (certificates, policy);
|
||||
using (var policy = SecPolicy.CreateSslPolicy (!serverMode, targetHost))
|
||||
using (var trust = new SecTrust (certificates, policy)) {
|
||||
if (validator.Settings.TrustAnchors != null) {
|
||||
var status = trust.SetAnchorCertificates (validator.Settings.TrustAnchors);
|
||||
if (status != SecStatusCode.Success)
|
||||
throw new InvalidOperationException (status.ToString ());
|
||||
trust.SetAnchorCertificatesOnly (false);
|
||||
}
|
||||
|
||||
if (validator.Settings.TrustAnchors != null) {
|
||||
var status = trust.SetAnchorCertificates (validator.Settings.TrustAnchors);
|
||||
if (status != SecStatusCode.Success)
|
||||
throw new InvalidOperationException (status.ToString ());
|
||||
trust.SetAnchorCertificatesOnly (false);
|
||||
if (validator.Settings.CertificateValidationTime != null) {
|
||||
var status = trust.SetVerifyDate (validator.Settings.CertificateValidationTime.Value);
|
||||
if (status != SecStatusCode.Success)
|
||||
throw new InvalidOperationException (status.ToString ());
|
||||
}
|
||||
|
||||
var result = trust.Evaluate ();
|
||||
if (result == SecTrustResult.Unspecified)
|
||||
return true;
|
||||
|
||||
errors |= MonoSslPolicyErrors.RemoteCertificateChainErrors;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (validator.Settings.CertificateValidationTime != null) {
|
||||
var status = trust.SetVerifyDate (validator.Settings.CertificateValidationTime.Value);
|
||||
if (status != SecStatusCode.Success)
|
||||
throw new InvalidOperationException (status.ToString ());
|
||||
}
|
||||
|
||||
var result = trust.Evaluate ();
|
||||
if (result == SecTrustResult.Unspecified)
|
||||
return true;
|
||||
|
||||
errors |= MonoSslPolicyErrors.RemoteCertificateChainErrors;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,32 +235,41 @@ namespace Mono.AppleTls
|
||||
*
|
||||
*/
|
||||
|
||||
var trust = GetPeerTrust (!IsServer);
|
||||
X509CertificateCollection certificates;
|
||||
|
||||
if (trust == null || trust.Count == 0) {
|
||||
remoteCertificate = null;
|
||||
if (!IsServer)
|
||||
throw new TlsException (AlertDescription.CertificateUnknown);
|
||||
certificates = null;
|
||||
} else {
|
||||
if (trust.Count > 1)
|
||||
Debug ("WARNING: Got multiple certificates in SecTrust!");
|
||||
|
||||
certificates = new X509CertificateCollection ();
|
||||
for (int i = 0; i < trust.Count; i++)
|
||||
certificates.Add (trust [(IntPtr)i].ToX509Certificate ());
|
||||
|
||||
remoteCertificate = certificates [0];
|
||||
Debug ("Got peer trust: {0}", remoteCertificate);
|
||||
}
|
||||
|
||||
bool ok;
|
||||
SecTrust trust = null;
|
||||
X509CertificateCollection certificates = null;
|
||||
|
||||
try {
|
||||
trust = GetPeerTrust (!IsServer);
|
||||
|
||||
if (trust == null || trust.Count == 0) {
|
||||
remoteCertificate = null;
|
||||
if (!IsServer)
|
||||
throw new TlsException (AlertDescription.CertificateUnknown);
|
||||
certificates = null;
|
||||
} else {
|
||||
if (trust.Count > 1)
|
||||
Debug ("WARNING: Got multiple certificates in SecTrust!");
|
||||
|
||||
certificates = new X509CertificateCollection ();
|
||||
for (int i = 0; i < trust.Count; i++)
|
||||
certificates.Add (trust.GetCertificate (i));
|
||||
|
||||
remoteCertificate = new X509Certificate (certificates [0]);
|
||||
Debug ("Got peer trust: {0}", remoteCertificate);
|
||||
}
|
||||
|
||||
ok = ValidateCertificate (certificates);
|
||||
} catch (Exception ex) {
|
||||
Debug ("Certificate validation failed: {0}", ex);
|
||||
throw new TlsException (AlertDescription.CertificateUnknown, "Certificate validation threw exception.");
|
||||
} finally {
|
||||
if (trust != null)
|
||||
trust.Dispose ();
|
||||
if (certificates != null) {
|
||||
for (int i = 0; i < certificates.Count; i++)
|
||||
certificates [i].Dispose ();
|
||||
}
|
||||
}
|
||||
|
||||
if (!ok)
|
||||
@@ -665,7 +674,7 @@ namespace Mono.AppleTls
|
||||
if (value == IntPtr.Zero)
|
||||
throw new TlsException (AlertDescription.CertificateUnknown);
|
||||
}
|
||||
return (value == IntPtr.Zero) ? null : new SecTrust (value);
|
||||
return (value == IntPtr.Zero) ? null : new SecTrust (value, true);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -848,12 +857,12 @@ namespace Mono.AppleTls
|
||||
[DllImport (SecurityLibrary)]
|
||||
extern static /* OSStatus */ SslStatus SSLClose (/* SSLContextRef */ IntPtr context);
|
||||
|
||||
public override void Close ()
|
||||
public override void Shutdown ()
|
||||
{
|
||||
if (Interlocked.Exchange (ref pendingIO, 1) == 1)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
Debug ("Close");
|
||||
Debug ("Shutdown");
|
||||
|
||||
lastException = null;
|
||||
|
||||
@@ -862,7 +871,7 @@ namespace Mono.AppleTls
|
||||
return;
|
||||
|
||||
var status = SSLClose (Handle);
|
||||
Debug ("Close done: {0}", status);
|
||||
Debug ("Shutdown done: {0}", status);
|
||||
CheckStatusAndThrow (status);
|
||||
} finally {
|
||||
closed = true;
|
||||
|
||||
@@ -38,12 +38,12 @@ namespace Mono.AppleTls
|
||||
}
|
||||
|
||||
protected override MNS.MobileTlsContext CreateContext (
|
||||
MNS.MobileAuthenticatedStream parent, bool serverMode, string targetHost,
|
||||
SslProtocols enabledProtocols, X509Certificate serverCertificate,
|
||||
X509CertificateCollection clientCertificates, bool askForClientCert)
|
||||
bool serverMode, string targetHost, SslProtocols enabledProtocols,
|
||||
X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
|
||||
bool askForClientCert)
|
||||
{
|
||||
return new AppleTlsContext (
|
||||
parent, serverMode, targetHost,
|
||||
this, serverMode, targetHost,
|
||||
enabledProtocols, serverCertificate,
|
||||
clientCertificates, askForClientCert);
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ namespace Mono.AppleTls {
|
||||
return code;
|
||||
}
|
||||
|
||||
#if !MONOTOUCH
|
||||
[DllImport (AppleTlsContext.SecurityLibrary)]
|
||||
extern static SecStatusCode SecItemImport (
|
||||
/* CFDataRef */ IntPtr importedData,
|
||||
@@ -217,6 +218,7 @@ namespace Mono.AppleTls {
|
||||
IntPtr keyUsage;
|
||||
IntPtr keyAttributes;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -66,6 +66,8 @@ namespace Mono.AppleTls {
|
||||
foreach (var certificate in certificates)
|
||||
array [i++] = new SecCertificate (certificate);
|
||||
Initialize (array, policy);
|
||||
for (i = 0; i < array.Length; i++)
|
||||
array [i].Dispose ();
|
||||
}
|
||||
|
||||
void Initialize (SecCertificate[] array, SecPolicy policy)
|
||||
@@ -122,6 +124,17 @@ namespace Mono.AppleTls {
|
||||
}
|
||||
}
|
||||
|
||||
internal X509Certificate GetCertificate (int index)
|
||||
{
|
||||
if (handle == IntPtr.Zero)
|
||||
throw new ObjectDisposedException ("SecTrust");
|
||||
if (index < 0 || index >= Count)
|
||||
throw new ArgumentOutOfRangeException ("index");
|
||||
|
||||
var ptr = SecTrustGetCertificateAtIndex (handle, (IntPtr)index);
|
||||
return new X509Certificate (ptr);
|
||||
}
|
||||
|
||||
[DllImport (AppleTlsContext.SecurityLibrary)]
|
||||
extern static SecStatusCode /* OSStatus */ SecTrustSetAnchorCertificates (IntPtr /* SecTrustRef */ trust, IntPtr /* CFArrayRef */ anchorCertificates);
|
||||
|
||||
|
||||
@@ -316,6 +316,9 @@ namespace Mono.Btls
|
||||
if (status == MonoBtlsSslError.WantRead) {
|
||||
wantMore = true;
|
||||
return 0;
|
||||
} else if (status == MonoBtlsSslError.ZeroReturn) {
|
||||
wantMore = false;
|
||||
return size;
|
||||
} else if (status != MonoBtlsSslError.None) {
|
||||
throw GetException (status);
|
||||
}
|
||||
@@ -358,26 +361,11 @@ namespace Mono.Btls
|
||||
}
|
||||
}
|
||||
|
||||
public override void Close ()
|
||||
public override void Shutdown ()
|
||||
{
|
||||
Debug ("Close!");
|
||||
|
||||
if (ssl != null) {
|
||||
ssl.Dispose ();
|
||||
ssl = null;
|
||||
}
|
||||
if (ctx != null) {
|
||||
ctx.Dispose ();
|
||||
ctx = null;
|
||||
}
|
||||
if (bio != null) {
|
||||
bio.Dispose ();
|
||||
bio = null;
|
||||
}
|
||||
if (errbio != null) {
|
||||
errbio.Dispose ();
|
||||
errbio = null;
|
||||
}
|
||||
Debug ("Shutdown!");
|
||||
// ssl.SetQuietShutdown ();
|
||||
ssl.Shutdown ();
|
||||
}
|
||||
|
||||
void Dispose<T> (ref T disposable)
|
||||
@@ -397,12 +385,12 @@ namespace Mono.Btls
|
||||
{
|
||||
try {
|
||||
if (disposing) {
|
||||
Dispose (ref ssl);
|
||||
Dispose (ref ctx);
|
||||
Dispose (ref remoteCertificate);
|
||||
Dispose (ref nativeServerCertificate);
|
||||
Dispose (ref nativeClientCertificate);
|
||||
Dispose (ref clientCertificate);
|
||||
Dispose (ref ctx);
|
||||
Dispose (ref ssl);
|
||||
Dispose (ref bio);
|
||||
Dispose (ref errbio);
|
||||
}
|
||||
|
||||
@@ -102,6 +102,20 @@ namespace Mono.Btls
|
||||
CheckError (ret == 1, callerName);
|
||||
}
|
||||
|
||||
protected internal void CheckLastError ([CallerMemberName] string callerName = null)
|
||||
{
|
||||
var error = Interlocked.Exchange (ref lastError, null);
|
||||
if (error == null)
|
||||
return;
|
||||
|
||||
string message;
|
||||
if (callerName != null)
|
||||
message = string.Format ("Caught unhandled exception in {0}.{1}.", GetType ().Name, callerName);
|
||||
else
|
||||
message = string.Format ("Caught unhandled exception.");
|
||||
throw new MonoBtlsException (message, error);
|
||||
}
|
||||
|
||||
[DllImport (BTLS_DYLIB)]
|
||||
extern static void mono_btls_free (IntPtr data);
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ namespace Mono.Btls
|
||||
protected override bool ReleaseHandle ()
|
||||
{
|
||||
mono_btls_ssl_destroy (handle);
|
||||
handle = IntPtr.Zero;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -78,6 +79,12 @@ namespace Mono.Btls
|
||||
[DllImport (BTLS_DYLIB)]
|
||||
extern static void mono_btls_ssl_close (IntPtr handle);
|
||||
|
||||
[DllImport (BTLS_DYLIB)]
|
||||
extern static int mono_btls_ssl_shutdown (IntPtr handle);
|
||||
|
||||
[DllImport (BTLS_DYLIB)]
|
||||
extern static void mono_btls_ssl_set_quiet_shutdown (IntPtr handle, int mode);
|
||||
|
||||
[DllImport (BTLS_DYLIB)]
|
||||
extern static void mono_btls_ssl_set_bio (IntPtr handle, IntPtr bio);
|
||||
|
||||
@@ -131,6 +138,7 @@ namespace Mono.Btls
|
||||
return new BoringSslHandle (handle);
|
||||
}
|
||||
|
||||
MonoBtlsBio bio;
|
||||
PrintErrorsCallbackFunc printErrorsFunc;
|
||||
IntPtr printErrorsFuncPtr;
|
||||
|
||||
@@ -148,6 +156,7 @@ namespace Mono.Btls
|
||||
public void SetBio (MonoBtlsBio bio)
|
||||
{
|
||||
CheckThrow ();
|
||||
this.bio = bio;
|
||||
mono_btls_ssl_set_bio (
|
||||
Handle.DangerousGetHandle (),
|
||||
bio.Handle.DangerousGetHandle ());
|
||||
@@ -164,18 +173,17 @@ namespace Mono.Btls
|
||||
errors = null;
|
||||
}
|
||||
|
||||
if (errors != null) {
|
||||
Console.Error.WriteLine ("ERROR: {0} failed: {1}", callerName, errors);
|
||||
if (errors != null)
|
||||
throw new MonoBtlsException ("{0} failed: {1}.", callerName, errors);
|
||||
} else {
|
||||
Console.Error.WriteLine ("ERROR: {0} failed.", callerName);
|
||||
else
|
||||
throw new MonoBtlsException ("{0} failed.", callerName);
|
||||
}
|
||||
}
|
||||
|
||||
MonoBtlsSslError GetError (int ret_code)
|
||||
{
|
||||
CheckThrow ();
|
||||
bio.CheckLastError ();
|
||||
|
||||
var error = mono_btls_ssl_get_error (
|
||||
Handle.DangerousGetHandle (), ret_code);
|
||||
return (MonoBtlsSslError)error;
|
||||
@@ -287,15 +295,20 @@ namespace Mono.Btls
|
||||
var ret = mono_btls_ssl_read (
|
||||
Handle.DangerousGetHandle (), data, dataSize);
|
||||
|
||||
if (ret >= 0) {
|
||||
if (ret > 0) {
|
||||
dataSize = ret;
|
||||
return MonoBtlsSslError.None;
|
||||
}
|
||||
|
||||
var error = mono_btls_ssl_get_error (
|
||||
Handle.DangerousGetHandle (), ret);
|
||||
var error = GetError (ret);
|
||||
if (ret == 0 && error == MonoBtlsSslError.Syscall) {
|
||||
// End-of-stream
|
||||
dataSize = 0;
|
||||
return MonoBtlsSslError.None;
|
||||
}
|
||||
|
||||
dataSize = 0;
|
||||
return (MonoBtlsSslError)error;
|
||||
return error;
|
||||
}
|
||||
|
||||
public MonoBtlsSslError Write (IntPtr data, ref int dataSize)
|
||||
@@ -416,9 +429,24 @@ namespace Mono.Btls
|
||||
return Marshal.PtrToStringAnsi (namePtr);
|
||||
}
|
||||
|
||||
public void Shutdown ()
|
||||
{
|
||||
CheckThrow ();
|
||||
var ret = mono_btls_ssl_shutdown (Handle.DangerousGetHandle ());
|
||||
if (ret < 0)
|
||||
throw ThrowError ();
|
||||
}
|
||||
|
||||
public void SetQuietShutdown ()
|
||||
{
|
||||
CheckThrow ();
|
||||
mono_btls_ssl_set_quiet_shutdown (Handle.DangerousGetHandle (), 1);
|
||||
}
|
||||
|
||||
protected override void Close ()
|
||||
{
|
||||
mono_btls_ssl_close (Handle.DangerousGetHandle ());
|
||||
if (!Handle.IsInvalid)
|
||||
mono_btls_ssl_close (Handle.DangerousGetHandle ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,12 +53,12 @@ namespace Mono.Btls
|
||||
}
|
||||
|
||||
protected override MNS.MobileTlsContext CreateContext (
|
||||
MNS.MobileAuthenticatedStream parent, bool serverMode, string targetHost,
|
||||
SslProtocols enabledProtocols, X509Certificate serverCertificate,
|
||||
X509CertificateCollection clientCertificates, bool askForClientCert)
|
||||
bool serverMode, string targetHost, SslProtocols enabledProtocols,
|
||||
X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
|
||||
bool askForClientCert)
|
||||
{
|
||||
return new MonoBtlsContext (
|
||||
parent, serverMode, targetHost,
|
||||
this, serverMode, targetHost,
|
||||
enabledProtocols, serverCertificate,
|
||||
clientCertificates, askForClientCert);
|
||||
}
|
||||
|
||||
@@ -11,14 +11,14 @@ using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Security;
|
||||
using System.Security.Authentication;
|
||||
using SD = System.Diagnostics;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Runtime.ExceptionServices;
|
||||
|
||||
namespace Mono.Net.Security
|
||||
{
|
||||
delegate AsyncOperationStatus AsyncOperation (AsyncProtocolRequest asyncRequest, AsyncOperationStatus status);
|
||||
|
||||
class BufferOffsetSize
|
||||
{
|
||||
public byte[] Buffer;
|
||||
@@ -37,6 +37,13 @@ namespace Mono.Net.Security
|
||||
|
||||
public BufferOffsetSize (byte[] buffer, int offset, int size)
|
||||
{
|
||||
if (buffer == null)
|
||||
throw new ArgumentNullException (nameof (buffer));
|
||||
if (offset < 0)
|
||||
throw new ArgumentOutOfRangeException (nameof (offset));
|
||||
if (size < 0 || offset + size > buffer.Length)
|
||||
throw new ArgumentOutOfRangeException (nameof (size));
|
||||
|
||||
Buffer = buffer;
|
||||
Offset = offset;
|
||||
Size = size;
|
||||
@@ -54,7 +61,7 @@ namespace Mono.Net.Security
|
||||
public readonly int InitialSize;
|
||||
|
||||
public BufferOffsetSize2 (int size)
|
||||
: base (new byte [size], 0, 0)
|
||||
: base (new byte[size], 0, 0)
|
||||
{
|
||||
InitialSize = size;
|
||||
}
|
||||
@@ -63,7 +70,7 @@ namespace Mono.Net.Security
|
||||
{
|
||||
Offset = Size = 0;
|
||||
TotalBytes = 0;
|
||||
Buffer = new byte [InitialSize];
|
||||
Buffer = new byte[InitialSize];
|
||||
Complete = false;
|
||||
}
|
||||
|
||||
@@ -74,11 +81,11 @@ namespace Mono.Net.Security
|
||||
|
||||
int missing = size - Remaining;
|
||||
if (Offset == 0 && Size == 0) {
|
||||
Buffer = new byte [size];
|
||||
Buffer = new byte[size];
|
||||
return;
|
||||
}
|
||||
|
||||
var buffer = new byte [Buffer.Length + missing];
|
||||
var buffer = new byte[Buffer.Length + missing];
|
||||
Buffer.CopyTo (buffer, 0);
|
||||
Buffer = buffer;
|
||||
}
|
||||
@@ -91,201 +98,296 @@ namespace Mono.Net.Security
|
||||
}
|
||||
}
|
||||
|
||||
enum AsyncOperationStatus {
|
||||
NotStarted,
|
||||
enum AsyncOperationStatus
|
||||
{
|
||||
Initialize,
|
||||
Continue,
|
||||
Running,
|
||||
Complete,
|
||||
WantRead,
|
||||
WantWrite,
|
||||
ReadDone,
|
||||
FinishWrite
|
||||
Complete
|
||||
}
|
||||
|
||||
class AsyncProtocolRequest
|
||||
class AsyncProtocolResult
|
||||
{
|
||||
public readonly MobileAuthenticatedStream Parent;
|
||||
public readonly BufferOffsetSize UserBuffer;
|
||||
|
||||
int RequestedSize;
|
||||
public int CurrentSize;
|
||||
public int UserResult;
|
||||
|
||||
AsyncOperation Operation;
|
||||
int Status;
|
||||
|
||||
public readonly int ID = ++next_id;
|
||||
static int next_id;
|
||||
|
||||
public readonly LazyAsyncResult UserAsyncResult;
|
||||
|
||||
public AsyncProtocolRequest (MobileAuthenticatedStream parent, LazyAsyncResult lazyResult, BufferOffsetSize userBuffer = null)
|
||||
{
|
||||
Parent = parent;
|
||||
UserAsyncResult = lazyResult;
|
||||
UserBuffer = userBuffer;
|
||||
public int UserResult {
|
||||
get;
|
||||
}
|
||||
public ExceptionDispatchInfo Error {
|
||||
get;
|
||||
}
|
||||
|
||||
public bool CompleteWithError (Exception ex)
|
||||
public AsyncProtocolResult (int result)
|
||||
{
|
||||
Status = (int)AsyncOperationStatus.Complete;
|
||||
if (UserAsyncResult == null)
|
||||
return true;
|
||||
if (!UserAsyncResult.InternalPeekCompleted)
|
||||
UserAsyncResult.InvokeCallback (ex);
|
||||
return false;
|
||||
UserResult = result;
|
||||
}
|
||||
|
||||
public AsyncProtocolResult (ExceptionDispatchInfo error)
|
||||
{
|
||||
Error = error;
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AsyncProtocolRequest
|
||||
{
|
||||
public MobileAuthenticatedStream Parent {
|
||||
get;
|
||||
}
|
||||
|
||||
public bool RunSynchronously {
|
||||
get;
|
||||
}
|
||||
|
||||
public int ID => ++next_id;
|
||||
|
||||
public string Name => GetType ().Name;
|
||||
|
||||
public int UserResult {
|
||||
get;
|
||||
protected set;
|
||||
}
|
||||
|
||||
int Started;
|
||||
int RequestedSize;
|
||||
int WriteRequested;
|
||||
readonly object locker = new object ();
|
||||
|
||||
static int next_id;
|
||||
|
||||
public AsyncProtocolRequest (MobileAuthenticatedStream parent, bool sync)
|
||||
{
|
||||
Parent = parent;
|
||||
RunSynchronously = sync;
|
||||
}
|
||||
|
||||
[SD.Conditional ("MARTIN_DEBUG")]
|
||||
protected void Debug (string message, params object[] args)
|
||||
{
|
||||
Parent.Debug ("AsyncProtocolRequest({0}:{1}): {2}", Parent.ID, ID, string.Format (message, args));
|
||||
Parent.Debug ("{0}({1}:{2}): {3}", Name, Parent.ID, ID, string.Format (message, args));
|
||||
}
|
||||
|
||||
internal void RequestRead (int size)
|
||||
{
|
||||
var oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.WantRead, (int)AsyncOperationStatus.Running);
|
||||
Debug ("RequestRead: {0} {1}", oldStatus, size);
|
||||
if (oldStatus == AsyncOperationStatus.Running)
|
||||
RequestedSize = size;
|
||||
else if (oldStatus == AsyncOperationStatus.WantRead)
|
||||
lock (locker) {
|
||||
RequestedSize += size;
|
||||
else if (oldStatus != AsyncOperationStatus.WantWrite)
|
||||
throw new InvalidOperationException ();
|
||||
}
|
||||
|
||||
internal void ResetRead ()
|
||||
{
|
||||
var oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.Complete, (int)AsyncOperationStatus.WantRead);
|
||||
Debug ("ResetRead: {0} {1}", oldStatus, Status);
|
||||
}
|
||||
|
||||
internal void ResetWrite ()
|
||||
{
|
||||
var oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.Complete, (int)AsyncOperationStatus.WantWrite);
|
||||
Debug ("ResetWrite: {0} {1}", oldStatus, Status);
|
||||
Debug ("RequestRead: {0}", size);
|
||||
}
|
||||
}
|
||||
|
||||
internal void RequestWrite ()
|
||||
{
|
||||
var oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.WantWrite, (int)AsyncOperationStatus.Running);
|
||||
Debug ("RequestWrite: {0} {1}", oldStatus, Status);
|
||||
if (oldStatus == AsyncOperationStatus.Running)
|
||||
return;
|
||||
else if (oldStatus != AsyncOperationStatus.WantRead && oldStatus != AsyncOperationStatus.WantWrite)
|
||||
throw new InvalidOperationException ();
|
||||
WriteRequested = 1;
|
||||
}
|
||||
|
||||
internal void StartOperation (AsyncOperation operation)
|
||||
internal async Task<AsyncProtocolResult> StartOperation (CancellationToken cancellationToken)
|
||||
{
|
||||
Debug ("Start Operation: {0} {1}", Status, operation);
|
||||
if (Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.Initialize, (int)AsyncOperationStatus.NotStarted) != (int)AsyncOperationStatus.NotStarted)
|
||||
Debug ("Start Operation: {0}", this);
|
||||
if (Interlocked.CompareExchange (ref Started, 1, 0) != 0)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
Operation = operation;
|
||||
|
||||
if (UserAsyncResult == null) {
|
||||
StartOperation ();
|
||||
return;
|
||||
}
|
||||
|
||||
ThreadPool.QueueUserWorkItem (_ => StartOperation ());
|
||||
}
|
||||
|
||||
void StartOperation ()
|
||||
{
|
||||
try {
|
||||
ProcessOperation ();
|
||||
if (UserAsyncResult != null && !UserAsyncResult.InternalPeekCompleted)
|
||||
UserAsyncResult.InvokeCallback (UserResult);
|
||||
await ProcessOperation (cancellationToken).ConfigureAwait (false);
|
||||
return new AsyncProtocolResult (UserResult);
|
||||
} catch (Exception ex) {
|
||||
if (UserAsyncResult == null)
|
||||
throw;
|
||||
if (!UserAsyncResult.InternalPeekCompleted)
|
||||
UserAsyncResult.InvokeCallback (ex);
|
||||
var info = Parent.SetException (MobileAuthenticatedStream.GetSSPIException (ex));
|
||||
return new AsyncProtocolResult (info);
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessOperation ()
|
||||
async Task ProcessOperation (CancellationToken cancellationToken)
|
||||
{
|
||||
AsyncOperationStatus status;
|
||||
do {
|
||||
status = (AsyncOperationStatus)Interlocked.Exchange (ref Status, (int)AsyncOperationStatus.Running);
|
||||
|
||||
var status = AsyncOperationStatus.Initialize;
|
||||
while (status != AsyncOperationStatus.Complete) {
|
||||
cancellationToken.ThrowIfCancellationRequested ();
|
||||
Debug ("ProcessOperation: {0}", status);
|
||||
|
||||
status = ProcessOperation (status);
|
||||
|
||||
Debug ("ProcessOperation done: {0}", status);
|
||||
|
||||
AsyncOperationStatus oldStatus;
|
||||
if (status == AsyncOperationStatus.Complete) {
|
||||
oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.FinishWrite, (int)AsyncOperationStatus.WantWrite);
|
||||
if (oldStatus == AsyncOperationStatus.WantWrite) {
|
||||
// We are done, but still need to flush the write queue.
|
||||
status = AsyncOperationStatus.FinishWrite;
|
||||
continue;
|
||||
var ret = await InnerRead (cancellationToken).ConfigureAwait (false);
|
||||
if (ret != null) {
|
||||
if (ret == 0) {
|
||||
// End-of-stream
|
||||
Debug ("END OF STREAM!");
|
||||
status = AsyncOperationStatus.ReadDone;
|
||||
} else if (ret < 0) {
|
||||
// remote prematurely closed connection.
|
||||
throw new IOException ("Remote prematurely closed connection.");
|
||||
}
|
||||
}
|
||||
|
||||
oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)status, (int)AsyncOperationStatus.Running);
|
||||
Debug ("ProcessOperation done: {0} -> {1}", oldStatus, status);
|
||||
Debug ("ProcessOperation run: {0}", status);
|
||||
|
||||
if (oldStatus != AsyncOperationStatus.Running) {
|
||||
if (status == oldStatus || status == AsyncOperationStatus.Continue || status == AsyncOperationStatus.Complete)
|
||||
status = oldStatus;
|
||||
else
|
||||
throw new InvalidOperationException ();
|
||||
AsyncOperationStatus newStatus;
|
||||
switch (status) {
|
||||
case AsyncOperationStatus.Initialize:
|
||||
case AsyncOperationStatus.Continue:
|
||||
case AsyncOperationStatus.ReadDone:
|
||||
newStatus = Run (status);
|
||||
break;
|
||||
default:
|
||||
throw new InvalidOperationException ();
|
||||
}
|
||||
} while (status != AsyncOperationStatus.Complete);
|
||||
|
||||
if (Interlocked.Exchange (ref WriteRequested, 0) != 0) {
|
||||
// Flush the write queue.
|
||||
await Parent.InnerWrite (RunSynchronously, cancellationToken);
|
||||
}
|
||||
|
||||
Debug ("ProcessOperation done: {0} -> {1}", status, newStatus);
|
||||
|
||||
status = newStatus;
|
||||
}
|
||||
}
|
||||
|
||||
AsyncOperationStatus ProcessOperation (AsyncOperationStatus status)
|
||||
async Task<int?> InnerRead (CancellationToken cancellationToken)
|
||||
{
|
||||
if (status == AsyncOperationStatus.WantRead) {
|
||||
if (RequestedSize < 0)
|
||||
int? totalRead = null;
|
||||
var requestedSize = Interlocked.Exchange (ref RequestedSize, 0);
|
||||
while (requestedSize > 0) {
|
||||
Debug ("ProcessOperation - read inner: {0}", requestedSize);
|
||||
|
||||
var ret = await Parent.InnerRead (RunSynchronously, requestedSize, cancellationToken).ConfigureAwait (false);
|
||||
Debug ("ProcessOperation - read inner done: {0} - {1}", requestedSize, ret);
|
||||
|
||||
if (ret <= 0)
|
||||
return ret;
|
||||
if (ret > requestedSize)
|
||||
throw new InvalidOperationException ();
|
||||
else if (RequestedSize == 0)
|
||||
return AsyncOperationStatus.Continue;
|
||||
|
||||
Debug ("ProcessOperation - read inner: {0}", RequestedSize);
|
||||
var ret = Parent.InnerRead (RequestedSize);
|
||||
Debug ("ProcessOperation - read inner done: {0} - {1}", RequestedSize, ret);
|
||||
totalRead += ret;
|
||||
requestedSize -= ret;
|
||||
var newRequestedSize = Interlocked.Exchange (ref RequestedSize, 0);
|
||||
requestedSize += newRequestedSize;
|
||||
}
|
||||
|
||||
if (ret < 0)
|
||||
return AsyncOperationStatus.ReadDone;
|
||||
return totalRead;
|
||||
}
|
||||
|
||||
RequestedSize -= ret;
|
||||
/*
|
||||
* This will operate on the internal buffers and never block.
|
||||
*/
|
||||
protected abstract AsyncOperationStatus Run (AsyncOperationStatus status);
|
||||
|
||||
if (ret == 0 || RequestedSize == 0)
|
||||
return AsyncOperationStatus.Continue;
|
||||
else
|
||||
return AsyncOperationStatus.WantRead;
|
||||
} else if (status == AsyncOperationStatus.WantWrite) {
|
||||
Debug ("ProcessOperation - want write");
|
||||
Parent.InnerWrite ();
|
||||
Debug ("ProcessOperation - want write done");
|
||||
return AsyncOperationStatus.Continue;
|
||||
} else if (status == AsyncOperationStatus.Initialize || status == AsyncOperationStatus.Continue) {
|
||||
Debug ("ProcessOperation - continue");
|
||||
status = Operation (this, status);
|
||||
Debug ("ProcessOperation - continue done: {0}", status);
|
||||
return status;
|
||||
} else if (status == AsyncOperationStatus.ReadDone) {
|
||||
Debug ("ProcessOperation - read done");
|
||||
status = Operation (this, status);
|
||||
Debug ("ProcessOperation - read done: {0}", status);
|
||||
return status;
|
||||
} else if (status == AsyncOperationStatus.FinishWrite) {
|
||||
Debug ("ProcessOperation - finish write");
|
||||
Parent.InnerWrite ();
|
||||
Debug ("ProcessOperation - finish write done");
|
||||
public override string ToString ()
|
||||
{
|
||||
return string.Format ("[{0}]", Name);
|
||||
}
|
||||
}
|
||||
|
||||
class AsyncHandshakeRequest : AsyncProtocolRequest
|
||||
{
|
||||
public AsyncHandshakeRequest (MobileAuthenticatedStream parent, bool sync)
|
||||
: base (parent, sync)
|
||||
{
|
||||
}
|
||||
|
||||
protected override AsyncOperationStatus Run (AsyncOperationStatus status)
|
||||
{
|
||||
return Parent.ProcessHandshake (status);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AsyncReadOrWriteRequest : AsyncProtocolRequest
|
||||
{
|
||||
protected BufferOffsetSize UserBuffer {
|
||||
get;
|
||||
}
|
||||
|
||||
protected int CurrentSize {
|
||||
get; set;
|
||||
}
|
||||
|
||||
public AsyncReadOrWriteRequest (MobileAuthenticatedStream parent, bool sync, byte[] buffer, int offset, int size)
|
||||
: base (parent, sync)
|
||||
{
|
||||
UserBuffer = new BufferOffsetSize (buffer, offset, size);
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return string.Format ("[{0}: {1}]", Name, UserBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
class AsyncReadRequest : AsyncReadOrWriteRequest
|
||||
{
|
||||
public AsyncReadRequest (MobileAuthenticatedStream parent, bool sync, byte[] buffer, int offset, int size)
|
||||
: base (parent, sync, buffer, offset, size)
|
||||
{
|
||||
}
|
||||
|
||||
protected override AsyncOperationStatus Run (AsyncOperationStatus status)
|
||||
{
|
||||
Debug ("ProcessRead - read user: {0} {1}", this, status);
|
||||
|
||||
var (ret, wantMore) = Parent.ProcessRead (UserBuffer);
|
||||
|
||||
Debug ("ProcessRead - read user done: {0} - {1} {2}", this, ret, wantMore);
|
||||
|
||||
if (ret < 0) {
|
||||
UserResult = -1;
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
|
||||
throw new InvalidOperationException ();
|
||||
CurrentSize += ret;
|
||||
UserBuffer.Offset += ret;
|
||||
UserBuffer.Size -= ret;
|
||||
|
||||
Debug ("Process Read - read user done #1: {0} - {1} {2}", this, CurrentSize, wantMore);
|
||||
|
||||
if (wantMore && CurrentSize == 0)
|
||||
return AsyncOperationStatus.Continue;
|
||||
|
||||
UserResult = CurrentSize;
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
}
|
||||
|
||||
class AsyncWriteRequest : AsyncReadOrWriteRequest
|
||||
{
|
||||
public AsyncWriteRequest (MobileAuthenticatedStream parent, bool sync, byte[] buffer, int offset, int size)
|
||||
: base (parent, sync, buffer, offset, size)
|
||||
{
|
||||
}
|
||||
|
||||
protected override AsyncOperationStatus Run (AsyncOperationStatus status)
|
||||
{
|
||||
Debug ("ProcessWrite - write user: {0} {1}", this, status);
|
||||
|
||||
if (UserBuffer.Size == 0) {
|
||||
UserResult = CurrentSize;
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
|
||||
var (ret, wantMore) = Parent.ProcessWrite (UserBuffer);
|
||||
|
||||
Debug ("ProcessWrite - write user done: {0} - {1} {2}", this, ret, wantMore);
|
||||
|
||||
if (ret < 0) {
|
||||
UserResult = -1;
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
|
||||
CurrentSize += ret;
|
||||
UserBuffer.Offset += ret;
|
||||
UserBuffer.Size -= ret;
|
||||
|
||||
if (wantMore)
|
||||
return AsyncOperationStatus.Continue;
|
||||
|
||||
UserResult = CurrentSize;
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
}
|
||||
|
||||
class AsyncShutdownRequest : AsyncProtocolRequest
|
||||
{
|
||||
public AsyncShutdownRequest (MobileAuthenticatedStream parent)
|
||||
: base (parent, false)
|
||||
{
|
||||
}
|
||||
|
||||
protected override AsyncOperationStatus Run (AsyncOperationStatus status)
|
||||
{
|
||||
return Parent.ProcessShutdown (status);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -575,6 +575,11 @@ namespace Mono.Net.Security.Private
|
||||
|
||||
#region IMonoSslStream
|
||||
|
||||
Task IMonoSslStream.ShutdownAsync ()
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
AuthenticatedStream IMonoSslStream.AuthenticatedStream {
|
||||
get { return this; }
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Security;
|
||||
using System.Globalization;
|
||||
using System.Security.Authentication;
|
||||
using System.Runtime.ExceptionServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -36,8 +37,13 @@ namespace Mono.Net.Security
|
||||
{
|
||||
abstract class MobileAuthenticatedStream : AuthenticatedStream, MSI.IMonoSslStream
|
||||
{
|
||||
/*
|
||||
* This is intentionally called `xobileTlsContext'. It is a "dangerous" object
|
||||
* that must not be touched outside the `ioLock' and we need to be very careful
|
||||
* where we access it.
|
||||
*/
|
||||
MobileTlsContext xobileTlsContext;
|
||||
Exception lastException;
|
||||
ExceptionDispatchInfo lastException;
|
||||
|
||||
AsyncProtocolRequest asyncHandshakeRequest;
|
||||
AsyncProtocolRequest asyncReadRequest;
|
||||
@@ -47,11 +53,12 @@ namespace Mono.Net.Security
|
||||
|
||||
object ioLock = new object ();
|
||||
int closeRequested;
|
||||
bool shutdown;
|
||||
|
||||
static int uniqueNameInteger = 123;
|
||||
|
||||
public MobileAuthenticatedStream (Stream innerStream, bool leaveInnerStreamOpen, SslStream owner,
|
||||
MSI.MonoTlsSettings settings, MSI.MonoTlsProvider provider)
|
||||
MSI.MonoTlsSettings settings, MSI.MonoTlsProvider provider)
|
||||
: base (innerStream, leaveInnerStreamOpen)
|
||||
{
|
||||
SslStream = owner;
|
||||
@@ -78,42 +85,47 @@ namespace Mono.Net.Security
|
||||
get { return xobileTlsContext != null; }
|
||||
}
|
||||
|
||||
internal MobileTlsContext Context {
|
||||
get {
|
||||
CheckThrow (true);
|
||||
return xobileTlsContext;
|
||||
}
|
||||
}
|
||||
|
||||
internal void CheckThrow (bool authSuccessCheck)
|
||||
internal void CheckThrow (bool authSuccessCheck, bool shutdownCheck = false)
|
||||
{
|
||||
if (closeRequested != 0)
|
||||
throw new InvalidOperationException ("Stream is closed.");
|
||||
if (lastException != null)
|
||||
throw lastException;
|
||||
lastException.Throw ();
|
||||
if (authSuccessCheck && !IsAuthenticated)
|
||||
throw new InvalidOperationException ("Must be authenticated.");
|
||||
throw new InvalidOperationException (SR.net_auth_noauth);
|
||||
if (shutdownCheck && shutdown)
|
||||
throw new InvalidOperationException (SR.net_ssl_io_already_shutdown);
|
||||
}
|
||||
|
||||
Exception SetException (Exception e)
|
||||
internal static Exception GetSSPIException (Exception e)
|
||||
{
|
||||
e = SetException_internal (e);
|
||||
if (e != null && xobileTlsContext != null)
|
||||
xobileTlsContext.Dispose ();
|
||||
return e;
|
||||
if (e is OperationCanceledException || e is IOException || e is ObjectDisposedException || e is AuthenticationException)
|
||||
return e;
|
||||
return new AuthenticationException (SR.net_auth_SSPI, e);
|
||||
}
|
||||
|
||||
Exception SetException_internal (Exception e)
|
||||
internal static Exception GetIOException (Exception e, string message)
|
||||
{
|
||||
if (lastException == null)
|
||||
lastException = e;
|
||||
return lastException;
|
||||
if (e is OperationCanceledException || e is IOException || e is ObjectDisposedException || e is AuthenticationException)
|
||||
return e;
|
||||
return new IOException (message, e);
|
||||
}
|
||||
|
||||
internal ExceptionDispatchInfo SetException (Exception e)
|
||||
{
|
||||
var info = ExceptionDispatchInfo.Capture (e);
|
||||
var old = Interlocked.CompareExchange (ref lastException, info, null);
|
||||
return old ?? info;
|
||||
}
|
||||
|
||||
SslProtocols DefaultProtocols {
|
||||
get { return SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls; }
|
||||
}
|
||||
|
||||
enum OperationType {
|
||||
Read,
|
||||
Write,
|
||||
Shutdown
|
||||
}
|
||||
|
||||
public void AuthenticateAsClient (string targetHost)
|
||||
{
|
||||
AuthenticateAsClient (targetHost, new X509CertificateCollection (), DefaultProtocols, false);
|
||||
@@ -121,8 +133,8 @@ namespace Mono.Net.Security
|
||||
|
||||
public void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
|
||||
{
|
||||
ValidateCreateContext (false, targetHost, enabledSslProtocols, null, clientCertificates, false);
|
||||
ProcessAuthentication (null);
|
||||
var task = ProcessAuthentication (true, false, targetHost, enabledSslProtocols, null, clientCertificates, false);
|
||||
task.Wait ();
|
||||
}
|
||||
|
||||
public IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState)
|
||||
@@ -132,15 +144,13 @@ namespace Mono.Net.Security
|
||||
|
||||
public IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
|
||||
{
|
||||
ValidateCreateContext (false, targetHost, enabledSslProtocols, null, clientCertificates, false);
|
||||
var result = new LazyAsyncResult (this, asyncState, asyncCallback);
|
||||
ProcessAuthentication (result);
|
||||
return result;
|
||||
var task = ProcessAuthentication (false, false, targetHost, enabledSslProtocols, null, clientCertificates, false);
|
||||
return TaskToApm.Begin (task, asyncCallback, asyncState);
|
||||
}
|
||||
|
||||
public void EndAuthenticateAsClient (IAsyncResult asyncResult)
|
||||
{
|
||||
EndProcessAuthentication (asyncResult);
|
||||
TaskToApm.End (asyncResult);
|
||||
}
|
||||
|
||||
public void AuthenticateAsServer (X509Certificate serverCertificate)
|
||||
@@ -150,8 +160,8 @@ namespace Mono.Net.Security
|
||||
|
||||
public void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
|
||||
{
|
||||
ValidateCreateContext (true, string.Empty, enabledSslProtocols, serverCertificate, null, clientCertificateRequired);
|
||||
ProcessAuthentication (null);
|
||||
var task = ProcessAuthentication (true, true, string.Empty, enabledSslProtocols, serverCertificate, null, clientCertificateRequired);
|
||||
task.Wait ();
|
||||
}
|
||||
|
||||
public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState)
|
||||
@@ -161,218 +171,214 @@ namespace Mono.Net.Security
|
||||
|
||||
public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
|
||||
{
|
||||
ValidateCreateContext (true, string.Empty, enabledSslProtocols, serverCertificate, null, clientCertificateRequired);
|
||||
var result = new LazyAsyncResult (this, asyncState, asyncCallback);
|
||||
ProcessAuthentication (result);
|
||||
return result;
|
||||
var task = ProcessAuthentication (false, true, string.Empty, enabledSslProtocols, serverCertificate, null, clientCertificateRequired);
|
||||
return TaskToApm.Begin (task, asyncCallback, asyncState);
|
||||
}
|
||||
|
||||
public void EndAuthenticateAsServer (IAsyncResult asyncResult)
|
||||
{
|
||||
EndProcessAuthentication (asyncResult);
|
||||
TaskToApm.End (asyncResult);
|
||||
}
|
||||
|
||||
public Task AuthenticateAsClientAsync (string targetHost)
|
||||
{
|
||||
return Task.Factory.FromAsync (BeginAuthenticateAsClient, EndAuthenticateAsClient, targetHost, null);
|
||||
return ProcessAuthentication (false, false, targetHost, DefaultProtocols, null, null, false);
|
||||
}
|
||||
|
||||
public Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
|
||||
{
|
||||
return Task.Factory.FromAsync ((callback, state) => BeginAuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation, callback, state), EndAuthenticateAsClient, null);
|
||||
return ProcessAuthentication (false, false, targetHost, enabledSslProtocols, null, clientCertificates, false);
|
||||
}
|
||||
|
||||
public Task AuthenticateAsServerAsync (X509Certificate serverCertificate)
|
||||
{
|
||||
return Task.Factory.FromAsync (BeginAuthenticateAsServer, EndAuthenticateAsServer, serverCertificate, null);
|
||||
return AuthenticateAsServerAsync (serverCertificate, false, DefaultProtocols, false);
|
||||
}
|
||||
|
||||
public Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
|
||||
{
|
||||
return Task.Factory.FromAsync ((callback, state) => BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation, callback, state), EndAuthenticateAsServer, null);
|
||||
return ProcessAuthentication (false, true, string.Empty, enabledSslProtocols, serverCertificate, null, clientCertificateRequired);
|
||||
}
|
||||
|
||||
public Task ShutdownAsync ()
|
||||
{
|
||||
Debug ("ShutdownAsync");
|
||||
|
||||
/*
|
||||
* SSLClose() is a little bit tricky as it might attempt to send a close_notify alert
|
||||
* and thus call our write callback.
|
||||
*
|
||||
* It is also not thread-safe with SSLRead() or SSLWrite(), so we need to take the I/O lock here.
|
||||
*/
|
||||
var asyncRequest = new AsyncShutdownRequest (this);
|
||||
var task = StartOperation (OperationType.Shutdown, asyncRequest, CancellationToken.None);
|
||||
return task;
|
||||
}
|
||||
|
||||
public AuthenticatedStream AuthenticatedStream {
|
||||
get { return this; }
|
||||
}
|
||||
|
||||
internal void ProcessAuthentication (LazyAsyncResult lazyResult)
|
||||
async Task ProcessAuthentication (
|
||||
bool runSynchronously, bool serverMode, string targetHost, SslProtocols enabledProtocols,
|
||||
X509Certificate serverCertificate, X509CertificateCollection clientCertificates, bool clientCertRequired)
|
||||
{
|
||||
var asyncRequest = new AsyncProtocolRequest (this, lazyResult);
|
||||
if (Interlocked.CompareExchange (ref asyncHandshakeRequest, asyncRequest, null) != null)
|
||||
throw new InvalidOperationException ("Invalid nested call.");
|
||||
|
||||
try {
|
||||
if (lastException != null)
|
||||
throw lastException;
|
||||
if (xobileTlsContext == null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
readBuffer.Reset ();
|
||||
writeBuffer.Reset ();
|
||||
|
||||
try {
|
||||
asyncRequest.StartOperation (ProcessHandshake);
|
||||
} catch (Exception ex) {
|
||||
ExceptionDispatchInfo.Capture (SetException (ex)).Throw ();
|
||||
}
|
||||
} finally {
|
||||
if (lazyResult == null || lastException != null) {
|
||||
readBuffer.Reset ();
|
||||
writeBuffer.Reset ();
|
||||
asyncHandshakeRequest = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal void EndProcessAuthentication (IAsyncResult result)
|
||||
{
|
||||
if (result == null)
|
||||
throw new ArgumentNullException ("asyncResult");
|
||||
|
||||
var lazyResult = (LazyAsyncResult)result;
|
||||
if (Interlocked.Exchange (ref asyncHandshakeRequest, null) == null)
|
||||
throw new InvalidOperationException ("Invalid end call.");
|
||||
|
||||
lazyResult.InternalWaitForCompletion ();
|
||||
|
||||
readBuffer.Reset ();
|
||||
writeBuffer.Reset ();
|
||||
|
||||
var e = lazyResult.Result as Exception;
|
||||
if (e != null)
|
||||
ExceptionDispatchInfo.Capture (SetException (e)).Throw ();
|
||||
}
|
||||
|
||||
internal void ValidateCreateContext (bool serverMode, string targetHost, SslProtocols enabledProtocols, X509Certificate serverCertificate, X509CertificateCollection clientCertificates, bool clientCertRequired)
|
||||
{
|
||||
if (xobileTlsContext != null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
if (serverMode) {
|
||||
if (serverCertificate == null)
|
||||
throw new ArgumentException ("serverCertificate");
|
||||
} else {
|
||||
throw new ArgumentException (nameof (serverCertificate));
|
||||
} else {
|
||||
if (targetHost == null)
|
||||
throw new ArgumentException ("targetHost");
|
||||
throw new ArgumentException (nameof (targetHost));
|
||||
if (targetHost.Length == 0)
|
||||
targetHost = "?" + Interlocked.Increment (ref uniqueNameInteger).ToString (NumberFormatInfo.InvariantInfo);
|
||||
}
|
||||
|
||||
xobileTlsContext = CreateContext (this, serverMode, targetHost, enabledProtocols, serverCertificate, clientCertificates, clientCertRequired);
|
||||
if (lastException != null)
|
||||
lastException.Throw ();
|
||||
|
||||
var asyncRequest = new AsyncHandshakeRequest (this, runSynchronously);
|
||||
if (Interlocked.CompareExchange (ref asyncHandshakeRequest, asyncRequest, null) != null)
|
||||
throw new InvalidOperationException ("Invalid nested call.");
|
||||
// Make sure no other async requests can be started during the handshake.
|
||||
if (Interlocked.CompareExchange (ref asyncReadRequest, asyncRequest, null) != null)
|
||||
throw new InvalidOperationException ("Invalid nested call.");
|
||||
if (Interlocked.CompareExchange (ref asyncWriteRequest, asyncRequest, null) != null)
|
||||
throw new InvalidOperationException ("Invalid nested call.");
|
||||
|
||||
AsyncProtocolResult result;
|
||||
|
||||
try {
|
||||
lock (ioLock) {
|
||||
if (xobileTlsContext != null)
|
||||
throw new InvalidOperationException ();
|
||||
readBuffer.Reset ();
|
||||
writeBuffer.Reset ();
|
||||
|
||||
xobileTlsContext = CreateContext (
|
||||
serverMode, targetHost, enabledProtocols, serverCertificate,
|
||||
clientCertificates, clientCertRequired);
|
||||
}
|
||||
|
||||
try {
|
||||
result = await asyncRequest.StartOperation (CancellationToken.None).ConfigureAwait (false);
|
||||
} catch (Exception ex) {
|
||||
result = new AsyncProtocolResult (SetException (GetSSPIException (ex)));
|
||||
}
|
||||
} finally {
|
||||
lock (ioLock) {
|
||||
readBuffer.Reset ();
|
||||
writeBuffer.Reset ();
|
||||
asyncWriteRequest = null;
|
||||
asyncReadRequest = null;
|
||||
asyncHandshakeRequest = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (result.Error != null)
|
||||
result.Error.Throw ();
|
||||
}
|
||||
|
||||
protected abstract MobileTlsContext CreateContext (
|
||||
MobileAuthenticatedStream parent, bool serverMode, string targetHost,
|
||||
SSA.SslProtocols enabledProtocols, X509Certificate serverCertificate,
|
||||
X509CertificateCollection clientCertificates, bool askForClientCert);
|
||||
bool serverMode, string targetHost, SSA.SslProtocols enabledProtocols,
|
||||
X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
|
||||
bool askForClientCert);
|
||||
|
||||
public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
|
||||
{
|
||||
return BeginReadOrWrite (ref asyncReadRequest, ref readBuffer, ProcessRead, new BufferOffsetSize (buffer, offset, count), asyncCallback, asyncState);
|
||||
var asyncRequest = new AsyncReadRequest (this, false, buffer, offset, count);
|
||||
var task = StartOperation (OperationType.Read, asyncRequest, CancellationToken.None);
|
||||
return TaskToApm.Begin (task, asyncCallback, asyncState);
|
||||
}
|
||||
|
||||
public override int EndRead (IAsyncResult asyncResult)
|
||||
{
|
||||
return (int)EndReadOrWrite (asyncResult, ref asyncReadRequest);
|
||||
return TaskToApm.End<int> (asyncResult);
|
||||
}
|
||||
|
||||
public override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
|
||||
{
|
||||
return BeginReadOrWrite (ref asyncWriteRequest, ref writeBuffer, ProcessWrite, new BufferOffsetSize (buffer, offset, count), asyncCallback, asyncState);
|
||||
var asyncRequest = new AsyncWriteRequest (this, false, buffer, offset, count);
|
||||
var task = StartOperation (OperationType.Write, asyncRequest, CancellationToken.None);
|
||||
return TaskToApm.Begin (task, asyncCallback, asyncState);
|
||||
}
|
||||
|
||||
public override void EndWrite (IAsyncResult asyncResult)
|
||||
{
|
||||
EndReadOrWrite (asyncResult, ref asyncWriteRequest);
|
||||
TaskToApm.End (asyncResult);
|
||||
}
|
||||
|
||||
public override int Read (byte[] buffer, int offset, int count)
|
||||
{
|
||||
return ProcessReadOrWrite (ref asyncReadRequest, ref readBuffer, ProcessRead, new BufferOffsetSize (buffer, offset, count), null);
|
||||
var asyncRequest = new AsyncReadRequest (this, true, buffer, offset, count);
|
||||
var task = StartOperation (OperationType.Read, asyncRequest, CancellationToken.None);
|
||||
return task.Result;
|
||||
}
|
||||
|
||||
public void Write (byte[] buffer)
|
||||
{
|
||||
Write (buffer, 0, buffer.Length);
|
||||
}
|
||||
|
||||
public override void Write (byte[] buffer, int offset, int count)
|
||||
{
|
||||
ProcessReadOrWrite (ref asyncWriteRequest, ref writeBuffer, ProcessWrite, new BufferOffsetSize (buffer, offset, count), null);
|
||||
var asyncRequest = new AsyncWriteRequest (this, true, buffer, offset, count);
|
||||
var task = StartOperation (OperationType.Write, asyncRequest, CancellationToken.None);
|
||||
task.Wait ();
|
||||
}
|
||||
|
||||
IAsyncResult BeginReadOrWrite (ref AsyncProtocolRequest nestedRequest, ref BufferOffsetSize2 internalBuffer, AsyncOperation operation, BufferOffsetSize userBuffer, AsyncCallback asyncCallback, object asyncState)
|
||||
public override Task<int> ReadAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
||||
{
|
||||
LazyAsyncResult lazyResult = new LazyAsyncResult (this, asyncState, asyncCallback);
|
||||
ProcessReadOrWrite (ref nestedRequest, ref internalBuffer, operation, userBuffer, lazyResult);
|
||||
return lazyResult;
|
||||
var asyncRequest = new AsyncReadRequest (this, false, buffer, offset, count);
|
||||
return StartOperation (OperationType.Read, asyncRequest, cancellationToken);
|
||||
}
|
||||
|
||||
object EndReadOrWrite (IAsyncResult asyncResult, ref AsyncProtocolRequest nestedRequest)
|
||||
public override Task WriteAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
||||
{
|
||||
if (asyncResult == null)
|
||||
throw new ArgumentNullException("asyncResult");
|
||||
var asyncRequest = new AsyncWriteRequest (this, false, buffer, offset, count);
|
||||
return StartOperation (OperationType.Write, asyncRequest, cancellationToken);
|
||||
}
|
||||
|
||||
var lazyResult = (LazyAsyncResult)asyncResult;
|
||||
async Task<int> StartOperation (OperationType type, AsyncProtocolRequest asyncRequest, CancellationToken cancellationToken)
|
||||
{
|
||||
CheckThrow (true, type != OperationType.Read);
|
||||
Debug ("StartOperationAsync: {0} {1}", asyncRequest, type);
|
||||
|
||||
if (Interlocked.Exchange (ref nestedRequest, null) == null)
|
||||
throw new InvalidOperationException ("Invalid end call.");
|
||||
|
||||
// No "artificial" timeouts implemented so far, InnerStream controls timeout.
|
||||
lazyResult.InternalWaitForCompletion ();
|
||||
|
||||
Debug ("EndReadOrWrite");
|
||||
|
||||
var e = lazyResult.Result as Exception;
|
||||
if (e != null) {
|
||||
var ioEx = e as IOException;
|
||||
if (ioEx != null)
|
||||
throw ioEx;
|
||||
throw new IOException ("read failed", e);
|
||||
if (type == OperationType.Read) {
|
||||
if (Interlocked.CompareExchange (ref asyncReadRequest, asyncRequest, null) != null)
|
||||
throw new InvalidOperationException ("Invalid nested call.");
|
||||
} else {
|
||||
if (Interlocked.CompareExchange (ref asyncWriteRequest, asyncRequest, null) != null)
|
||||
throw new InvalidOperationException ("Invalid nested call.");
|
||||
}
|
||||
|
||||
return lazyResult.Result;
|
||||
}
|
||||
AsyncProtocolResult result;
|
||||
|
||||
int ProcessReadOrWrite (ref AsyncProtocolRequest nestedRequest, ref BufferOffsetSize2 internalBuffer, AsyncOperation operation, BufferOffsetSize userBuffer, LazyAsyncResult lazyResult)
|
||||
{
|
||||
if (userBuffer == null || userBuffer.Buffer == null)
|
||||
throw new ArgumentNullException ("buffer");
|
||||
if (userBuffer.Offset < 0)
|
||||
throw new ArgumentOutOfRangeException ("offset");
|
||||
if (userBuffer.Size < 0 || userBuffer.Offset + userBuffer.Size > userBuffer.Buffer.Length)
|
||||
throw new ArgumentOutOfRangeException ("count");
|
||||
|
||||
CheckThrow (true);
|
||||
|
||||
var name = internalBuffer == readBuffer ? "read" : "write";
|
||||
Debug ("ProcessReadOrWrite: {0} {1}", name, userBuffer);
|
||||
|
||||
var asyncRequest = new AsyncProtocolRequest (this, lazyResult, userBuffer);
|
||||
return StartOperation (ref nestedRequest, ref internalBuffer, operation, asyncRequest, name);
|
||||
}
|
||||
|
||||
int StartOperation (ref AsyncProtocolRequest nestedRequest, ref BufferOffsetSize2 internalBuffer, AsyncOperation operation, AsyncProtocolRequest asyncRequest, string name)
|
||||
{
|
||||
if (Interlocked.CompareExchange (ref nestedRequest, asyncRequest, null) != null)
|
||||
throw new InvalidOperationException ("Invalid nested call.");
|
||||
|
||||
bool failed = false;
|
||||
try {
|
||||
internalBuffer.Reset ();
|
||||
asyncRequest.StartOperation (operation);
|
||||
return asyncRequest.UserResult;
|
||||
lock (ioLock) {
|
||||
if (type == OperationType.Read)
|
||||
readBuffer.Reset ();
|
||||
else
|
||||
writeBuffer.Reset ();
|
||||
}
|
||||
result = await asyncRequest.StartOperation (cancellationToken).ConfigureAwait (false);
|
||||
} catch (Exception e) {
|
||||
failed = true;
|
||||
if (e is IOException)
|
||||
throw;
|
||||
throw new IOException (name + " failed", e);
|
||||
var info = SetException (GetIOException (e, asyncRequest.Name + " failed"));
|
||||
result = new AsyncProtocolResult (info);
|
||||
} finally {
|
||||
if (asyncRequest.UserAsyncResult == null || failed) {
|
||||
internalBuffer.Reset ();
|
||||
nestedRequest = null;
|
||||
lock (ioLock) {
|
||||
if (type == OperationType.Read) {
|
||||
readBuffer.Reset ();
|
||||
asyncReadRequest = null;
|
||||
} else {
|
||||
writeBuffer.Reset ();
|
||||
asyncWriteRequest = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (result.Error != null)
|
||||
result.Error.Throw ();
|
||||
return result.UserResult;
|
||||
}
|
||||
|
||||
static int nextId;
|
||||
@@ -384,26 +390,31 @@ namespace Mono.Net.Security
|
||||
Console.Error.WriteLine ("MobileAuthenticatedStream({0}): {1}", ID, string.Format (message, args));
|
||||
}
|
||||
|
||||
#region Called back from native code via SslConnection
|
||||
#region Called back from native code via SslConnection
|
||||
|
||||
/*
|
||||
* Called from within SSLRead() and SSLHandshake(). We only access tha managed byte[] here.
|
||||
*/
|
||||
internal int InternalRead (byte[] buffer, int offset, int size, out bool wantMore)
|
||||
internal int InternalRead (byte[] buffer, int offset, int size, out bool outWantMore)
|
||||
{
|
||||
try {
|
||||
Debug ("InternalRead: {0} {1} {2} {3}", offset, size, asyncReadRequest != null, readBuffer != null);
|
||||
Debug ("InternalRead: {0} {1} {2} {3} {4}", offset, size,
|
||||
asyncHandshakeRequest != null ? "handshake" : "",
|
||||
asyncReadRequest != null ? "async" : "",
|
||||
readBuffer != null ? readBuffer.ToString () : "");
|
||||
var asyncRequest = asyncHandshakeRequest ?? asyncReadRequest;
|
||||
return InternalRead (asyncRequest, readBuffer, buffer, offset, size, out wantMore);
|
||||
var (ret, wantMore) = InternalRead (asyncRequest, readBuffer, buffer, offset, size);
|
||||
outWantMore = wantMore;
|
||||
return ret;
|
||||
} catch (Exception ex) {
|
||||
Debug ("InternalRead failed: {0}", ex);
|
||||
SetException_internal (ex);
|
||||
wantMore = false;
|
||||
SetException (GetIOException (ex, "InternalRead() failed"));
|
||||
outWantMore = false;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int InternalRead (AsyncProtocolRequest asyncRequest, BufferOffsetSize internalBuffer, byte[] buffer, int offset, int size, out bool wantMore)
|
||||
(int, bool) InternalRead (AsyncProtocolRequest asyncRequest, BufferOffsetSize internalBuffer, byte[] buffer, int offset, int size)
|
||||
{
|
||||
if (asyncRequest == null)
|
||||
throw new InvalidOperationException ();
|
||||
@@ -422,11 +433,10 @@ namespace Mono.Net.Security
|
||||
* native function again.
|
||||
*/
|
||||
if (internalBuffer.Size == 0 && !internalBuffer.Complete) {
|
||||
Debug ("InternalRead #1: {0} {1}", internalBuffer.Offset, internalBuffer.TotalBytes);
|
||||
Debug ("InternalRead #1: {0} {1} {2}", internalBuffer.Offset, internalBuffer.TotalBytes, size);
|
||||
internalBuffer.Offset = internalBuffer.Size = 0;
|
||||
asyncRequest.RequestRead (size);
|
||||
wantMore = true;
|
||||
return 0;
|
||||
return (0, true);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -441,8 +451,7 @@ namespace Mono.Net.Security
|
||||
Buffer.BlockCopy (internalBuffer.Buffer, internalBuffer.Offset, buffer, offset, len);
|
||||
internalBuffer.Offset += len;
|
||||
internalBuffer.Size -= len;
|
||||
wantMore = !internalBuffer.Complete && len < size;
|
||||
return len;
|
||||
return (len, !internalBuffer.Complete && len < size);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -456,7 +465,7 @@ namespace Mono.Net.Security
|
||||
return InternalWrite (asyncRequest, writeBuffer, buffer, offset, size);
|
||||
} catch (Exception ex) {
|
||||
Debug ("InternalWrite failed: {0}", ex);
|
||||
SetException_internal (ex);
|
||||
SetException (GetIOException (ex, "InternalWrite() failed"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -511,22 +520,30 @@ namespace Mono.Net.Security
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Inner Stream
|
||||
#region Inner Stream
|
||||
|
||||
/*
|
||||
* Read / write data from the inner stream; we're only called from managed code and only manipulate
|
||||
* the internal buffers.
|
||||
*/
|
||||
internal int InnerRead (int requestedSize)
|
||||
internal async Task<int> InnerRead (bool sync, int requestedSize, CancellationToken cancellationToken)
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested ();
|
||||
Debug ("InnerRead: {0} {1} {2} {3}", readBuffer.Offset, readBuffer.Size, readBuffer.Remaining, requestedSize);
|
||||
|
||||
var len = System.Math.Min (readBuffer.Remaining, requestedSize);
|
||||
if (len == 0)
|
||||
throw new InvalidOperationException ();
|
||||
var ret = InnerStream.Read (readBuffer.Buffer, readBuffer.EndOffset, len);
|
||||
|
||||
Task<int> task;
|
||||
if (sync)
|
||||
task = Task.Run (() => InnerStream.Read (readBuffer.Buffer, readBuffer.EndOffset, len));
|
||||
else
|
||||
task = InnerStream.ReadAsync (readBuffer.Buffer, readBuffer.EndOffset, len, cancellationToken);
|
||||
|
||||
var ret = await task.ConfigureAwait (false);
|
||||
Debug ("InnerRead done: {0} {1} - {2}", readBuffer.Remaining, len, ret);
|
||||
|
||||
if (ret >= 0) {
|
||||
@@ -549,165 +566,126 @@ namespace Mono.Net.Security
|
||||
return ret;
|
||||
}
|
||||
|
||||
internal void InnerWrite ()
|
||||
internal async Task InnerWrite (bool sync, CancellationToken cancellationToken)
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested ();
|
||||
Debug ("InnerWrite: {0} {1}", writeBuffer.Offset, writeBuffer.Size);
|
||||
InnerFlush ();
|
||||
|
||||
if (writeBuffer.Size == 0)
|
||||
return;
|
||||
|
||||
Task task;
|
||||
if (sync)
|
||||
task = Task.Run (() => InnerStream.Write (writeBuffer.Buffer, writeBuffer.Offset, writeBuffer.Size));
|
||||
else
|
||||
task = InnerStream.WriteAsync (writeBuffer.Buffer, writeBuffer.Offset, writeBuffer.Size);
|
||||
|
||||
await task.ConfigureAwait (false);
|
||||
|
||||
writeBuffer.TotalBytes += writeBuffer.Size;
|
||||
writeBuffer.Offset = writeBuffer.Size = 0;
|
||||
}
|
||||
|
||||
internal void InnerFlush ()
|
||||
{
|
||||
if (writeBuffer.Size > 0) {
|
||||
InnerStream.Write (writeBuffer.Buffer, writeBuffer.Offset, writeBuffer.Size);
|
||||
writeBuffer.TotalBytes += writeBuffer.Size;
|
||||
writeBuffer.Offset = writeBuffer.Size = 0;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
#region Main async I/O loop
|
||||
|
||||
#region Main async I/O loop
|
||||
|
||||
AsyncOperationStatus ProcessHandshake (AsyncProtocolRequest asyncRequest, AsyncOperationStatus status)
|
||||
internal AsyncOperationStatus ProcessHandshake (AsyncOperationStatus status)
|
||||
{
|
||||
Debug ("ProcessHandshake: {0}", status);
|
||||
|
||||
/*
|
||||
* The first time we're called (AsyncOperationStatus.Initialize), we need to setup the SslContext and
|
||||
* start the handshake.
|
||||
*/
|
||||
if (status == AsyncOperationStatus.Initialize) {
|
||||
xobileTlsContext.StartHandshake ();
|
||||
return AsyncOperationStatus.Continue;
|
||||
} else if (status == AsyncOperationStatus.ReadDone) {
|
||||
// remote prematurely closed connection.
|
||||
throw new IOException ("Remote prematurely closed connection.");
|
||||
} else if (status != AsyncOperationStatus.Continue) {
|
||||
throw new InvalidOperationException ();
|
||||
}
|
||||
|
||||
/*
|
||||
* SSLHandshake() will return repeatedly with 'SslStatus.WouldBlock', we then need
|
||||
* to take care of I/O and call it again.
|
||||
*/
|
||||
if (!xobileTlsContext.ProcessHandshake ()) {
|
||||
lock (ioLock) {
|
||||
/*
|
||||
* Flush the internal write buffer.
|
||||
*/
|
||||
InnerFlush ();
|
||||
return AsyncOperationStatus.Continue;
|
||||
}
|
||||
* The first time we're called (AsyncOperationStatus.Initialize), we need to setup the SslContext and
|
||||
* start the handshake.
|
||||
*/
|
||||
if (status == AsyncOperationStatus.Initialize) {
|
||||
xobileTlsContext.StartHandshake ();
|
||||
return AsyncOperationStatus.Continue;
|
||||
} else if (status == AsyncOperationStatus.ReadDone) {
|
||||
throw new IOException (SR.net_auth_eof);
|
||||
} else if (status != AsyncOperationStatus.Continue) {
|
||||
throw new InvalidOperationException ();
|
||||
}
|
||||
|
||||
xobileTlsContext.FinishHandshake ();
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
|
||||
AsyncOperationStatus ProcessRead (AsyncProtocolRequest asyncRequest, AsyncOperationStatus status)
|
||||
{
|
||||
Debug ("ProcessRead - read user: {0} {1}", status, asyncRequest.UserBuffer);
|
||||
|
||||
int ret;
|
||||
bool wantMore;
|
||||
lock (ioLock) {
|
||||
ret = Context.Read (asyncRequest.UserBuffer.Buffer, asyncRequest.UserBuffer.Offset, asyncRequest.UserBuffer.Size, out wantMore);
|
||||
}
|
||||
Debug ("ProcessRead - read user done: {0} - {1} {2}", asyncRequest.UserBuffer, ret, wantMore);
|
||||
|
||||
if (ret < 0) {
|
||||
asyncRequest.UserResult = -1;
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
|
||||
asyncRequest.CurrentSize += ret;
|
||||
asyncRequest.UserBuffer.Offset += ret;
|
||||
asyncRequest.UserBuffer.Size -= ret;
|
||||
|
||||
Debug ("Process Read - read user done #1: {0} - {1} {2}", asyncRequest.UserBuffer, asyncRequest.CurrentSize, wantMore);
|
||||
|
||||
if (wantMore && asyncRequest.CurrentSize == 0)
|
||||
return AsyncOperationStatus.WantRead;
|
||||
|
||||
asyncRequest.ResetRead ();
|
||||
asyncRequest.UserResult = asyncRequest.CurrentSize;
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
|
||||
AsyncOperationStatus ProcessWrite (AsyncProtocolRequest asyncRequest, AsyncOperationStatus status)
|
||||
{
|
||||
Debug ("ProcessWrite - write user: {0} {1}", status, asyncRequest.UserBuffer);
|
||||
|
||||
if (asyncRequest.UserBuffer.Size == 0) {
|
||||
asyncRequest.UserResult = asyncRequest.CurrentSize;
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
|
||||
int ret;
|
||||
bool wantMore;
|
||||
lock (ioLock) {
|
||||
ret = Context.Write (asyncRequest.UserBuffer.Buffer, asyncRequest.UserBuffer.Offset, asyncRequest.UserBuffer.Size, out wantMore);
|
||||
}
|
||||
Debug ("ProcessWrite - write user done: {0} - {1} {2}", asyncRequest.UserBuffer, ret, wantMore);
|
||||
|
||||
if (ret < 0) {
|
||||
asyncRequest.UserResult = -1;
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
|
||||
asyncRequest.CurrentSize += ret;
|
||||
asyncRequest.UserBuffer.Offset += ret;
|
||||
asyncRequest.UserBuffer.Size -= ret;
|
||||
|
||||
if (wantMore || writeBuffer.Size > 0)
|
||||
return AsyncOperationStatus.WantWrite;
|
||||
|
||||
asyncRequest.ResetWrite ();
|
||||
asyncRequest.UserResult = asyncRequest.CurrentSize;
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
|
||||
AsyncOperationStatus ProcessClose (AsyncProtocolRequest asyncRequest, AsyncOperationStatus status)
|
||||
{
|
||||
Debug ("ProcessClose: {0}", status);
|
||||
|
||||
lock (ioLock) {
|
||||
if (xobileTlsContext == null)
|
||||
/*
|
||||
* SSLHandshake() will return repeatedly with 'SslStatus.WouldBlock', we then need
|
||||
* to take care of I/O and call it again.
|
||||
*/
|
||||
if (xobileTlsContext.ProcessHandshake ()) {
|
||||
xobileTlsContext.FinishHandshake ();
|
||||
return AsyncOperationStatus.Complete;
|
||||
|
||||
xobileTlsContext.Close ();
|
||||
xobileTlsContext = null;
|
||||
}
|
||||
return AsyncOperationStatus.Continue;
|
||||
}
|
||||
}
|
||||
|
||||
AsyncOperationStatus ProcessFlush (AsyncProtocolRequest asyncRequest, AsyncOperationStatus status)
|
||||
internal (int, bool) ProcessRead (BufferOffsetSize userBuffer)
|
||||
{
|
||||
Debug ("ProcessFlush: {0}", status);
|
||||
return AsyncOperationStatus.Complete;
|
||||
lock (ioLock) {
|
||||
// This operates on the internal buffer and will never block.
|
||||
var ret = xobileTlsContext.Read (userBuffer.Buffer, userBuffer.Offset, userBuffer.Size, out bool wantMore);
|
||||
return (ret, wantMore);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
internal (int, bool) ProcessWrite (BufferOffsetSize userBuffer)
|
||||
{
|
||||
lock (ioLock) {
|
||||
// This operates on the internal buffer and will never block.
|
||||
var ret = xobileTlsContext.Write (userBuffer.Buffer, userBuffer.Offset, userBuffer.Size, out bool wantMore);
|
||||
return (ret, wantMore);
|
||||
}
|
||||
}
|
||||
|
||||
internal AsyncOperationStatus ProcessShutdown (AsyncOperationStatus status)
|
||||
{
|
||||
Debug ("ProcessShutdown: {0}", status);
|
||||
|
||||
lock (ioLock) {
|
||||
xobileTlsContext.Shutdown ();
|
||||
shutdown = true;
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public override bool IsServer {
|
||||
get { return xobileTlsContext != null && xobileTlsContext.IsServer; }
|
||||
get {
|
||||
CheckThrow (false);
|
||||
return xobileTlsContext != null && xobileTlsContext.IsServer;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsAuthenticated {
|
||||
get { return xobileTlsContext != null && lastException == null && xobileTlsContext.IsAuthenticated; }
|
||||
get {
|
||||
lock (ioLock) {
|
||||
// Don't use CheckThrow(), we want to return false if we're not authenticated.
|
||||
return xobileTlsContext != null && lastException == null && xobileTlsContext.IsAuthenticated;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsMutuallyAuthenticated {
|
||||
get {
|
||||
return IsAuthenticated &&
|
||||
(Context.IsServer? Context.LocalServerCertificate: Context.LocalClientCertificate) != null &&
|
||||
Context.IsRemoteCertificateAvailable;
|
||||
lock (ioLock) {
|
||||
// Don't use CheckThrow() here.
|
||||
if (!IsAuthenticated)
|
||||
return false;
|
||||
if ((xobileTlsContext.IsServer ? xobileTlsContext.LocalServerCertificate : xobileTlsContext.LocalClientCertificate) == null)
|
||||
return false;
|
||||
return xobileTlsContext.IsRemoteCertificateAvailable;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
try {
|
||||
lastException = new ObjectDisposedException ("MobileAuthenticatedStream");
|
||||
lock (ioLock) {
|
||||
Debug ("Dispose: {0}", xobileTlsContext != null);
|
||||
lastException = ExceptionDispatchInfo.Capture (new ObjectDisposedException ("MobileAuthenticatedStream"));
|
||||
if (xobileTlsContext != null) {
|
||||
xobileTlsContext.Dispose ();
|
||||
xobileTlsContext = null;
|
||||
@@ -720,26 +698,53 @@ namespace Mono.Net.Security
|
||||
|
||||
public override void Flush ()
|
||||
{
|
||||
CheckThrow (true);
|
||||
var asyncRequest = new AsyncProtocolRequest (this, null);
|
||||
StartOperation (ref asyncWriteRequest, ref writeBuffer, ProcessFlush, asyncRequest, "flush");
|
||||
// Write() automatically flushes the underlying stream.
|
||||
}
|
||||
|
||||
public override void Close ()
|
||||
{
|
||||
/*
|
||||
* SSLClose() is a little bit tricky as it might attempt to send a close_notify alert
|
||||
* and thus call our write callback.
|
||||
*
|
||||
* It is also not thread-safe with SSLRead() or SSLWrite(), so we need to take the I/O lock here.
|
||||
*/
|
||||
if (Interlocked.Exchange (ref closeRequested, 1) == 1)
|
||||
return;
|
||||
if (xobileTlsContext == null)
|
||||
return;
|
||||
public SslProtocols SslProtocol {
|
||||
get {
|
||||
lock (ioLock) {
|
||||
CheckThrow (true);
|
||||
return (SslProtocols)xobileTlsContext.NegotiatedProtocol;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var asyncRequest = new AsyncProtocolRequest (this, null);
|
||||
StartOperation (ref asyncWriteRequest, ref writeBuffer, ProcessClose, asyncRequest, "close");
|
||||
public X509Certificate RemoteCertificate {
|
||||
get {
|
||||
lock (ioLock) {
|
||||
CheckThrow (true);
|
||||
return xobileTlsContext.RemoteCertificate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public X509Certificate LocalCertificate {
|
||||
get {
|
||||
lock (ioLock) {
|
||||
CheckThrow (true);
|
||||
return InternalLocalCertificate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public X509Certificate InternalLocalCertificate {
|
||||
get {
|
||||
lock (ioLock) {
|
||||
CheckThrow (false);
|
||||
if (xobileTlsContext == null)
|
||||
return null;
|
||||
return xobileTlsContext.IsServer ? xobileTlsContext.LocalServerCertificate : xobileTlsContext.LocalClientCertificate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public MSI.MonoTlsConnectionInfo GetConnectionInfo ()
|
||||
{
|
||||
lock (ioLock) {
|
||||
CheckThrow (true);
|
||||
return xobileTlsContext.ConnectionInfo;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
@@ -769,7 +774,7 @@ namespace Mono.Net.Security
|
||||
}
|
||||
|
||||
public override bool CanWrite {
|
||||
get { return IsAuthenticated & InnerStream.CanWrite; }
|
||||
get { return IsAuthenticated & InnerStream.CanWrite && !shutdown; }
|
||||
}
|
||||
|
||||
public override bool CanSeek {
|
||||
@@ -803,46 +808,10 @@ namespace Mono.Net.Security
|
||||
set { InnerStream.WriteTimeout = value; }
|
||||
}
|
||||
|
||||
public SslProtocols SslProtocol {
|
||||
get {
|
||||
CheckThrow (true);
|
||||
return (SslProtocols)Context.NegotiatedProtocol;
|
||||
}
|
||||
}
|
||||
|
||||
public X509Certificate RemoteCertificate {
|
||||
get {
|
||||
CheckThrow (true);
|
||||
return Context.RemoteCertificate;
|
||||
}
|
||||
}
|
||||
|
||||
public X509Certificate LocalCertificate {
|
||||
get {
|
||||
CheckThrow (true);
|
||||
return InternalLocalCertificate;
|
||||
}
|
||||
}
|
||||
|
||||
public X509Certificate InternalLocalCertificate {
|
||||
get {
|
||||
CheckThrow (false);
|
||||
if (!HasContext)
|
||||
return null;
|
||||
return Context.IsServer ? Context.LocalServerCertificate : Context.LocalClientCertificate;
|
||||
}
|
||||
}
|
||||
|
||||
public MSI.MonoTlsConnectionInfo GetConnectionInfo ()
|
||||
{
|
||||
CheckThrow (true);
|
||||
return Context.ConnectionInfo;
|
||||
}
|
||||
|
||||
public SSA.CipherAlgorithmType CipherAlgorithm {
|
||||
get {
|
||||
CheckThrow (true);
|
||||
var info = Context.ConnectionInfo;
|
||||
var info = GetConnectionInfo ();
|
||||
if (info == null)
|
||||
return SSA.CipherAlgorithmType.None;
|
||||
switch (info.CipherAlgorithmType) {
|
||||
@@ -861,7 +830,7 @@ namespace Mono.Net.Security
|
||||
public SSA.HashAlgorithmType HashAlgorithm {
|
||||
get {
|
||||
CheckThrow (true);
|
||||
var info = Context.ConnectionInfo;
|
||||
var info = GetConnectionInfo ();
|
||||
if (info == null)
|
||||
return SSA.HashAlgorithmType.None;
|
||||
switch (info.HashAlgorithmType) {
|
||||
@@ -883,7 +852,7 @@ namespace Mono.Net.Security
|
||||
public SSA.ExchangeAlgorithmType KeyExchangeAlgorithm {
|
||||
get {
|
||||
CheckThrow (true);
|
||||
var info = Context.ConnectionInfo;
|
||||
var info = GetConnectionInfo ();
|
||||
if (info == null)
|
||||
return SSA.ExchangeAlgorithmType.None;
|
||||
switch (info.ExchangeAlgorithmType) {
|
||||
@@ -898,7 +867,7 @@ namespace Mono.Net.Security
|
||||
}
|
||||
}
|
||||
|
||||
#region Need to Implement
|
||||
#region Need to Implement
|
||||
public int CipherStrength {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
@@ -920,7 +889,7 @@ namespace Mono.Net.Security
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -169,7 +169,7 @@ namespace Mono.Net.Security
|
||||
|
||||
public abstract int Write (byte[] buffer, int offset, int count, out bool wantMore);
|
||||
|
||||
public abstract void Close ();
|
||||
public abstract void Shutdown ();
|
||||
|
||||
protected bool ValidateCertificate (X509Certificate leaf, X509Chain chain)
|
||||
{
|
||||
|
||||
@@ -83,6 +83,8 @@ namespace Mono.Net.Security
|
||||
if (initialized)
|
||||
return;
|
||||
|
||||
InitializeProviderRegistration ();
|
||||
|
||||
MSI.MonoTlsProvider provider;
|
||||
try {
|
||||
provider = CreateDefaultProviderImpl ();
|
||||
|
||||
@@ -9,6 +9,8 @@ partial class SR
|
||||
{
|
||||
public const string mono_net_io_shutdown = "mono_net_io_shutdown";
|
||||
public const string mono_net_io_renegotiate = "mono_net_io_renegotiate";
|
||||
|
||||
public const string net_ssl_io_already_shutdown = "Write operations are not allowed after the channel was shutdown.";
|
||||
|
||||
public const string net_log_set_socketoption_reuseport_default_on = "net_log_set_socketoption_reuseport_default_on";
|
||||
public const string net_log_set_socketoption_reuseport_not_supported = "net_log_set_socketoption_reuseport_not_supported";
|
||||
|
||||
@@ -46,6 +46,7 @@ namespace System.ComponentModel
|
||||
case 32: /* ERROR_SHARING_VIOLATION */ return "Sharing violation";
|
||||
case 33: /* ERROR_LOCK_VIOLATION */ return "Lock violation";
|
||||
case 50: /* ERROR_NOT_SUPPORTED */ return "Operation not supported";
|
||||
case 55: /* ERROR_DEV_NOT_EXIST */ return "Device does not exist";
|
||||
case 87: /* ERROR_INVALID_PARAMETER */ return "Invalid parameter";
|
||||
case 120: /* ERROR_CALL_NOT_IMPLEMENTED */ return "Call not implemented";
|
||||
case 123: /* ERROR_INVALID_NAME */ return "Invalid name";
|
||||
@@ -142,7 +143,6 @@ namespace System.ComponentModel
|
||||
case 52: /* ERROR_DUP_NAME */ return "Duplicate name";
|
||||
case 53: /* ERROR_BAD_NETPATH */ return "Bad netpath";
|
||||
case 54: /* ERROR_NETWORK_BUSY */ return "Network busy";
|
||||
case 55: /* ERROR_DEV_NOT_EXIST */ return "Device does not exist";
|
||||
case 56: /* ERROR_TOO_MANY_CMDS */ return "Too many commands";
|
||||
case 57: /* ERROR_ADAP_HDW_ERR */ return "ADAP HDW error";
|
||||
case 58: /* ERROR_BAD_NET_RESP */ return "Bad net response";
|
||||
|
||||
@@ -61,8 +61,10 @@ namespace System.Net.Configuration
|
||||
properties = new ConfigurationPropertyCollection ();
|
||||
|
||||
properties.Add (bypassListProp);
|
||||
properties.Add (enabledProp);
|
||||
properties.Add (moduleProp);
|
||||
properties.Add (proxyProp);
|
||||
properties.Add (useDefaultCredentialsProp);
|
||||
}
|
||||
|
||||
public DefaultProxySection ()
|
||||
|
||||
@@ -62,6 +62,7 @@ namespace System.Net.Configuration
|
||||
|
||||
properties = new ConfigurationPropertyCollection ();
|
||||
|
||||
properties.Add (autoDetectProp);
|
||||
properties.Add (bypassOnLocalProp);
|
||||
properties.Add (proxyAddressProp);
|
||||
properties.Add (scriptLocationProp);
|
||||
|
||||
@@ -207,17 +207,6 @@ namespace System.Net.NetworkInformation {
|
||||
return Send (addresses [0], timeout, buffer, options);
|
||||
}
|
||||
|
||||
static IPAddress GetNonLoopbackIPV4 ()
|
||||
{
|
||||
#pragma warning disable 618
|
||||
foreach (IPAddress addr in Dns.GetHostByName (Dns.GetHostName ()).AddressList)
|
||||
if (!IPAddress.IsLoopback (addr) && addr.AddressFamily == AddressFamily.InterNetwork)
|
||||
return addr;
|
||||
#pragma warning restore 618
|
||||
|
||||
throw new InvalidOperationException ("Could not resolve non-loopback IP address for localhost");
|
||||
}
|
||||
|
||||
public PingReply Send (IPAddress address, int timeout, byte [] buffer, PingOptions options)
|
||||
{
|
||||
if (address == null)
|
||||
@@ -243,8 +232,7 @@ namespace System.Net.NetworkInformation {
|
||||
private PingReply SendPrivileged (IPAddress address, int timeout, byte [] buffer, PingOptions options)
|
||||
{
|
||||
IPEndPoint target = new IPEndPoint (address, 0);
|
||||
IPEndPoint client = new IPEndPoint (GetNonLoopbackIPV4 (), 0);
|
||||
|
||||
|
||||
// FIXME: support IPv6
|
||||
using (Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.Icmp)) {
|
||||
if (options != null) {
|
||||
@@ -264,7 +252,7 @@ namespace System.Net.NetworkInformation {
|
||||
// receive
|
||||
bytes = new byte [100];
|
||||
do {
|
||||
EndPoint endpoint = client;
|
||||
EndPoint endpoint = target;
|
||||
SocketError error = 0;
|
||||
int rc = s.ReceiveFrom (bytes, 0, 100, SocketFlags.None,
|
||||
ref endpoint, out error);
|
||||
|
||||
@@ -223,6 +223,11 @@ namespace System.Net.Security
|
||||
return Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
|
||||
}
|
||||
|
||||
public virtual Task ShutdownAsync ()
|
||||
{
|
||||
return Impl.ShutdownAsync ();
|
||||
}
|
||||
|
||||
public override bool IsAuthenticated {
|
||||
get { return Impl.IsAuthenticated; }
|
||||
}
|
||||
|
||||
@@ -152,6 +152,11 @@ namespace System.Net.Security
|
||||
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
|
||||
}
|
||||
|
||||
public virtual Task ShutdownAsync ()
|
||||
{
|
||||
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
|
||||
}
|
||||
|
||||
public override bool IsAuthenticated {
|
||||
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
|
||||
}
|
||||
|
||||
@@ -976,60 +976,7 @@ namespace System.Net.Sockets
|
||||
EndPoint = remoteEP,
|
||||
};
|
||||
|
||||
// Bug #75154: Connect() should not succeed for .Any addresses.
|
||||
if (remoteEP is IPEndPoint) {
|
||||
IPEndPoint ep = (IPEndPoint) remoteEP;
|
||||
if (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any)) {
|
||||
sockares.Complete (new SocketException ((int) SocketError.AddressNotAvailable), true);
|
||||
return sockares;
|
||||
}
|
||||
|
||||
sockares.EndPoint = remoteEP = RemapIPEndPoint (ep);
|
||||
}
|
||||
|
||||
int error = 0;
|
||||
|
||||
if (connect_in_progress) {
|
||||
// This could happen when multiple IPs are used
|
||||
// Calling connect() again will reset the connection attempt and cause
|
||||
// an error. Better to just close the socket and move on.
|
||||
connect_in_progress = false;
|
||||
m_Handle.Dispose ();
|
||||
m_Handle = new SafeSocketHandle (Socket_internal (addressFamily, socketType, protocolType, out error), true);
|
||||
if (error != 0)
|
||||
throw new SocketException (error);
|
||||
}
|
||||
|
||||
bool blk = is_blocking;
|
||||
if (blk)
|
||||
Blocking = false;
|
||||
Connect_internal (m_Handle, remoteEP.Serialize (), out error, false);
|
||||
if (blk)
|
||||
Blocking = true;
|
||||
|
||||
if (error == 0) {
|
||||
// succeeded synch
|
||||
is_connected = true;
|
||||
is_bound = true;
|
||||
sockares.Complete (true);
|
||||
return sockares;
|
||||
}
|
||||
|
||||
if (error != (int) SocketError.InProgress && error != (int) SocketError.WouldBlock) {
|
||||
// error synch
|
||||
is_connected = false;
|
||||
is_bound = false;
|
||||
sockares.Complete (new SocketException (error), true);
|
||||
return sockares;
|
||||
}
|
||||
|
||||
// continue asynch
|
||||
is_connected = false;
|
||||
is_bound = false;
|
||||
connect_in_progress = true;
|
||||
|
||||
IOSelector.Add (sockares.Handle, new IOSelectorJob (IOOperation.Write, BeginConnectCallback, sockares));
|
||||
|
||||
BeginSConnect (sockares);
|
||||
return sockares;
|
||||
}
|
||||
|
||||
@@ -1055,39 +1002,85 @@ namespace System.Net.Sockets
|
||||
|
||||
is_connected = false;
|
||||
|
||||
return BeginMConnect (sockares);
|
||||
BeginMConnect (sockares);
|
||||
return sockares;
|
||||
}
|
||||
|
||||
internal IAsyncResult BeginMConnect (SocketAsyncResult sockares)
|
||||
static void BeginMConnect (SocketAsyncResult sockares)
|
||||
{
|
||||
SocketAsyncResult ares = null;
|
||||
Exception exc = null;
|
||||
AsyncCallback callback;
|
||||
|
||||
for (int i = sockares.CurrentAddress; i < sockares.Addresses.Length; i++) {
|
||||
try {
|
||||
sockares.CurrentAddress++;
|
||||
sockares.EndPoint = new IPEndPoint (sockares.Addresses [i], sockares.Port);
|
||||
|
||||
ares = (SocketAsyncResult) BeginConnect (new IPEndPoint (sockares.Addresses [i], sockares.Port), null, sockares);
|
||||
if (ares.IsCompleted && ares.CompletedSynchronously) {
|
||||
ares.CheckIfThrowDelayedException ();
|
||||
|
||||
callback = ares.AsyncCallback;
|
||||
if (callback != null)
|
||||
ThreadPool.UnsafeQueueUserWorkItem (_ => callback (ares), null);
|
||||
}
|
||||
|
||||
break;
|
||||
BeginSConnect (sockares);
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
exc = e;
|
||||
ares = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (ares == null)
|
||||
throw exc;
|
||||
throw exc;
|
||||
}
|
||||
|
||||
return sockares;
|
||||
static void BeginSConnect (SocketAsyncResult sockares)
|
||||
{
|
||||
EndPoint remoteEP = sockares.EndPoint;
|
||||
// Bug #75154: Connect() should not succeed for .Any addresses.
|
||||
if (remoteEP is IPEndPoint) {
|
||||
IPEndPoint ep = (IPEndPoint) remoteEP;
|
||||
if (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any)) {
|
||||
sockares.Complete (new SocketException ((int) SocketError.AddressNotAvailable), true);
|
||||
return;
|
||||
}
|
||||
|
||||
sockares.EndPoint = remoteEP = sockares.socket.RemapIPEndPoint (ep);
|
||||
}
|
||||
|
||||
int error = 0;
|
||||
|
||||
if (sockares.socket.connect_in_progress) {
|
||||
// This could happen when multiple IPs are used
|
||||
// Calling connect() again will reset the connection attempt and cause
|
||||
// an error. Better to just close the socket and move on.
|
||||
sockares.socket.connect_in_progress = false;
|
||||
sockares.socket.m_Handle.Dispose ();
|
||||
sockares.socket.m_Handle = new SafeSocketHandle (sockares.socket.Socket_internal (sockares.socket.addressFamily, sockares.socket.socketType, sockares.socket.protocolType, out error), true);
|
||||
if (error != 0)
|
||||
throw new SocketException (error);
|
||||
}
|
||||
|
||||
bool blk = sockares.socket.is_blocking;
|
||||
if (blk)
|
||||
sockares.socket.Blocking = false;
|
||||
Connect_internal (sockares.socket.m_Handle, remoteEP.Serialize (), out error, false);
|
||||
if (blk)
|
||||
sockares.socket.Blocking = true;
|
||||
|
||||
if (error == 0) {
|
||||
// succeeded synch
|
||||
sockares.socket.is_connected = true;
|
||||
sockares.socket.is_bound = true;
|
||||
sockares.Complete (true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (error != (int) SocketError.InProgress && error != (int) SocketError.WouldBlock) {
|
||||
// error synch
|
||||
sockares.socket.is_connected = false;
|
||||
sockares.socket.is_bound = false;
|
||||
sockares.Complete (new SocketException (error), true);
|
||||
return;
|
||||
}
|
||||
|
||||
// continue asynch
|
||||
sockares.socket.is_connected = false;
|
||||
sockares.socket.is_bound = false;
|
||||
sockares.socket.connect_in_progress = true;
|
||||
|
||||
IOSelector.Add (sockares.Handle, new IOSelectorJob (IOOperation.Write, BeginConnectCallback, sockares));
|
||||
}
|
||||
|
||||
static IOAsyncCallback BeginConnectCallback = new IOAsyncCallback (ares => {
|
||||
@@ -1098,18 +1091,11 @@ namespace System.Net.Sockets
|
||||
return;
|
||||
}
|
||||
|
||||
SocketAsyncResult mconnect = sockares.AsyncState as SocketAsyncResult;
|
||||
bool is_mconnect = mconnect != null && mconnect.Addresses != null;
|
||||
|
||||
try {
|
||||
EndPoint ep = sockares.EndPoint;
|
||||
int error_code = (int) sockares.socket.GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error);
|
||||
int error = (int) sockares.socket.GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error);
|
||||
|
||||
if (error_code == 0) {
|
||||
if (is_mconnect)
|
||||
sockares = mconnect;
|
||||
|
||||
sockares.socket.seed_endpoint = ep;
|
||||
if (error == 0) {
|
||||
sockares.socket.seed_endpoint = sockares.EndPoint;
|
||||
sockares.socket.is_connected = true;
|
||||
sockares.socket.is_bound = true;
|
||||
sockares.socket.connect_in_progress = false;
|
||||
@@ -1118,26 +1104,21 @@ namespace System.Net.Sockets
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_mconnect) {
|
||||
if (sockares.Addresses == null) {
|
||||
sockares.socket.connect_in_progress = false;
|
||||
sockares.Complete (new SocketException (error_code));
|
||||
sockares.Complete (new SocketException (error));
|
||||
return;
|
||||
}
|
||||
|
||||
if (mconnect.CurrentAddress >= mconnect.Addresses.Length) {
|
||||
mconnect.Complete (new SocketException (error_code));
|
||||
if (sockares.CurrentAddress >= sockares.Addresses.Length) {
|
||||
sockares.Complete (new SocketException (error));
|
||||
return;
|
||||
}
|
||||
|
||||
mconnect.socket.BeginMConnect (mconnect);
|
||||
BeginMConnect (sockares);
|
||||
} catch (Exception e) {
|
||||
sockares.socket.connect_in_progress = false;
|
||||
|
||||
if (is_mconnect)
|
||||
sockares = mconnect;
|
||||
|
||||
sockares.Complete (e);
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Loaded 100 of 500 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user