summaryrefslogtreecommitdiff
path: root/ot_http.c
diff options
context:
space:
mode:
Diffstat (limited to 'ot_http.c')
-rw-r--r--ot_http.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/ot_http.c b/ot_http.c
index f116c1f..6d29e9c 100644
--- a/ot_http.c
+++ b/ot_http.c
@@ -171,7 +171,11 @@ static const ot_keywords keywords_mode[] =
171 { "busy", TASK_STATS_BUSY_NETWORKS }, { "torr", TASK_STATS_TORRENTS }, { "fscr", TASK_STATS_FULLSCRAPE }, 171 { "busy", TASK_STATS_BUSY_NETWORKS }, { "torr", TASK_STATS_TORRENTS }, { "fscr", TASK_STATS_FULLSCRAPE },
172 { "s24s", TASK_STATS_SLASH24S }, { "tpbs", TASK_STATS_TPB }, { "herr", TASK_STATS_HTTPERRORS }, { "completed", TASK_STATS_COMPLETED }, 172 { "s24s", TASK_STATS_SLASH24S }, { "tpbs", TASK_STATS_TPB }, { "herr", TASK_STATS_HTTPERRORS }, { "completed", TASK_STATS_COMPLETED },
173 { "top10", TASK_STATS_TOP10 }, { "renew", TASK_STATS_RENEW }, { "syncs", TASK_STATS_SYNCS }, { "version", TASK_STATS_VERSION }, 173 { "top10", TASK_STATS_TOP10 }, { "renew", TASK_STATS_RENEW }, { "syncs", TASK_STATS_SYNCS }, { "version", TASK_STATS_VERSION },
174 { "everything", TASK_STATS_EVERYTHING }, { "statedump", TASK_FULLSCRAPE_TRACKERSTATE }, { "fulllog", TASK_STATS_FULLLOG }, { NULL, -3 } }; 174 { "everything", TASK_STATS_EVERYTHING }, { "statedump", TASK_FULLSCRAPE_TRACKERSTATE }, { "fulllog", TASK_STATS_FULLLOG },
175#ifdef WANT_LOG_NUMWANT
176 { "numwants", TASK_STATS_NUMWANTS},
177#endif
178 { NULL, -3 } };
175static const ot_keywords keywords_format[] = 179static const ot_keywords keywords_format[] =
176 { { "bin", TASK_FULLSCRAPE_TPB_BINARY }, { "ben", TASK_FULLSCRAPE }, { "url", TASK_FULLSCRAPE_TPB_URLENCODED }, 180 { { "bin", TASK_FULLSCRAPE_TPB_BINARY }, { "ben", TASK_FULLSCRAPE }, { "url", TASK_FULLSCRAPE_TPB_URLENCODED },
177 { "txt", TASK_FULLSCRAPE_TPB_ASCII }, { NULL, -3 } }; 181 { "txt", TASK_FULLSCRAPE_TPB_ASCII }, { NULL, -3 } };
@@ -332,6 +336,10 @@ static ssize_t http_handle_scrape( const int64 sock, struct ot_workstruct *ws, c
332 return ws->reply_size; 336 return ws->reply_size;
333} 337}
334 338
339#ifdef WANT_LOG_NUMWANT
340 unsigned long long numwants[201];
341#endif
342
335static ot_keywords keywords_announce[] = { { "port", 1 }, { "left", 2 }, { "event", 3 }, { "numwant", 4 }, { "compact", 5 }, { "compact6", 5 }, { "info_hash", 6 }, 343static ot_keywords keywords_announce[] = { { "port", 1 }, { "left", 2 }, { "event", 3 }, { "numwant", 4 }, { "compact", 5 }, { "compact6", 5 }, { "info_hash", 6 },
336#ifdef WANT_IP_FROM_QUERY_STRING 344#ifdef WANT_IP_FROM_QUERY_STRING
337{ "ip", 7 }, 345{ "ip", 7 },
@@ -479,6 +487,10 @@ static ssize_t http_handle_announce( const int64 sock, struct ot_workstruct *ws,
479 } 487 }
480 } 488 }
481 489
490#ifdef WANT_LOG_NUMWANT
491 numwants[numwant]++;
492#endif
493
482 /* XXX DEBUG */ 494 /* XXX DEBUG */
483 stats_issue_event( EVENT_ACCEPT, FLAG_TCP, (uintptr_t)ws->reply ); 495 stats_issue_event( EVENT_ACCEPT, FLAG_TCP, (uintptr_t)ws->reply );
484 496