zeroc-ice 3.8.1 → 3.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/dist/IceRuby/Operation.cpp +22 -6
- data/dist/ice/cpp/include/Ice/Config.h +2 -2
- data/dist/ice/cpp/include/Ice/LocalExceptions.h +21 -0
- data/dist/ice/cpp/include/Ice/OutputStream.h +7 -5
- data/dist/ice/cpp/include/generated/Ice/BuiltinSequences.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Context.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/EndpointTypes.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Identity.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Locator.h +9 -11
- data/dist/ice/cpp/include/generated/Ice/LocatorRegistry.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Metrics.h +7 -7
- data/dist/ice/cpp/include/generated/Ice/OperationMode.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Process.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/PropertiesAdmin.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/PropertyDict.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/RemoteLogger.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/ReplyStatus.h +8 -4
- data/dist/ice/cpp/include/generated/Ice/Router.h +7 -7
- data/dist/ice/cpp/include/generated/Ice/SliceChecksumDict.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Version.h +2 -2
- data/dist/ice/cpp/include/generated/IceDiscovery/Lookup.h +2 -2
- data/dist/ice/cpp/include/generated/IceLocatorDiscovery/Lookup.h +2 -2
- data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.cpp +5 -3
- data/dist/ice/cpp/src/Ice/ConnectionI.cpp +27 -9
- data/dist/ice/cpp/src/Ice/ConnectionI.h +1 -1
- data/dist/ice/cpp/src/Ice/FileUtil.cpp +3 -67
- data/dist/ice/cpp/src/Ice/FileUtil.h +0 -3
- data/dist/ice/cpp/src/Ice/IPEndpointI.cpp +4 -0
- data/dist/ice/cpp/src/Ice/IncomingRequest.cpp +1 -1
- data/dist/ice/cpp/src/Ice/InputStream.cpp +28 -15
- data/dist/ice/cpp/src/Ice/LocalExceptions.cpp +6 -0
- data/dist/ice/cpp/src/Ice/OutgoingAsync.cpp +1 -1
- data/dist/ice/cpp/src/Ice/OutgoingResponse.cpp +127 -127
- data/dist/ice/cpp/src/Ice/OutgoingResponseInternal.h +21 -0
- data/dist/ice/cpp/src/Ice/OutputStream.cpp +46 -61
- data/dist/ice/cpp/src/Ice/PropertyNames.cpp +2 -1
- data/dist/ice/cpp/src/Ice/ProxyFunctions.cpp +4 -4
- data/dist/ice/cpp/src/Ice/Reference.cpp +15 -15
- data/dist/ice/cpp/src/Ice/ReferenceFactory.cpp +16 -13
- data/dist/ice/cpp/src/Ice/ResourceConfig.h +2 -2
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.cpp +12 -11
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.h +1 -2
- data/dist/ice/cpp/src/Ice/SSL/SSLEndpointI.cpp +1 -1
- data/dist/ice/cpp/src/Ice/SSL/SSLEngine.h +1 -4
- data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.cpp +50 -43
- data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.h +1 -5
- data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.cpp +9 -0
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.cpp +107 -14
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.h +7 -2
- data/dist/ice/cpp/src/Ice/TcpEndpointI.cpp +2 -2
- data/dist/ice/cpp/src/Ice/UdpEndpointI.cpp +2 -2
- data/dist/ice/cpp/src/Ice/WSAcceptor.cpp +8 -3
- data/dist/ice/cpp/src/Ice/WSAcceptor.h +5 -1
- data/dist/ice/cpp/src/Ice/WSEndpoint.cpp +45 -2
- data/dist/ice/cpp/src/Ice/WSTransceiver.cpp +118 -7
- data/dist/ice/cpp/src/Ice/WSTransceiver.h +12 -1
- data/dist/ice/cpp/src/Ice/generated/BuiltinSequences.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Context.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/EndpointTypes.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Identity.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Locator.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/LocatorRegistry.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Metrics.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/OperationMode.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Process.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/PropertiesAdmin.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/PropertyDict.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/RemoteLogger.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/ReplyStatus.cpp +4 -2
- data/dist/ice/cpp/src/Ice/generated/Router.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/SliceChecksumDict.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Version.cpp +2 -2
- data/dist/ice/cpp/src/IceDiscovery/generated/Lookup.cpp +2 -2
- data/dist/ice/cpp/src/IceLocatorDiscovery/generated/Lookup.cpp +2 -2
- data/dist/ice/cpp/src/Slice/DocCommentParser.cpp +6 -6
- data/dist/ice/cpp/src/Slice/DocCommentParser.h +4 -2
- data/dist/ice/cpp/src/Slice/MetadataValidation.cpp +24 -5
- data/dist/ice/cpp/src/Slice/MetadataValidation.h +3 -2
- data/dist/ice/cpp/src/Slice/Parser.cpp +117 -77
- data/dist/ice/cpp/src/Slice/Parser.h +19 -4
- data/dist/ice/cpp/src/Slice/Preprocessor.cpp +75 -19
- data/dist/ice/cpp/src/Slice/Preprocessor.h +0 -1
- data/dist/ice/cpp/src/Slice/SliceUtil.cpp +6 -58
- data/dist/ice/cpp/src/Slice/Util.h +0 -3
- data/dist/ice/cpp/src/slice2rb/RubyUtil.cpp +10 -8
- data/dist/ice/cpp/src/slice2rb/RubyUtil.h +10 -13
- data/dist/ice/slice/Ice/Identity.ice +3 -0
- data/dist/ice/slice/Ice/Locator.ice +6 -5
- data/dist/ice/slice/Ice/LocatorRegistry.ice +3 -0
- data/dist/ice/slice/Ice/Metrics.ice +1 -1
- data/dist/ice/slice/Ice/OperationMode.ice +8 -0
- data/dist/ice/slice/Ice/Process.ice +3 -0
- data/dist/ice/slice/Ice/ReplyStatus.ice +13 -0
- data/dist/lib/Glacier2/Metrics.rb +1 -1
- data/dist/lib/Glacier2/PermissionsVerifier.rb +3 -3
- data/dist/lib/Glacier2/Router.rb +8 -8
- data/dist/lib/Glacier2/SSLInfo.rb +1 -1
- data/dist/lib/Glacier2/Session.rb +15 -15
- data/dist/lib/Ice/BuiltinSequences.rb +1 -1
- data/dist/lib/Ice/Context.rb +1 -1
- data/dist/lib/Ice/EndpointTypes.rb +1 -1
- data/dist/lib/Ice/Identity.rb +1 -1
- data/dist/lib/Ice/LocalExceptions.rb +3 -0
- data/dist/lib/Ice/Locator.rb +5 -5
- data/dist/lib/Ice/LocatorRegistry.rb +4 -4
- data/dist/lib/Ice/Metrics.rb +7 -7
- data/dist/lib/Ice/OperationMode.rb +1 -1
- data/dist/lib/Ice/Process.rb +3 -3
- data/dist/lib/Ice/PropertiesAdmin.rb +4 -4
- data/dist/lib/Ice/PropertyDict.rb +1 -1
- data/dist/lib/Ice/ProxyFunctions.rb +8 -4
- data/dist/lib/Ice/RemoteLogger.rb +6 -6
- data/dist/lib/Ice/ReplyStatus.rb +3 -2
- data/dist/lib/Ice/Router.rb +5 -5
- data/dist/lib/Ice/SliceChecksumDict.rb +1 -1
- data/dist/lib/Ice/Version.rb +1 -1
- data/dist/lib/IceBox/ServiceManager.rb +8 -8
- data/dist/lib/IceGrid/Admin.rb +83 -83
- data/dist/lib/IceGrid/Descriptor.rb +1 -1
- data/dist/lib/IceGrid/Exception.rb +1 -1
- data/dist/lib/IceGrid/FileParser.rb +2 -2
- data/dist/lib/IceGrid/Registry.rb +13 -13
- data/dist/lib/IceGrid/Session.rb +6 -6
- data/dist/lib/IceGrid/UserAccountMapper.rb +2 -2
- data/dist/lib/IceStorm/IceStorm.rb +16 -16
- data/dist/lib/IceStorm/Metrics.rb +1 -1
- data/ice.gemspec +1 -1
- metadata +2 -1
|
@@ -9,21 +9,80 @@
|
|
|
9
9
|
#include "Util.h"
|
|
10
10
|
#include <algorithm>
|
|
11
11
|
#include <cassert>
|
|
12
|
+
#include <cerrno>
|
|
12
13
|
#include <cstring>
|
|
14
|
+
#include <fcntl.h>
|
|
13
15
|
#include <fstream>
|
|
14
16
|
#include <iterator>
|
|
15
17
|
#include <sys/stat.h>
|
|
16
18
|
#include <sys/types.h>
|
|
17
19
|
#include <vector>
|
|
18
20
|
|
|
19
|
-
#
|
|
21
|
+
#ifdef _WIN32
|
|
22
|
+
# include <io.h>
|
|
23
|
+
# include <share.h>
|
|
24
|
+
#else
|
|
20
25
|
# include <sys/wait.h>
|
|
26
|
+
# include <unistd.h>
|
|
21
27
|
#endif
|
|
22
28
|
|
|
23
29
|
using namespace std;
|
|
24
30
|
using namespace Slice;
|
|
25
31
|
using namespace IceInternal;
|
|
26
32
|
|
|
33
|
+
namespace
|
|
34
|
+
{
|
|
35
|
+
// Atomically create and open a new file for read/write, failing if the file already exists or, on POSIX, if the
|
|
36
|
+
// path resolves to a symlink. This avoids the TOCTOU race that a name-then-open sequence would otherwise expose
|
|
37
|
+
// to a local attacker who could plant a symlink at the generated path.
|
|
38
|
+
#ifdef _WIN32
|
|
39
|
+
FILE* openExclusive(const wchar_t* path)
|
|
40
|
+
{
|
|
41
|
+
int fd = -1;
|
|
42
|
+
// _O_TEMPORARY tells the CRT to delete the file when the last file descriptor is closed -- this avoids the
|
|
43
|
+
// need for a separate, racy unlink-by-name in close().
|
|
44
|
+
if (::_wsopen_s(
|
|
45
|
+
&fd,
|
|
46
|
+
path,
|
|
47
|
+
_O_RDWR | _O_CREAT | _O_EXCL | _O_BINARY | _O_TEMPORARY,
|
|
48
|
+
_SH_DENYRW,
|
|
49
|
+
_S_IREAD | _S_IWRITE) != 0)
|
|
50
|
+
{
|
|
51
|
+
return nullptr;
|
|
52
|
+
}
|
|
53
|
+
FILE* fp = ::_fdopen(fd, "w+");
|
|
54
|
+
if (!fp)
|
|
55
|
+
{
|
|
56
|
+
::_close(fd);
|
|
57
|
+
}
|
|
58
|
+
return fp;
|
|
59
|
+
}
|
|
60
|
+
#else
|
|
61
|
+
FILE* openExclusive(const char* path)
|
|
62
|
+
{
|
|
63
|
+
int fd = ::open(path, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW, S_IRUSR | S_IWUSR);
|
|
64
|
+
if (fd == -1)
|
|
65
|
+
{
|
|
66
|
+
return nullptr;
|
|
67
|
+
}
|
|
68
|
+
// Unlink immediately so the file is anonymous: the inode survives via our descriptor and the kernel
|
|
69
|
+
// releases it on close. ENOENT means another process already removed the entry, leaving us in the same
|
|
70
|
+
// state; any other unlink error is fatal because the caller has no path to retry cleanup.
|
|
71
|
+
if (::unlink(path) != 0 && errno != ENOENT)
|
|
72
|
+
{
|
|
73
|
+
::close(fd);
|
|
74
|
+
return nullptr;
|
|
75
|
+
}
|
|
76
|
+
FILE* fp = ::fdopen(fd, "w+");
|
|
77
|
+
if (!fp)
|
|
78
|
+
{
|
|
79
|
+
::close(fd);
|
|
80
|
+
}
|
|
81
|
+
return fp;
|
|
82
|
+
}
|
|
83
|
+
#endif
|
|
84
|
+
}
|
|
85
|
+
|
|
27
86
|
//
|
|
28
87
|
// mcpp defines
|
|
29
88
|
//
|
|
@@ -201,32 +260,32 @@ Slice::Preprocessor::preprocess(const string& languageArg)
|
|
|
201
260
|
//
|
|
202
261
|
#ifdef _WIN32
|
|
203
262
|
//
|
|
204
|
-
// We use an unique id as the tmp file name prefix to avoid
|
|
205
|
-
//
|
|
206
|
-
//
|
|
207
|
-
//
|
|
208
|
-
//
|
|
263
|
+
// We use an unique id as the tmp file name prefix to avoid problems with this code being called concurrently
|
|
264
|
+
// from several processes, otherwise there is a chance that two processes call _wtempnam before any of them
|
|
265
|
+
// opens the file and they will end up using the same tmp file. We then open the file with O_EXCL to atomically
|
|
266
|
+
// create it -- this closes the TOCTOU window between _wtempnam returning a name and our opening it. The
|
|
267
|
+
// _O_TEMPORARY flag inside openExclusive causes the file to be deleted automatically when the descriptor is
|
|
268
|
+
// closed, so we don't need to retain the path past this point.
|
|
209
269
|
//
|
|
210
270
|
wchar_t* name = _wtempnam(0, Ice::stringToWstring("slice-" + Ice::generateUUID()).c_str());
|
|
211
271
|
if (name)
|
|
212
272
|
{
|
|
213
|
-
|
|
273
|
+
_cppHandle = openExclusive(name);
|
|
214
274
|
free(name);
|
|
215
|
-
_cppHandle = IceInternal::fopen(_cppFile, "w+");
|
|
216
275
|
}
|
|
217
276
|
#else
|
|
218
277
|
_cppHandle = tmpfile();
|
|
219
278
|
#endif
|
|
220
279
|
|
|
221
|
-
// If that fails try to open file in current directory.
|
|
280
|
+
// If that fails try to open file in current directory. openExclusive immediately unlinks the file on POSIX
|
|
281
|
+
// and sets _O_TEMPORARY on Windows, so the path is only used during the open attempt.
|
|
222
282
|
if (_cppHandle == nullptr)
|
|
223
283
|
{
|
|
224
284
|
#ifdef _WIN32
|
|
225
|
-
|
|
285
|
+
_cppHandle = openExclusive(Ice::stringToWstring("slice-" + Ice::generateUUID()).c_str());
|
|
226
286
|
#else
|
|
227
|
-
|
|
287
|
+
_cppHandle = openExclusive((".slice-" + Ice::generateUUID()).c_str());
|
|
228
288
|
#endif
|
|
229
|
-
_cppHandle = IceInternal::fopen(_cppFile, "w+");
|
|
230
289
|
}
|
|
231
290
|
|
|
232
291
|
if (_cppHandle != nullptr)
|
|
@@ -241,7 +300,7 @@ Slice::Preprocessor::preprocess(const string& languageArg)
|
|
|
241
300
|
{
|
|
242
301
|
// Calling this again causes the memory buffers to be freed.
|
|
243
302
|
mcpp_use_mem_buffers(1);
|
|
244
|
-
throw runtime_error(_path + ": error: could not open temporary file
|
|
303
|
+
throw runtime_error(_path + ": error: could not open temporary file for preprocessor output");
|
|
245
304
|
}
|
|
246
305
|
}
|
|
247
306
|
|
|
@@ -256,14 +315,11 @@ Slice::Preprocessor::close()
|
|
|
256
315
|
{
|
|
257
316
|
if (_cppHandle != nullptr)
|
|
258
317
|
{
|
|
318
|
+
// The temp file deletes itself when the descriptor is closed. On POSIX, tmpfile() returns an
|
|
319
|
+
// already-unlinked file and the CWD fallback unlinks after open; on Windows, openExclusive opens
|
|
320
|
+
// with _O_TEMPORARY. fclose is the only cleanup needed.
|
|
259
321
|
int status = fclose(_cppHandle);
|
|
260
322
|
_cppHandle = nullptr;
|
|
261
|
-
|
|
262
|
-
if (_cppFile.size() != 0)
|
|
263
|
-
{
|
|
264
|
-
IceInternal::unlink(_cppFile);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
323
|
if (status != 0)
|
|
268
324
|
{
|
|
269
325
|
throw runtime_error("failed to close preprocessor file: " + IceInternal::lastErrorToString());
|
|
@@ -489,7 +489,7 @@ Slice::getArticleFor(const string& s)
|
|
|
489
489
|
return (vowels.find_first_of(s[0]) != string::npos) ? "an" : "a";
|
|
490
490
|
}
|
|
491
491
|
|
|
492
|
-
|
|
492
|
+
string
|
|
493
493
|
Slice::pluralKindOf(const ContainedPtr& p)
|
|
494
494
|
{
|
|
495
495
|
string kindOf = p->kindOf();
|
|
@@ -507,58 +507,6 @@ Slice::pluralKindOf(const ContainedPtr& p)
|
|
|
507
507
|
}
|
|
508
508
|
}
|
|
509
509
|
|
|
510
|
-
bool
|
|
511
|
-
Slice::reportIllegalSuffixOrUnderscore(const string& identifier)
|
|
512
|
-
{
|
|
513
|
-
// check whether the identifier is scoped
|
|
514
|
-
size_t scopeIndex = identifier.rfind("::");
|
|
515
|
-
bool isScoped = scopeIndex != string::npos;
|
|
516
|
-
string name;
|
|
517
|
-
if (isScoped)
|
|
518
|
-
{
|
|
519
|
-
name = identifier.substr(scopeIndex + 2); // Only check the unscoped identifier for syntax
|
|
520
|
-
}
|
|
521
|
-
else
|
|
522
|
-
{
|
|
523
|
-
name = identifier;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
assert(!name.empty());
|
|
527
|
-
bool isValid = true;
|
|
528
|
-
|
|
529
|
-
// check the identifier for reserved suffixes
|
|
530
|
-
static const string suffixBlacklist[] = {"Helper", "Holder", "Prx", "Ptr"};
|
|
531
|
-
for (const auto& i : suffixBlacklist)
|
|
532
|
-
{
|
|
533
|
-
if (name.find(i, name.size() - i.size()) != string::npos)
|
|
534
|
-
{
|
|
535
|
-
currentUnit->error("illegal identifier '" + name + "': '" + i + "' suffix is reserved");
|
|
536
|
-
isValid = false;
|
|
537
|
-
break;
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
// check the identifier for illegal underscores
|
|
542
|
-
size_t index = name.find('_');
|
|
543
|
-
if (index == 0)
|
|
544
|
-
{
|
|
545
|
-
currentUnit->error("illegal leading underscore in identifier '" + name + "'");
|
|
546
|
-
isValid = false;
|
|
547
|
-
}
|
|
548
|
-
else if (name.rfind('_') == (name.size() - 1))
|
|
549
|
-
{
|
|
550
|
-
currentUnit->error("illegal trailing underscore in identifier '" + name + "'");
|
|
551
|
-
isValid = false;
|
|
552
|
-
}
|
|
553
|
-
else if (name.find("__") != string::npos)
|
|
554
|
-
{
|
|
555
|
-
currentUnit->error("illegal double underscore in identifier '" + name + "'");
|
|
556
|
-
isValid = false;
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
return isValid;
|
|
560
|
-
}
|
|
561
|
-
|
|
562
510
|
bool
|
|
563
511
|
Slice::isProxyType(const TypePtr& type)
|
|
564
512
|
{
|
|
@@ -635,7 +583,7 @@ Slice::getFirstSentence(const StringList& lines)
|
|
|
635
583
|
}
|
|
636
584
|
|
|
637
585
|
string
|
|
638
|
-
Slice::getEscapedParamName(const ParameterList& params,
|
|
586
|
+
Slice::getEscapedParamName(const ParameterList& params, string_view param)
|
|
639
587
|
{
|
|
640
588
|
for (const auto& p : params)
|
|
641
589
|
{
|
|
@@ -650,14 +598,14 @@ Slice::getEscapedParamName(const ParameterList& params, std::string_view param)
|
|
|
650
598
|
string
|
|
651
599
|
Slice::getTypeScopedName(const TypePtr& type)
|
|
652
600
|
{
|
|
653
|
-
if (auto builtin =
|
|
601
|
+
if (auto builtin = dynamic_pointer_cast<Builtin>(type))
|
|
654
602
|
{
|
|
655
603
|
return builtin->kindAsString();
|
|
656
604
|
}
|
|
657
605
|
else
|
|
658
606
|
{
|
|
659
607
|
// a type is either built-in or contained
|
|
660
|
-
auto contained =
|
|
608
|
+
auto contained = dynamic_pointer_cast<Contained>(type);
|
|
661
609
|
assert(contained);
|
|
662
610
|
return contained->scoped();
|
|
663
611
|
}
|
|
@@ -755,7 +703,7 @@ Slice::DependencyGenerator::writeMakefileDependencies(
|
|
|
755
703
|
}
|
|
756
704
|
|
|
757
705
|
void
|
|
758
|
-
Slice::DependencyGenerator::writeXMLDependencies(const
|
|
706
|
+
Slice::DependencyGenerator::writeXMLDependencies(const string& dependFile)
|
|
759
707
|
{
|
|
760
708
|
ostringstream os;
|
|
761
709
|
os << R"(<?xml version="1.0" encoding="UTF-8"?>)";
|
|
@@ -777,7 +725,7 @@ Slice::DependencyGenerator::writeXMLDependencies(const std::string& dependFile)
|
|
|
777
725
|
}
|
|
778
726
|
|
|
779
727
|
void
|
|
780
|
-
Slice::DependencyGenerator::writeJSONDependencies(const
|
|
728
|
+
Slice::DependencyGenerator::writeJSONDependencies(const string& dependFile)
|
|
781
729
|
{
|
|
782
730
|
ostringstream os;
|
|
783
731
|
os << "{";
|
|
@@ -70,9 +70,6 @@ namespace Slice
|
|
|
70
70
|
/// @see Contained::kindOf
|
|
71
71
|
std::string pluralKindOf(const ContainedPtr& p);
|
|
72
72
|
|
|
73
|
-
// Checks an identifier for illegal syntax and reports any errors that are present.
|
|
74
|
-
bool reportIllegalSuffixOrUnderscore(const std::string& identifier);
|
|
75
|
-
|
|
76
73
|
bool isProxyType(const TypePtr& type);
|
|
77
74
|
|
|
78
75
|
// Is this the first element defined in its container?
|
|
@@ -241,13 +241,14 @@ Slice::Ruby::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
|
|
|
241
241
|
}
|
|
242
242
|
for (auto q = members.begin(); q != members.end(); ++q)
|
|
243
243
|
{
|
|
244
|
+
const bool isOptional = (*q)->isOptional();
|
|
244
245
|
if (q != members.begin())
|
|
245
246
|
{
|
|
246
247
|
_out << ',' << nl;
|
|
247
248
|
}
|
|
248
249
|
_out << "['" << getMappedName(*q) << "', ";
|
|
249
250
|
writeType((*q)->type());
|
|
250
|
-
_out << ", " << (
|
|
251
|
+
_out << ", " << (isOptional ? "true" : "false") << ", " << (isOptional ? (*q)->tag() : 0) << ']';
|
|
251
252
|
}
|
|
252
253
|
if (members.size() > 1)
|
|
253
254
|
{
|
|
@@ -407,6 +408,7 @@ Slice::Ruby::CodeVisitor::visitInterfaceDefStart(const InterfaceDefPtr& p)
|
|
|
407
408
|
bool isFirst = true;
|
|
408
409
|
for (const auto& param : op->inParameters())
|
|
409
410
|
{
|
|
411
|
+
const bool isOptional = param->isOptional();
|
|
410
412
|
if (!isFirst)
|
|
411
413
|
{
|
|
412
414
|
_out << ", ";
|
|
@@ -414,13 +416,13 @@ Slice::Ruby::CodeVisitor::visitInterfaceDefStart(const InterfaceDefPtr& p)
|
|
|
414
416
|
isFirst = false;
|
|
415
417
|
_out << '[';
|
|
416
418
|
writeType(param->type());
|
|
417
|
-
_out << ", " << (
|
|
418
|
-
<< ']';
|
|
419
|
+
_out << ", " << (isOptional ? "true" : "false") << ", " << (isOptional ? param->tag() : 0) << ']';
|
|
419
420
|
}
|
|
420
421
|
_out << "], [";
|
|
421
422
|
isFirst = true;
|
|
422
423
|
for (const auto& param : op->outParameters())
|
|
423
424
|
{
|
|
425
|
+
const bool isOptional = param->isOptional();
|
|
424
426
|
if (!isFirst)
|
|
425
427
|
{
|
|
426
428
|
_out << ", ";
|
|
@@ -428,8 +430,7 @@ Slice::Ruby::CodeVisitor::visitInterfaceDefStart(const InterfaceDefPtr& p)
|
|
|
428
430
|
isFirst = false;
|
|
429
431
|
_out << '[';
|
|
430
432
|
writeType(param->type());
|
|
431
|
-
_out << ", " << (
|
|
432
|
-
<< ']';
|
|
433
|
+
_out << ", " << (isOptional ? "true" : "false") << ", " << (isOptional ? param->tag() : 0) << ']';
|
|
433
434
|
}
|
|
434
435
|
_out << "], ";
|
|
435
436
|
TypePtr returnType = op->returnType();
|
|
@@ -456,6 +457,7 @@ Slice::Ruby::CodeVisitor::visitInterfaceDefStart(const InterfaceDefPtr& p)
|
|
|
456
457
|
_out << getMetaTypeReference(ex);
|
|
457
458
|
}
|
|
458
459
|
_out.epar("]");
|
|
460
|
+
_out << ", " << (op->hasMetadata("oneway") ? "true" : "false");
|
|
459
461
|
_out << ")";
|
|
460
462
|
|
|
461
463
|
if (op->isDeprecated())
|
|
@@ -547,14 +549,14 @@ Slice::Ruby::CodeVisitor::visitExceptionStart(const ExceptionPtr& p)
|
|
|
547
549
|
//
|
|
548
550
|
for (auto dmli = members.begin(); dmli != members.end(); ++dmli)
|
|
549
551
|
{
|
|
552
|
+
const bool isOptional = (*dmli)->isOptional();
|
|
550
553
|
if (dmli != members.begin())
|
|
551
554
|
{
|
|
552
555
|
_out << ',' << nl;
|
|
553
556
|
}
|
|
554
557
|
_out << "[\"" << getMappedName(*dmli) << "\", ";
|
|
555
558
|
writeType((*dmli)->type());
|
|
556
|
-
_out << ", " << (
|
|
557
|
-
<< ']';
|
|
559
|
+
_out << ", " << (isOptional ? "true" : "false") << ", " << (isOptional ? (*dmli)->tag() : 0) << ']';
|
|
558
560
|
}
|
|
559
561
|
if (members.size() > 1)
|
|
560
562
|
{
|
|
@@ -1038,7 +1040,7 @@ Slice::Ruby::CodeVisitor::writeConstructorParams(const DataMemberList& members)
|
|
|
1038
1040
|
{
|
|
1039
1041
|
writeConstantValue(member->type(), member->defaultValueType(), *member->defaultValue());
|
|
1040
1042
|
}
|
|
1041
|
-
else if (member->
|
|
1043
|
+
else if (member->isOptional())
|
|
1042
1044
|
{
|
|
1043
1045
|
_out << "Ice::Unset";
|
|
1044
1046
|
}
|
|
@@ -9,13 +9,10 @@
|
|
|
9
9
|
namespace Slice::Ruby
|
|
10
10
|
{
|
|
11
11
|
/// Generates Ruby code for the provided translation unit.
|
|
12
|
-
void
|
|
13
|
-
|
|
14
|
-
bool all,
|
|
15
|
-
const std::vector<std::string>& includePaths,
|
|
16
|
-
IceInternal::Output& out);
|
|
12
|
+
void
|
|
13
|
+
generate(const UnitPtr& unit, bool all, const std::vector<std::string>& includePaths, IceInternal::Output& out);
|
|
17
14
|
|
|
18
|
-
/// This enum is used by
|
|
15
|
+
/// This enum is used by `getMappedName` to control the casing of the identifier it returns.
|
|
19
16
|
enum IdentStyle
|
|
20
17
|
{
|
|
21
18
|
/// No change will be made to the mapped identifier.
|
|
@@ -31,17 +28,17 @@ namespace Slice::Ruby
|
|
|
31
28
|
/// Returns the mapped name of the provided Slice element.
|
|
32
29
|
/// If the element has 'ruby:identifier' metadata on it, the metadata's argument is returned as-is.
|
|
33
30
|
/// Otherwise, the slice name is returned, after its casing has been fixed according to the provided @p style.
|
|
34
|
-
std::string getMappedName(const
|
|
31
|
+
std::string getMappedName(const ContainedPtr& p, IdentStyle style = IdentNormal);
|
|
35
32
|
|
|
36
33
|
/// Returns the fully-qualified mapped-identifier of the provided Slice element.
|
|
37
|
-
/// This is equivalent to calling
|
|
38
|
-
std::string getAbsolute(const
|
|
34
|
+
/// This is equivalent to calling `getMappedName` on @p p and all it's containers.
|
|
35
|
+
std::string getAbsolute(const ContainedPtr& p);
|
|
39
36
|
|
|
40
|
-
/// Equivalent to
|
|
41
|
-
std::string getMetaTypeName(const
|
|
37
|
+
/// Equivalent to `getMappedName` but with "T_" preprended to the name.
|
|
38
|
+
std::string getMetaTypeName(const ContainedPtr& p);
|
|
42
39
|
|
|
43
|
-
/// Equivalent to
|
|
44
|
-
std::string getMetaTypeReference(const
|
|
40
|
+
/// Equivalent to `getAbsolute` but with "T_" preprended to the name.
|
|
41
|
+
std::string getMetaTypeReference(const ContainedPtr& p);
|
|
45
42
|
|
|
46
43
|
/// Emits a comment header for a generated file.
|
|
47
44
|
void printHeader(IceInternal::Output& out);
|
|
@@ -12,17 +12,18 @@
|
|
|
12
12
|
|
|
13
13
|
#include "Identity.ice"
|
|
14
14
|
|
|
15
|
+
#ifdef __ICERPC__
|
|
16
|
+
["cs:identifier:IceRpc.Ice"]
|
|
17
|
+
#endif
|
|
15
18
|
["java:identifier:com.zeroc.Ice"]
|
|
16
19
|
module Ice
|
|
17
20
|
{
|
|
18
|
-
/// The exception that is thrown by a {@link Locator} implementation when it cannot find an object adapter
|
|
19
|
-
/// provided adapter ID.
|
|
21
|
+
/// The exception that is thrown by a {@link Locator} implementation when it cannot find an object adapter.
|
|
20
22
|
exception AdapterNotFoundException
|
|
21
23
|
{
|
|
22
24
|
}
|
|
23
25
|
|
|
24
|
-
/// The exception that is thrown by a {@link Locator} implementation when it cannot find an object
|
|
25
|
-
/// identity.
|
|
26
|
+
/// The exception that is thrown by a {@link Locator} implementation when it cannot find an object.
|
|
26
27
|
exception ObjectNotFoundException
|
|
27
28
|
{
|
|
28
29
|
}
|
|
@@ -34,7 +35,7 @@ module Ice
|
|
|
34
35
|
/// their object adapters.
|
|
35
36
|
interface Locator
|
|
36
37
|
{
|
|
37
|
-
/// Finds an object by identity and returns a dummy proxy with
|
|
38
|
+
/// Finds an object by identity and returns a dummy proxy with endpoint(s) that can be used to reach this
|
|
38
39
|
/// object. This dummy proxy may be an indirect proxy that requires further resolution using
|
|
39
40
|
/// {@link findAdapterById}.
|
|
40
41
|
/// @param id The identity.
|
|
@@ -92,7 +92,7 @@ module IceMX
|
|
|
92
92
|
/// @param view The name of the metrics view.
|
|
93
93
|
/// @param timestamp The local time of the process when the metrics objects were retrieved.
|
|
94
94
|
/// @return The metrics view data, a dictionary of metric maps for each metrics class configured with the view.
|
|
95
|
-
/// The @p timestamp allows the client to compute averages which are not dependent
|
|
95
|
+
/// The @p timestamp allows the client to compute averages which are not dependent on the invocation latency for
|
|
96
96
|
/// this operation.
|
|
97
97
|
/// @throws UnknownMetricsView Thrown when the metrics view cannot be found.
|
|
98
98
|
["format:sliced"]
|
|
@@ -12,10 +12,18 @@
|
|
|
12
12
|
|
|
13
13
|
[["js:module:@zeroc/ice"]]
|
|
14
14
|
|
|
15
|
+
#ifdef __ICERPC__
|
|
16
|
+
// In IceRPC, OperationMode is an internal implementation detail of the Ice protocol; the corresponding generated code
|
|
17
|
+
// is not publicly visible.
|
|
18
|
+
["cs:identifier:IceRpc.Internal"]
|
|
19
|
+
#endif
|
|
15
20
|
["java:identifier:com.zeroc.Ice"]
|
|
16
21
|
module Ice
|
|
17
22
|
{
|
|
18
23
|
/// Specifies if an operation is idempotent, which affects the retry behavior of the Ice client runtime.
|
|
24
|
+
#ifdef __ICERPC__
|
|
25
|
+
["cs:internal"]
|
|
26
|
+
#endif
|
|
19
27
|
enum OperationMode
|
|
20
28
|
{
|
|
21
29
|
/// A non-idempotent operation (the default). The Ice client runtime guarantees that it will not violate
|
|
@@ -12,12 +12,20 @@
|
|
|
12
12
|
|
|
13
13
|
[["js:module:@zeroc/ice"]]
|
|
14
14
|
|
|
15
|
+
#ifdef __ICERPC__
|
|
16
|
+
// In IceRPC, ReplyStatus is an internal implementation detail of the Ice protocol; the corresponding generated code is
|
|
17
|
+
// not publicly visible.
|
|
18
|
+
["cs:identifier:IceRpc.Internal"]
|
|
19
|
+
#endif
|
|
15
20
|
["java:identifier:com.zeroc.Ice"]
|
|
16
21
|
module Ice
|
|
17
22
|
{
|
|
18
23
|
/// Represents the status of a reply.
|
|
19
24
|
/// A reply status can have any value in the range 0..255. Do not use this enum to marshal or unmarshal a reply
|
|
20
25
|
/// status unless you know its value corresponds to one of the enumerators defined below.
|
|
26
|
+
#ifdef __ICERPC__
|
|
27
|
+
["cs:internal"]
|
|
28
|
+
#endif
|
|
21
29
|
enum ReplyStatus
|
|
22
30
|
{
|
|
23
31
|
/// The dispatch completed successfully.
|
|
@@ -61,5 +69,10 @@ module Ice
|
|
|
61
69
|
/// The caller is not authorized to access the requested resource.
|
|
62
70
|
["swift:identifier:unauthorized"]
|
|
63
71
|
Unauthorized,
|
|
72
|
+
|
|
73
|
+
/// The dispatch failed because the request requires a feature that the server or the target servant does not
|
|
74
|
+
/// support.
|
|
75
|
+
["swift:identifier:notSupported"]
|
|
76
|
+
NotSupported,
|
|
64
77
|
}
|
|
65
78
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Copyright (c) ZeroC, Inc.
|
|
2
2
|
|
|
3
|
-
# slice2rb version 3.8.
|
|
3
|
+
# slice2rb version 3.8.2
|
|
4
4
|
# <auto-generated>Generated from Slice file 'PermissionsVerifier.ice'.</auto-generated>
|
|
5
5
|
|
|
6
6
|
require 'Ice'
|
|
@@ -36,7 +36,7 @@ module ::Glacier2
|
|
|
36
36
|
|
|
37
37
|
T_PermissionsVerifierPrx.defineProxy(PermissionsVerifierPrx, nil, [])
|
|
38
38
|
|
|
39
|
-
PermissionsVerifierPrx_mixin::OP_checkPermissions = Ice::__defineOperation('checkPermissions', 'checkPermissions', Ice::OperationMode::Idempotent, nil, [[Ice::T_string, false, 0], [Ice::T_string, false, 0]], [[Ice::T_string, false, 0]], [Ice::T_bool, false, 0], [::Glacier2::T_PermissionDeniedException])
|
|
39
|
+
PermissionsVerifierPrx_mixin::OP_checkPermissions = Ice::__defineOperation('checkPermissions', 'checkPermissions', Ice::OperationMode::Idempotent, nil, [[Ice::T_string, false, 0], [Ice::T_string, false, 0]], [[Ice::T_string, false, 0]], [Ice::T_bool, false, 0], [::Glacier2::T_PermissionDeniedException], false)
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
if not defined?(::Glacier2::T_SSLPermissionsVerifierPrx)
|
|
@@ -56,6 +56,6 @@ module ::Glacier2
|
|
|
56
56
|
|
|
57
57
|
T_SSLPermissionsVerifierPrx.defineProxy(SSLPermissionsVerifierPrx, nil, [])
|
|
58
58
|
|
|
59
|
-
SSLPermissionsVerifierPrx_mixin::OP_authorize = Ice::__defineOperation('authorize', 'authorize', Ice::OperationMode::Idempotent, nil, [[::Glacier2::T_SSLInfo, false, 0]], [[Ice::T_string, false, 0]], [Ice::T_bool, false, 0], [::Glacier2::T_PermissionDeniedException])
|
|
59
|
+
SSLPermissionsVerifierPrx_mixin::OP_authorize = Ice::__defineOperation('authorize', 'authorize', Ice::OperationMode::Idempotent, nil, [[::Glacier2::T_SSLInfo, false, 0]], [[Ice::T_string, false, 0]], [Ice::T_bool, false, 0], [::Glacier2::T_PermissionDeniedException], false)
|
|
60
60
|
end
|
|
61
61
|
end
|
data/dist/lib/Glacier2/Router.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Copyright (c) ZeroC, Inc.
|
|
2
2
|
|
|
3
|
-
# slice2rb version 3.8.
|
|
3
|
+
# slice2rb version 3.8.2
|
|
4
4
|
# <auto-generated>Generated from Slice file 'Router.ice'.</auto-generated>
|
|
5
5
|
|
|
6
6
|
require 'Ice'
|
|
@@ -61,13 +61,13 @@ module ::Glacier2
|
|
|
61
61
|
|
|
62
62
|
T_RouterPrx.defineProxy(RouterPrx, nil, [::Ice::T_RouterPrx])
|
|
63
63
|
|
|
64
|
-
RouterPrx_mixin::OP_getCategoryForClient = Ice::__defineOperation('getCategoryForClient', 'getCategoryForClient', Ice::OperationMode::Idempotent, nil, [], [], [Ice::T_string, false, 0], [])
|
|
65
|
-
RouterPrx_mixin::OP_createSession = Ice::__defineOperation('createSession', 'createSession', Ice::OperationMode::Normal, nil, [[Ice::T_string, false, 0], [Ice::T_string, false, 0]], [], [::Glacier2::T_SessionPrx, false, 0], [::Glacier2::T_PermissionDeniedException, ::Glacier2::T_CannotCreateSessionException])
|
|
66
|
-
RouterPrx_mixin::OP_createSessionFromSecureConnection = Ice::__defineOperation('createSessionFromSecureConnection', 'createSessionFromSecureConnection', Ice::OperationMode::Normal, nil, [], [], [::Glacier2::T_SessionPrx, false, 0], [::Glacier2::T_PermissionDeniedException, ::Glacier2::T_CannotCreateSessionException])
|
|
67
|
-
RouterPrx_mixin::OP_refreshSession = Ice::__defineOperation('refreshSession', 'refreshSession', Ice::OperationMode::Normal, nil, [], [], nil, [::Glacier2::T_SessionNotExistException])
|
|
64
|
+
RouterPrx_mixin::OP_getCategoryForClient = Ice::__defineOperation('getCategoryForClient', 'getCategoryForClient', Ice::OperationMode::Idempotent, nil, [], [], [Ice::T_string, false, 0], [], false)
|
|
65
|
+
RouterPrx_mixin::OP_createSession = Ice::__defineOperation('createSession', 'createSession', Ice::OperationMode::Normal, nil, [[Ice::T_string, false, 0], [Ice::T_string, false, 0]], [], [::Glacier2::T_SessionPrx, false, 0], [::Glacier2::T_PermissionDeniedException, ::Glacier2::T_CannotCreateSessionException], false)
|
|
66
|
+
RouterPrx_mixin::OP_createSessionFromSecureConnection = Ice::__defineOperation('createSessionFromSecureConnection', 'createSessionFromSecureConnection', Ice::OperationMode::Normal, nil, [], [], [::Glacier2::T_SessionPrx, false, 0], [::Glacier2::T_PermissionDeniedException, ::Glacier2::T_CannotCreateSessionException], false)
|
|
67
|
+
RouterPrx_mixin::OP_refreshSession = Ice::__defineOperation('refreshSession', 'refreshSession', Ice::OperationMode::Normal, nil, [], [], nil, [::Glacier2::T_SessionNotExistException], false)
|
|
68
68
|
RouterPrx_mixin::OP_refreshSession.deprecate("As of Ice 3.8, this operation does nothing.")
|
|
69
|
-
RouterPrx_mixin::OP_destroySession = Ice::__defineOperation('destroySession', 'destroySession', Ice::OperationMode::Normal, nil, [], [], nil, [::Glacier2::T_SessionNotExistException])
|
|
70
|
-
RouterPrx_mixin::OP_getSessionTimeout = Ice::__defineOperation('getSessionTimeout', 'getSessionTimeout', Ice::OperationMode::Idempotent, nil, [], [], [Ice::T_long, false, 0], [])
|
|
71
|
-
RouterPrx_mixin::OP_getACMTimeout = Ice::__defineOperation('getACMTimeout', 'getACMTimeout', Ice::OperationMode::Idempotent, nil, [], [], [Ice::T_int, false, 0], [])
|
|
69
|
+
RouterPrx_mixin::OP_destroySession = Ice::__defineOperation('destroySession', 'destroySession', Ice::OperationMode::Normal, nil, [], [], nil, [::Glacier2::T_SessionNotExistException], false)
|
|
70
|
+
RouterPrx_mixin::OP_getSessionTimeout = Ice::__defineOperation('getSessionTimeout', 'getSessionTimeout', Ice::OperationMode::Idempotent, nil, [], [], [Ice::T_long, false, 0], [], false)
|
|
71
|
+
RouterPrx_mixin::OP_getACMTimeout = Ice::__defineOperation('getACMTimeout', 'getACMTimeout', Ice::OperationMode::Idempotent, nil, [], [], [Ice::T_int, false, 0], [], false)
|
|
72
72
|
end
|
|
73
73
|
end
|