diff options
author | Oren Hurvitz | 2014-04-24 14:19:03 +0300 |
---|---|---|
committer | Oren Hurvitz | 2014-04-24 15:58:41 +0100 |
commit | d15a3b10a3031b9552d67d2e2d435a689b448e2f (patch) | |
tree | 647c987c479a475ab247784cedef12779e92e7ff /OpenSim/Framework/WebUtil.cs | |
parent | Fixed: hypergrid-linking stopped accepting the following format: "http://grid... (diff) | |
download | opensim-SC-d15a3b10a3031b9552d67d2e2d435a689b448e2f.zip opensim-SC-d15a3b10a3031b9552d67d2e2d435a689b448e2f.tar.gz opensim-SC-d15a3b10a3031b9552d67d2e2d435a689b448e2f.tar.bz2 opensim-SC-d15a3b10a3031b9552d67d2e2d435a689b448e2f.tar.xz |
When sending JSON-RPC calls (for UserProfile), use WebUtil instead of constructing the HTTP requests manually. This allows the calls to be logged when using "debug http all 6".
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/WebUtil.cs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 768ff16..8f5bc0c 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs | |||
@@ -127,41 +127,41 @@ namespace OpenSim.Framework | |||
127 | /// </summary> | 127 | /// </summary> |
128 | public static OSDMap PutToServiceCompressed(string url, OSDMap data, int timeout) | 128 | public static OSDMap PutToServiceCompressed(string url, OSDMap data, int timeout) |
129 | { | 129 | { |
130 | return ServiceOSDRequest(url,data, "PUT", timeout, true); | 130 | return ServiceOSDRequest(url,data, "PUT", timeout, true, false); |
131 | } | 131 | } |
132 | 132 | ||
133 | public static OSDMap PutToService(string url, OSDMap data, int timeout) | 133 | public static OSDMap PutToService(string url, OSDMap data, int timeout) |
134 | { | 134 | { |
135 | return ServiceOSDRequest(url,data, "PUT", timeout, false); | 135 | return ServiceOSDRequest(url,data, "PUT", timeout, false, false); |
136 | } | 136 | } |
137 | 137 | ||
138 | public static OSDMap PostToService(string url, OSDMap data, int timeout) | 138 | public static OSDMap PostToService(string url, OSDMap data, int timeout, bool rpc) |
139 | { | 139 | { |
140 | return ServiceOSDRequest(url, data, "POST", timeout, false); | 140 | return ServiceOSDRequest(url, data, "POST", timeout, false, rpc); |
141 | } | 141 | } |
142 | 142 | ||
143 | public static OSDMap PostToServiceCompressed(string url, OSDMap data, int timeout) | 143 | public static OSDMap PostToServiceCompressed(string url, OSDMap data, int timeout) |
144 | { | 144 | { |
145 | return ServiceOSDRequest(url, data, "POST", timeout, true); | 145 | return ServiceOSDRequest(url, data, "POST", timeout, true, false); |
146 | } | 146 | } |
147 | 147 | ||
148 | public static OSDMap GetFromService(string url, int timeout) | 148 | public static OSDMap GetFromService(string url, int timeout) |
149 | { | 149 | { |
150 | return ServiceOSDRequest(url, null, "GET", timeout, false); | 150 | return ServiceOSDRequest(url, null, "GET", timeout, false, false); |
151 | } | 151 | } |
152 | 152 | ||
153 | public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, int timeout, bool compressed) | 153 | public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, int timeout, bool compressed, bool rpc) |
154 | { | 154 | { |
155 | if (SerializeOSDRequestsPerEndpoint) | 155 | if (SerializeOSDRequestsPerEndpoint) |
156 | { | 156 | { |
157 | lock (EndPointLock(url)) | 157 | lock (EndPointLock(url)) |
158 | { | 158 | { |
159 | return ServiceOSDRequestWorker(url, data, method, timeout, compressed); | 159 | return ServiceOSDRequestWorker(url, data, method, timeout, compressed, rpc); |
160 | } | 160 | } |
161 | } | 161 | } |
162 | else | 162 | else |
163 | { | 163 | { |
164 | return ServiceOSDRequestWorker(url, data, method, timeout, compressed); | 164 | return ServiceOSDRequestWorker(url, data, method, timeout, compressed, rpc); |
165 | } | 165 | } |
166 | } | 166 | } |
167 | 167 | ||
@@ -217,7 +217,7 @@ namespace OpenSim.Framework | |||
217 | LogOutgoingDetail("RESPONSE: ", input); | 217 | LogOutgoingDetail("RESPONSE: ", input); |
218 | } | 218 | } |
219 | 219 | ||
220 | private static OSDMap ServiceOSDRequestWorker(string url, OSDMap data, string method, int timeout, bool compressed) | 220 | private static OSDMap ServiceOSDRequestWorker(string url, OSDMap data, string method, int timeout, bool compressed, bool rpc) |
221 | { | 221 | { |
222 | int reqnum = RequestNumber++; | 222 | int reqnum = RequestNumber++; |
223 | 223 | ||
@@ -251,7 +251,7 @@ namespace OpenSim.Framework | |||
251 | 251 | ||
252 | byte[] buffer = System.Text.Encoding.UTF8.GetBytes(strBuffer); | 252 | byte[] buffer = System.Text.Encoding.UTF8.GetBytes(strBuffer); |
253 | 253 | ||
254 | request.ContentType = "application/json"; | 254 | request.ContentType = rpc ? "application/json-rpc" : "application/json"; |
255 | 255 | ||
256 | if (compressed) | 256 | if (compressed) |
257 | { | 257 | { |