public void Process(APollRequest requestinfo)
            {
                Hashtable curresponse;

                UUID requestID = requestinfo.reqID;

                if (m_scene.ShuttingDown)
                {
                    return;
                }

                lock (responses)
                {
                    lock (dropedResponses)
                    {
                        if (dropedResponses.Contains(requestID))
                        {
                            dropedResponses.Remove(requestID);
                            return;
                        }
                    }

                    // If the avatar is gone, don't bother to get the texture
                    if (m_scene.GetScenePresence(Id) == null)
                    {
                        curresponse = new Hashtable();
                        curresponse["int_response_code"]   = 500;
                        curresponse["str_response_string"] = "Script timeout";
                        curresponse["content_type"]        = "text/plain";
                        curresponse["keepalive"]           = false;
                        responses[requestID] = new APollResponse()
                        {
                            bytes = 0, response = curresponse
                        };
                        return;
                    }
                }

                curresponse = m_getMeshHandler.Handle(requestinfo.request);

                lock (responses)
                {
                    lock (dropedResponses)
                    {
                        if (dropedResponses.Contains(requestID))
                        {
                            dropedResponses.Remove(requestID);
                            return;
                        }
                    }

                    responses[requestID] = new APollResponse()
                    {
                        bytes    = (int)curresponse["int_bytes"],
                        response = curresponse
                    };
                }
            }
Ejemplo n.º 2
0
            public void Process(APollRequest requestinfo)
            {
                UUID requestID = requestinfo.reqID;

                if (m_scene.ShuttingDown)
                {
                    return;
                }

                lock (responses)
                {
                    lock (dropedResponses)
                    {
                        if (dropedResponses.Contains(requestID))
                        {
                            dropedResponses.Remove(requestID);
                            return;
                        }
                    }

/* can't do this with current viewers; HG problem
 *                  // If the avatar is gone, don't bother to get the texture
 *                  if(m_scene.GetScenePresence(Id) == null)
 *                  {
 *                      curresponse = new Hashtable();
 *                      curresponse["int_response_code"] = 500;
 *                      curresponse["str_response_string"] = "timeout";
 *                      curresponse["content_type"] = "text/plain";
 *                      curresponse["keepalive"] = false;
 *                      responses[requestID] = new APollResponse() { bytes = 0, response = curresponse };
 *                      return;
 *                  }
 */
                }
                OSHttpResponse response = new OSHttpResponse(requestinfo.request);

                m_getAssetHandler.Handle(requestinfo.request, response, m_hgassets);

                lock (responses)
                {
                    lock (dropedResponses)
                    {
                        if (dropedResponses.Contains(requestID))
                        {
                            dropedResponses.Remove(requestID);
                            return;
                        }
                    }

                    APollResponse preq = new APollResponse()
                    {
                        osresponse = response
                    };
                    responses[requestID] = preq;
                }
            }
Ejemplo n.º 3
0
            public void Process(APollRequest requestinfo)
            {
                Hashtable response;

                UUID requestID = requestinfo.reqID;

                if (m_scene.ShuttingDown)
                {
                    return;
                }

                lock (responses)
                {
                    lock (dropedResponses)
                    {
                        if (dropedResponses.Contains(requestID))
                        {
                            dropedResponses.Remove(requestID);
                            return;
                        }
                    }

                    if (m_presence == null)
                    {
                        m_presence = m_scene.GetScenePresence(Id);
                    }

                    if (m_presence == null || m_presence.IsDeleted)
                    {
                        requestinfo.send503 = true;
                    }

                    if (requestinfo.send503)
                    {
                        response = new Hashtable();

                        response["int_response_code"]   = 503;
                        response["str_response_string"] = "Throttled";
                        response["content_type"]        = "text/plain";
                        response["keepalive"]           = false;

                        Hashtable headers = new Hashtable();
                        headers["Retry-After"] = 20;
                        response["headers"]    = headers;

                        responses[requestID] = new APollResponse()
                        {
                            bytes = 0, response = response
                        };
                        return;
                    }
                }

                response = m_getTextureHandler.Handle(requestinfo.request);

                lock (responses)
                {
                    lock (dropedResponses)
                    {
                        if (dropedResponses.Contains(requestID))
                        {
                            dropedResponses.Remove(requestID);
                            return;
                        }
                    }
                    responses[requestID] = new APollResponse()
                    {
                        bytes    = (int)response["int_bytes"],
                        response = response
                    };
                }
            }
Ejemplo n.º 4
0
            public void Process(APollRequest requestinfo)
            {
                Hashtable response;

                UUID requestID = requestinfo.reqID;

                if (m_scene.ShuttingDown)
                {
                    return;
                }

                lock (responses)
                {
                    lock (dropedResponses)
                    {
                        if (dropedResponses.Contains(requestID))
                        {
                            dropedResponses.Remove(requestID);
                            return;
                        }
                    }

                    if (requestinfo.send503)
                    {
                        response = new Hashtable();

                        response["int_response_code"]   = 503;
                        response["str_response_string"] = "Throttled";
                        response["content_type"]        = "text/plain";
                        response["keepalive"]           = false;

                        Hashtable headers = new Hashtable();
                        headers["Retry-After"] = 30;
                        response["headers"]    = headers;

                        responses[requestID] = new APollResponse()
                        {
                            bytes = 0, response = response
                        };

                        return;
                    }

                    // If the avatar is gone, don't bother to get the texture
                    if (m_scene.GetScenePresence(Id) == null)
                    {
                        response = new Hashtable();

                        response["int_response_code"]   = 500;
                        response["str_response_string"] = "Script timeout";
                        response["content_type"]        = "text/plain";
                        response["keepalive"]           = false;

                        responses[requestID] = new APollResponse()
                        {
                            bytes = 0, response = response
                        };

                        return;
                    }
                }

                response = m_getTextureHandler.Handle(requestinfo.request);

                lock (responses)
                {
                    lock (dropedResponses)
                    {
                        if (dropedResponses.Contains(requestID))
                        {
                            dropedResponses.Remove(requestID);
                            return;
                        }
                    }
                    responses[requestID] = new APollResponse()
                    {
                        bytes    = (int)response["int_bytes"],
                        response = response
                    };
                }
            }