mirror of
https://github.com/clearlinux/clr-debug-info.git
synced 2026-09-06 13:51:38 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
71f4e789c4 | ||
|
|
f776162882 | ||
|
|
a2abd8d2a9 | ||
|
|
8844b0b0e1 |
+7
-2
@@ -36,6 +36,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
@@ -185,7 +186,7 @@ static void *server_thread(void *arg)
|
|||||||
path++;
|
path++;
|
||||||
|
|
||||||
|
|
||||||
if (strstr(path, "..") || strstr(prefix, "..")) {
|
if (strstr(path, "..") || strstr(prefix, "..") || strstr(path, "'") || strstr(path, ";")) {
|
||||||
close(fd);
|
close(fd);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -212,6 +213,9 @@ static void *server_thread(void *arg)
|
|||||||
if (timedelta(before, after) > 0.6)
|
if (timedelta(before, after) > 0.6)
|
||||||
printf("Request for %s took %5.2f seconds (%i - %i)\n", url,
|
printf("Request for %s took %5.2f seconds (%i - %i)\n", url,
|
||||||
after.tv_sec - before.tv_sec + (1.0*after.tv_usec - before.tv_usec) / 1000000.0, ret, (int)timestamp);
|
after.tv_sec - before.tv_sec + (1.0*after.tv_usec - before.tv_usec) / 1000000.0, ret, (int)timestamp);
|
||||||
|
|
||||||
|
if (ret != 200)
|
||||||
|
printf("Request for %s resulted in error %i\n", url, ret);
|
||||||
free(url);
|
free(url);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -259,8 +263,9 @@ int main(int argc, char **argv)
|
|||||||
int clientsock;
|
int clientsock;
|
||||||
pthread_t thread;
|
pthread_t thread;
|
||||||
|
|
||||||
|
malloc_trim(0);
|
||||||
clientsock = accept(sockfd, NULL, NULL);
|
clientsock = accept(sockfd, NULL, NULL);
|
||||||
|
|
||||||
if (!curl_done) {
|
if (!curl_done) {
|
||||||
curl_global_init(CURL_GLOBAL_ALL);
|
curl_global_init(CURL_GLOBAL_ALL);
|
||||||
curl_done = 1;
|
curl_done = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user