@@ -29,6 +29,8 @@ public class GrpcServiceOptions
2929 internal IList < ICompressionProvider > ? _compressionProviders ;
3030 internal int ? _maxReceiveMessageSize ;
3131 internal int ? _maxSendMessageSize ;
32+ internal bool _maxSendMessageSizeSpecified ;
33+ internal bool _maxReceiveMessageSizeSpecified ;
3234
3335 /// <summary>
3436 /// Gets or sets the maximum message size in bytes that can be sent from the server.
@@ -51,7 +53,18 @@ public int? MaxSendMessageSize
5153 /// Gets or sets a flag indicating whether <see cref="MaxSendMessageSize"/> is specified.
5254 /// This flag is automatically set to true when <see cref="MaxSendMessageSize"/> is configured.
5355 /// </summary>
54- public bool MaxSendMessageSizeSpecified { get ; set ; }
56+ public bool MaxSendMessageSizeSpecified
57+ {
58+ get => _maxSendMessageSizeSpecified ;
59+ set
60+ {
61+ _maxSendMessageSizeSpecified = value ;
62+ if ( ! _maxSendMessageSizeSpecified )
63+ {
64+ _maxSendMessageSize = null ;
65+ }
66+ }
67+ }
5568
5669 /// <summary>
5770 /// Gets or sets the maximum message size in bytes that can be received by the server.
@@ -74,7 +87,18 @@ public int? MaxReceiveMessageSize
7487 /// Gets or sets a flag indicating whether <see cref="MaxReceiveMessageSize"/> is specified.
7588 /// This flag is automatically set to true when <see cref="MaxReceiveMessageSize"/> is configured.
7689 /// </summary>
77- public bool MaxReceiveMessageSizeSpecified { get ; set ; }
90+ public bool MaxReceiveMessageSizeSpecified
91+ {
92+ get => _maxReceiveMessageSizeSpecified ;
93+ set
94+ {
95+ _maxReceiveMessageSizeSpecified = value ;
96+ if ( ! _maxReceiveMessageSizeSpecified )
97+ {
98+ _maxReceiveMessageSize = null ;
99+ }
100+ }
101+ }
78102
79103 /// <summary>
80104 /// Gets or sets a value indicating whether detailed error messages are sent to the peer.
0 commit comments