summaryrefslogtreecommitdiff
path: root/ot_http.c
diff options
context:
space:
mode:
Diffstat (limited to 'ot_http.c')
-rw-r--r--ot_http.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ot_http.c b/ot_http.c
index 69bbc8e..626547b 100644
--- a/ot_http.c
+++ b/ot_http.c
@@ -18,7 +18,6 @@
18#include "array.h" 18#include "array.h"
19#include "iob.h" 19#include "iob.h"
20#include "ip6.h" 20#include "ip6.h"
21#include "scan.h"
22 21
23/* Opentracker */ 22/* Opentracker */
24#include "ot_accesslist.h" 23#include "ot_accesslist.h"
@@ -26,6 +25,7 @@
26#include "ot_http.h" 25#include "ot_http.h"
27#include "ot_iovec.h" 26#include "ot_iovec.h"
28#include "ot_mutex.h" 27#include "ot_mutex.h"
28#include "ot_scan.h"
29#include "ot_stats.h" 29#include "ot_stats.h"
30#include "scan_urlencoded_query.h" 30#include "scan_urlencoded_query.h"
31#include "trackerlogic.h" 31#include "trackerlogic.h"
@@ -618,6 +618,7 @@ static ssize_t http_handle_announce(const int64 sock, struct ot_workstruct *
618 // if( accesslist_is_blessed( cookie->ip, OT_PERMISSION_MAY_STAT ) ) { 618 // if( accesslist_is_blessed( cookie->ip, OT_PERMISSION_MAY_STAT ) ) {
619 char *tmp_buf = ws->reply; 619 char *tmp_buf = ws->reply;
620 ot_net net; 620 ot_net net;
621 uint64_t value;
621 signed short parsed, bits; 622 signed short parsed, bits;
622 623
623 len = scan_urlencoded_query(&read_ptr, tmp_buf, SCAN_SEARCHPATH_VALUE); 624 len = scan_urlencoded_query(&read_ptr, tmp_buf, SCAN_SEARCHPATH_VALUE);
@@ -634,9 +635,10 @@ static ssize_t http_handle_announce(const int64 sock, struct ot_workstruct *
634 if (tmp_buf[parsed++] != '/') 635 if (tmp_buf[parsed++] != '/')
635 bits = 128; 636 bits = 128;
636 else { 637 else {
637 parsed = scan_short(tmp_buf + parsed, &bits); 638 parsed = scan_udec(tmp_buf + parsed, &value, 128);
638 if (!parsed) 639 if (!parsed)
639 HTTPERROR_400_PARAM; 640 HTTPERROR_400_PARAM;
641 bits = (signed short)value;
640 if (ip6_isv4mapped(net.address)) 642 if (ip6_isv4mapped(net.address))
641 bits += 96; 643 bits += 96;
642 } 644 }