Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004130opensim[REGION] Script Functionspublic2009-09-09 19:082011-08-18 08:03
Reportersurangika 
Assigned To 
PrioritynormalSeverityblockReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0004130: llHTTPRequest does not work with some servers due to HTTP header problems
DescriptionI use the following code to send a direct message to Twitter. This code works just fine in Second Life and the message goes to twitter. But this does not work in the OpenSim.

string username = "wanlu737";
string password = "wangluyao";
string twitter_url = "wangluyao@twitter.com/direct_messages/new.xml";">http://wanlu737:wangluyao@twitter.com/direct_messages/new.xml"; [wangluyao@twitter.com/direct_messages/new.xml";" target="_blank">^]


key getResponse()

{
    string output_str = "twitter";
    return llHTTPRequest(twitter_url, [HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded"], "user=wanlu737&text="+output_str);
}

 key gRequestID = NULL_KEY;

default
{
   
    state_entry()
    {
         gRequestID = getResponse();
    }
    
     http_response(key request_id, integer status, list metadata, string body)
    {
        if (request_id == gRequestID)
        {
            llSay(0, "request_id: " + (string)request_id + "status: " + (string)status + "metadata: "+ (string)metadata + "body: "+ body);
        }
    }

    touch_start(integer total_number)
    {
        llSay(0, "Touched.");
    }
}

The Twitter server responds with HTTP error code 417 (Expectation Failed)and the message is not posted in twitter.
I think the reason behind this is the Opensim server is adding the HTTP Expect header to the request, before sending it to twitter. In .NET, System.Net.ServicePointManager class has a static property named Expect100Continue and when using System.Net.HttpWebRequest to POST data from Opensim, HTTP Expect Header is automatically added to the request.
I think if you can set this static property to 'false', it would solve this issue.
Tagshttp
Git Revision or version number5bf2887
Run Mode Grid (1 Region per Sim)
Physics EngineBasicPhysics
Script Engine
EnvironmentUnknown
Mono VersionNone
Viewer
Attached Filestxt file icon http working for SL.txt [^] (897 bytes) 2009-09-09 19:14 [Show Content]

- Relationships

-  Notes
(0013267)
surangika (reporter)
2009-09-09 19:12

LSL code does cannot be viewed properly in the original post.
The twitter_url variable must be:
string twitter_url = "wangluyao@twitter.com/direct_messages/new.xml";">http://wanlu737:wangluyao@twitter.com/direct_messages/new.xml"; [wangluyao@twitter.com/direct_messages/new.xml";" target="_blank">^]
(0013268)
surangika (reporter)
2009-09-09 19:14

it is wrong again. i am attaching the txt file that includes the code
(0014834)
breen whitman (reporter)
2010-01-23 16:44

Specifically:

System.Net.ServicePointManager.Expect100Continue = false;

Although this is more a twitter problem. Little wonder that mobile phone operators hate twitter, and many refuse to support it.
(0019631)
makopoppo (manager)
2011-08-18 08:03

This issue still exists in OpenSim 0.7.2-dev. Probably creating some switch in OpenSimDefaults.ini to set if expect100continue will be enabled might be a solution for it.

- Issue History
Date Modified Username Field Change
2009-09-09 19:08 surangika New Issue
2009-09-09 19:08 surangika Git Revision => 5bf2887
2009-09-09 19:08 surangika SVN Revision => 0
2009-09-09 19:08 surangika Run Mode => Grid (1 Region per Sim)
2009-09-09 19:08 surangika Physics Engine => BasicPhysics
2009-09-09 19:08 surangika Environment => Unknown
2009-09-09 19:08 surangika Mono Version => None
2009-09-09 19:12 surangika Note Added: 0013267
2009-09-09 19:14 surangika Note Added: 0013268
2009-09-09 19:14 surangika File Added: http working for SL.txt
2009-09-19 15:02 Fly-Man- Tag Attached: http
2010-01-23 16:44 breen whitman Note Added: 0014834
2011-08-18 08:03 makopoppo Note Added: 0019631
2011-08-18 08:03 makopoppo Status new => acknowledged


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker