本文整理汇总了C#中RubyContext.SetObjectTaint方法的典型用法代码示例。如果您正苦于以下问题:C# RubyContext.SetObjectTaint方法的具体用法?C# RubyContext.SetObjectTaint怎么用?C# RubyContext.SetObjectTaint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RubyContext
的用法示例。
在下文中一共展示了RubyContext.SetObjectTaint方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReceiveFrom
public static RubyArray/*!*/ ReceiveFrom(RubyContext/*!*/ context, IPSocket/*!*/ self, int length, object/*Numeric*/ flags) {
SocketFlags sFlags = ConvertToSocketFlag(context, flags);
byte[] buffer = new byte[length];
EndPoint fromEP = new IPEndPoint(IPAddress.Any, 0);
int received = self.Socket.ReceiveFrom(buffer, sFlags, ref fromEP);
MutableString str = MutableString.CreateBinary();
str.Append(buffer, 0, received);
context.SetObjectTaint(str, true);
return RubyOps.MakeArray2(str, GetAddressArray(context, fromEP));
}
示例2: Untaint
public static object Untaint(RubyContext/*!*/ context, object self) {
if (RubyUtils.IsRubyValueType(self)) {
return self;
}
context.SetObjectTaint(self, false);
return self;
}
示例3: Receive
public static MutableString Receive(ConversionStorage<int>/*!*/ fixnumCast, RubyContext/*!*/ context, RubyBasicSocket/*!*/ self,
[DefaultProtocol]int length, [DefaultParameterValue(null)]object flags) {
SocketFlags sFlags = ConvertToSocketFlag(fixnumCast, context, flags);
byte[] buffer = new byte[length];
int received = self.Socket.Receive(buffer, 0, length, sFlags);
MutableString str = MutableString.CreateBinary(received);
str.Append(buffer, 0, received);
context.SetObjectTaint(str, true);
return str;
}
示例4: Untaint
public static object Untaint(RubyContext/*!*/ context, object self) {
if (!RubyUtils.HasObjectState(self)) {
return self;
}
context.SetObjectTaint(self, false);
return self;
}