mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Update and fix SpeedtestC
This commit is contained in:
parent
8b034acdae
commit
ad680591c1
3 changed files with 87 additions and 3 deletions
|
@ -37,6 +37,7 @@ MY_DEPENDS := \
|
|||
luci-app-vnstat omr-quota luci-app-omr-quota \
|
||||
luci-app-mptcp luci-app-openmptcprouter luci-app-omr-bypass \
|
||||
omr-6in4 ip6tables-mod-nat luci-proto-ipv6 6to4 6in4 6rd iputils-traceroute6 \
|
||||
speedtestc \
|
||||
ethtool \
|
||||
luci-proto-3g \
|
||||
luci-app-mlvpn mlvpn \
|
||||
|
|
|
@ -8,11 +8,13 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=speedtestc
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/mobrembski/SpeedTestC.git
|
||||
#PKG_SOURCE_URL:=https://github.com/mobrembski/SpeedTestC.git
|
||||
PKG_SOURCE_URL:=https://github.com/egliu/SpeedTestC.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=56482555e34f7f4002b116efd63cfa68634d389f
|
||||
#PKG_SOURCE_VERSION:=56482555e34f7f4002b116efd63cfa68634d389f
|
||||
PKG_SOURCE_VERSION:=f7623914afabda582f146caab1081e601a34e882
|
||||
PKG_MAINTAINER:=Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
|
|
81
speedtestc/patches/compile-fix.patch
Normal file
81
speedtestc/patches/compile-fix.patch
Normal file
|
@ -0,0 +1,81 @@
|
|||
diff --git a/src/SpeedtestConfig.c b/SpeedTestC/src/SpeedtestConfig.c
|
||||
index 7b60a59..d9f58c9 100644
|
||||
--- a/src/SpeedtestConfig.c
|
||||
+++ b/src/SpeedtestConfig.c
|
||||
@@ -50,7 +50,7 @@ static void parseClient(const char *configline, SPEEDTESTCONFIG_T **result_p)
|
||||
char lat[16] = {0};
|
||||
char lon[16] = {0};
|
||||
|
||||
- if(sscanf(configline,"%*[^\"]\"%15[^\"]\"%*[^\"]\"%15[^\"]\"%*[^\"]\"%15[^\"]\"%*[^\"]\"%255[^\"]\"",
|
||||
+ if(sscanf(configline,"%*[^\"]\"%15[^\"]\"%*[^\"]\"%20[^\"]\"%*[^\"]\"%20[^\"]\"%*[^\"]\"%255[^\"]\"",
|
||||
result->ip, lat, lon, result->isp)!=4)
|
||||
{
|
||||
fprintf(stderr,"Cannot parse all fields! Config line: %s", configline);
|
||||
diff --git a/src/SpeedtestDownloadTest.c b/src/SpeedtestDownloadTest.c
|
||||
index 54ed45d..545582a 100644
|
||||
--- a/src/SpeedtestDownloadTest.c
|
||||
+++ b/src/SpeedtestDownloadTest.c
|
||||
@@ -32,7 +32,7 @@ static void *__downloadThread(void *arg)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
-void testDownload(const char *url)
|
||||
+void testDownload(char *url)
|
||||
{
|
||||
size_t numOfThreads = speedTestConfig->downloadThreadConfig.count *
|
||||
speedTestConfig->downloadThreadConfig.sizeLength;
|
||||
diff --git a/src/SpeedtestDownloadTest.h b/src/SpeedtestDownloadTest.h
|
||||
index e341f31..45e9d9a 100644
|
||||
--- a/src/SpeedtestDownloadTest.h
|
||||
+++ b/src/SpeedtestDownloadTest.h
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef _SPEEDTEST_DOWNLOAD_TEST_
|
||||
#define _SPEEDTEST_DOWNLOAD_TEST_
|
||||
|
||||
-void testDownload(const char *url);
|
||||
+void testDownload(char *url);
|
||||
|
||||
#endif
|
||||
diff --git a/src/SpeedtestServers.c b/src/SpeedtestServers.c
|
||||
index 5456f69..e3ca9b4 100644
|
||||
--- a/src/SpeedtestServers.c
|
||||
+++ b/src/SpeedtestServers.c
|
||||
@@ -106,9 +106,9 @@ SPEEDTESTSERVER_T **getServers(int *serverCount, char *ignoreServers, float lat,
|
||||
"http://c.speedtest.net/speedtest-servers-static.php",
|
||||
"http://www.speedtest.net/speedtest-servers.php",
|
||||
"http://c.speedtest.net/speedtest-servers.php"};
|
||||
- const u_int32_t urlsCount = 4;
|
||||
- u_int32_t count = 0;
|
||||
- u_int32_t reallocCount = 0;
|
||||
+ const __int32_t urlsCount = 4;
|
||||
+ __int32_t count = 0;
|
||||
+ __int32_t reallocCount = 0;
|
||||
|
||||
/* malloc the size as the macro SERVER_SIZE defines */
|
||||
list = (SPEEDTESTSERVER_T**)calloc(SERVER_SIZE, sizeof(SPEEDTESTSERVER_T**));
|
||||
diff --git a/src/SpeedtestUploadTest.c b/src/SpeedtestUploadTest.c
|
||||
index b0414df..5804af6 100644
|
||||
--- a/src/SpeedtestUploadTest.c
|
||||
+++ b/src/SpeedtestUploadTest.c
|
||||
@@ -24,7 +24,7 @@ static void *__uploadThread(void *arg)
|
||||
{
|
||||
/* Testing upload... */
|
||||
THREADARGS_T *threadConfig = (THREADARGS_T *)arg;
|
||||
- int i, size, sockId;
|
||||
+ int size, sockId;
|
||||
unsigned long totalTransfered = 0;
|
||||
char uploadUrl[1024];
|
||||
|
||||
diff --git a/src/http.c b/src/http.c
|
||||
index 7ace0e1..4c03205 100644
|
||||
--- a/src/http.c
|
||||
+++ b/src/http.c
|
||||
@@ -112,7 +112,7 @@ int httpGet(char* pAddress, int pPort, char* pRequest)
|
||||
|
||||
}
|
||||
|
||||
- if(!success == 1)
|
||||
+ if((!success) == 1)
|
||||
{
|
||||
close(sockId);
|
||||
return 0;
|
Loading…
Add table
Add a link
Reference in a new issue