summaryrefslogtreecommitdiff
path: root/src/serverlist.cpp
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2014-06-19 16:00:22 -0400
committerShadowNinja <shadowninja@minetest.net>2014-06-30 13:23:09 -0400
commitb2dfde8c8c29d0b118ba9018be202de21bb28505 (patch)
treea6add39e0e315c07625bc4b0625de8415683a43b /src/serverlist.cpp
parent1c01ed5f13e15857a45921c51ef095ea5efda05d (diff)
downloadminetest-b2dfde8c8c29d0b118ba9018be202de21bb28505.tar.gz
minetest-b2dfde8c8c29d0b118ba9018be202de21bb28505.tar.bz2
minetest-b2dfde8c8c29d0b118ba9018be202de21bb28505.zip
Add support for multipart/form-data to HTTPFetch for server announcing
Diffstat (limited to 'src/serverlist.cpp')
-rw-r--r--src/serverlist.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/serverlist.cpp b/src/serverlist.cpp
index 8a85b33b3..315e23688 100644
--- a/src/serverlist.cpp
+++ b/src/serverlist.cpp
@@ -230,11 +230,8 @@ void sendAnnounce(std::string action, const std::vector<std::string> & clients_n
Json::FastWriter writer;
HTTPFetchRequest fetchrequest;
fetchrequest.url = g_settings->get("serverlist_url") + std::string("/announce");
- std::string query = std::string("json=") + urlencode(writer.write(server));
- if (query.size() < 1000)
- fetchrequest.url += "?" + query;
- else
- fetchrequest.post_fields = query;
+ fetchrequest.post_fields["json"] = writer.write(server);
+ fetchrequest.multipart = true;
httpfetch_async(fetchrequest);
}
#endif