Example #1
0
    internal unsafe void DetachFromUrlGroup()
    {
        if (UrlGroup == null)
        {
            throw new NotSupportedException("Can't detach when UrlGroup is null");
        }

        Debug.Assert(Created);
        CheckDisposed();
        // Break the association between request queue and url group. After this, requests for registered urls
        // will get 503s.
        // Note that this method may be called multiple times (Stop() and then Abort()). This
        // is fine since http.sys allows to set HttpServerBindingProperty multiple times for valid
        // Url groups.

        var info = new HttpApiTypes.HTTP_BINDING_INFO();

        info.Flags = HttpApiTypes.HTTP_FLAGS.NONE;
        info.RequestQueueHandle = IntPtr.Zero;

        var infoptr = new IntPtr(&info);

        UrlGroup.SetProperty(HttpApiTypes.HTTP_SERVER_PROPERTY.HttpServerBindingProperty,
                             infoptr, (uint)BindingInfoSize, throwOnError: false);
    }
Example #2
0
    internal unsafe void UnSetDelegationProperty(RequestQueue destination, bool throwOnError = true)
    {
        var propertyInfo = new HttpApiTypes.HTTP_BINDING_INFO();

        propertyInfo.Flags = HttpApiTypes.HTTP_FLAGS.NONE;
        propertyInfo.RequestQueueHandle = destination.Handle.DangerousGetHandle();

        SetProperty(HttpApiTypes.HTTP_SERVER_PROPERTY.HttpServerDelegationProperty, new IntPtr(&propertyInfo), (uint)RequestPropertyInfoSize, throwOnError);
    }
Example #3
0
    internal unsafe void SetDelegationProperty(RequestQueue destination)
    {
        var propertyInfo = new HttpApiTypes.HTTP_BINDING_INFO();

        propertyInfo.Flags = HttpApiTypes.HTTP_FLAGS.HTTP_PROPERTY_FLAG_PRESENT;
        propertyInfo.RequestQueueHandle = destination.Handle.DangerousGetHandle();

        SetProperty(HttpApiTypes.HTTP_SERVER_PROPERTY.HttpServerDelegationProperty, new IntPtr(&propertyInfo), (uint)RequestPropertyInfoSize);
    }
Example #4
0
    private unsafe void AttachToUrlGroup(RequestQueue requestQueue)
    {
        var info = new HttpApiTypes.HTTP_BINDING_INFO();

        info.Flags = HttpApiTypes.HTTP_FLAGS.HTTP_PROPERTY_FLAG_PRESENT;
        info.RequestQueueHandle = requestQueue.Handle.DangerousGetHandle();

        var infoptr = new IntPtr(&info);

        requestQueue.UrlGroup.SetProperty(HttpApiTypes.HTTP_SERVER_PROPERTY.HttpServerBindingProperty,
                                          infoptr, (uint)Marshal.SizeOf <HttpApiTypes.HTTP_BINDING_INFO>());
    }
Example #5
0
        internal unsafe void AttachToUrlGroup()
        {
            CheckDisposed();
            // Set the association between request queue and url group. After this, requests for registered urls will
            // get delivered to this request queue.

            var info = new HttpApiTypes.HTTP_BINDING_INFO();

            info.Flags = HttpApiTypes.HTTP_FLAGS.HTTP_PROPERTY_FLAG_PRESENT;
            info.RequestQueueHandle = Handle.DangerousGetHandle();

            var infoptr = new IntPtr(&info);

            _urlGroup.SetProperty(HttpApiTypes.HTTP_SERVER_PROPERTY.HttpServerBindingProperty,
                                  infoptr, (uint)BindingInfoSize);
        }
Example #6
0
    internal unsafe void AttachToUrlGroup()
    {
        if (UrlGroup == null)
        {
            throw new NotSupportedException("Can't attach when UrlGroup is null");
        }

        Debug.Assert(Created);
        CheckDisposed();
        // Set the association between request queue and url group. After this, requests for registered urls will
        // get delivered to this request queue.

        var info = new HttpApiTypes.HTTP_BINDING_INFO();

        info.Flags = HttpApiTypes.HTTP_FLAGS.HTTP_PROPERTY_FLAG_PRESENT;
        info.RequestQueueHandle = Handle.DangerousGetHandle();

        var infoptr = new IntPtr(&info);

        UrlGroup.SetProperty(HttpApiTypes.HTTP_SERVER_PROPERTY.HttpServerBindingProperty,
                             infoptr, (uint)BindingInfoSize);
    }