{"id":70,"date":"2006-01-13T13:54:06","date_gmt":"2006-01-13T20:54:06","guid":{"rendered":"http:\/\/kennyw.com\/indigo\/70"},"modified":"2006-01-13T13:54:06","modified_gmt":"2006-01-13T20:54:06","slug":"maxmessagesize-maxbuffersize-and-proxy-generation","status":"publish","type":"post","link":"https:\/\/kennyw.com\/?p=70","title":{"rendered":"MaxReceivedMessageSize, MaxBufferSize, and proxy generation"},"content":{"rendered":"<p>To limit DoS exposure, we have a knob on all of our transports to control the size of Messages received on the wire.  This way, we will only allocate a bounded amount of memory for each message.  This setting is <code>binding.MaxReceivedMessageSize<\/code> in imperative code (or <code>&lt;binding maxReceivedMessageSize=\"654321\"&gt;<\/code> in config).  If an incoming Message is larger than MaxReceivedMessageSize, we will drop the Message (and fault the transport channel for session-ful channels).<\/p>\n<p>Many of our transports\/bindings also have a &#8220;MaxBufferSize&#8221; knob.  For buffered transports, this value is always equal to MaxReceivedMessageSize (and the system Asserts this fact).  However, for Streamed bindings (TransferMode == TransferMode.Streamed), we only need to buffer the SOAP Headers in order to generate a Message, and we can have the Body stream in on-demand.  In this case, MaxBufferSize &lt;= MaxReceivedMessageSize, and MaxReceivedMessageSize will bound the overall message, while MaxBufferSize bounds the Headers size.<\/p>\n<p>One thing to note about these settings is that they are <b>local<\/b> behavioral settings. That is, they are not transmitted in Metadata. So if you generate a proxy to a service with a MaxReceivedMessageSize = 2GB, the proxy will have a default value (64K) for MaxReceivedMessageSize.  This leaves control of the appropriate MaxReceivedMessageSize in the hands of the administrator to decide, and (hopefully) helps with our out-of-the-box security story.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To limit DoS exposure, we have a knob on all of our transports to control the size of Messages received on the wire. This way, we will only allocate a bounded amount of memory for each message. This setting is binding.MaxReceivedMessageSize in imperative code (or &lt;binding maxReceivedMessageSize=&#8221;654321&#8243;&gt; in config). If an incoming Message is larger [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-70","post","type-post","status-publish","format-standard","hentry","category-indigo"],"_links":{"self":[{"href":"https:\/\/kennyw.com\/index.php?rest_route=\/wp\/v2\/posts\/70","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kennyw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kennyw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kennyw.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kennyw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=70"}],"version-history":[{"count":0,"href":"https:\/\/kennyw.com\/index.php?rest_route=\/wp\/v2\/posts\/70\/revisions"}],"wp:attachment":[{"href":"https:\/\/kennyw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=70"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kennyw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=70"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kennyw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=70"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}