Beispiel #1
0
    internal static RequestHeader[] GetRequestHeaders(IntPtr nginx_request)
    {
        var info = MainApp.GetNginxMonoRequestInfo(nginx_request);

        Console.Error.WriteLine("Headers Count = {0} ", info.headers_count);
        NginxMonoHeader[] xheaders = null;
        MainApp.GetNginxHeaders(nginx_request, out xheaders, info.headers_count);

        NginxMonoHeader[] headers = new NginxMonoHeader[info.headers_count];
        for (int i = 0; i < info.headers_count; i++)
        {
            headers[i] = xheaders[i];
        }
        return((from h in headers
                select new RequestHeader {
            Key = h.Key, Value = h.Value
        }).ToArray());
    }