Use a relative URL for SwiftConfig.
This makes it easier to use a different address,
in particular the port.
Also add a missing header for std::max.
Change-Id: I454dd6f4a92b5d8b97625e4cb50796e9f0940009
Reviewed-on: https://swiftshader-review.googlesource.com/16668
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Main/SwiftConfig.cpp b/src/Main/SwiftConfig.cpp
index e29c82f..1c22394 100644
--- a/src/Main/SwiftConfig.cpp
+++ b/src/Main/SwiftConfig.cpp
@@ -24,6 +24,7 @@
#include <time.h>
#include <sys/stat.h>
#include <string.h>
+#include <algorithm>
namespace sw
{
@@ -247,7 +248,7 @@
html += "function request()\n";
html += "{\n";
html += "var xhr = new XMLHttpRequest();\n";
- html += "xhr.open('POST', 'http://localhost:8080/swiftshader/profile', true);\n";
+ html += "xhr.open('POST', '/swiftshader/profile', true);\n";
html += "xhr.onreadystatechange = function()\n";
html += "{\n";
html += "if(xhr.readyState == 4 && xhr.status == 200)\n";