* Transfer timeout support for uploads. This code will be deprecated soon though as CAPS uploading is almost finished

* More parameters to HTTPBase and Capabilities for making special requests
* Renamed InventoryManager callbacks to match the rest of libsecondlife
* Several new InventoryManager functions, not complete yet!
* Fix for null buddy list on login
* OnSimConnecting returns a bool to allow canceling sim connections
* NetworkManager.Connect() properly returns null on a failure

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1393 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
John Hurliman
2007-09-10 10:20:30 +00:00
parent 9dccf908da
commit 62dddabd7c
12 changed files with 986 additions and 529 deletions

View File

@@ -44,17 +44,14 @@ namespace libsecondlife
public HttpWebRequest WebRequest;
public HttpWebResponse WebResponse;
public Stream ResponseStream;
public object State;
internal int ResponseDataPos = 0;
public HttpRequestState(HttpWebRequest webRequest)
{
WebRequest = webRequest;
BufferRead = new byte[BUFFER_SIZE];
RequestData = null;
ResponseData = null;
ResponseStream = null;
}
}
@@ -85,14 +82,15 @@ namespace libsecondlife
public void MakeRequest()
{
MakeRequest(null);
MakeRequest(null, null, 0, null);
}
public void MakeRequest(byte[] postData)
public void MakeRequest(byte[] postData, string contentType, int udpListeningPort, object state)
{
// Create a new HttpWebRequest
HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(_RequestURL);
_RequestState = new HttpRequestState(httpRequest);
_RequestState.State = state;
if (_ProxyURL != String.Empty)
{
@@ -118,6 +116,12 @@ namespace libsecondlife
// POST request
_RequestState.WebRequest.Method = "POST";
_RequestState.WebRequest.ContentLength = postData.Length;
if (udpListeningPort > 0)
_RequestState.WebRequest.Headers.Add("X-SecondLife-UDP-Listen-Port", udpListeningPort.ToString());
if (String.IsNullOrEmpty(contentType))
_RequestState.WebRequest.ContentType = "application/xml";
else
_RequestState.WebRequest.ContentType = contentType;
_RequestState.RequestData = postData;
IAsyncResult result = (IAsyncResult)_RequestState.WebRequest.BeginGetRequestStream(