summaryrefslogtreecommitdiff
path: root/trackerlogic.h
diff options
context:
space:
mode:
authorerdgeist <>2009-01-05 18:05:39 +0000
committererdgeist <>2009-01-05 18:05:39 +0000
commit779d6c235ff8fe5284fd10dc82a9b99e7fa38d06 (patch)
tree043369d2a98a45b902e5d0968e28d78c1771b143 /trackerlogic.h
parent8bdc0d73f6f0bcaf83b7fb3d39e79e8fa4e6050d (diff)
* http and udp routines now use thread local buffers passed in workstruct containers. In other words they do not use static_buffer anymore and are considered to be thread safe.
* the new workstruct also introduces a well defined buffer and result passing path * a new function scan_find_keywords is a wrapper around scan_urlencoded_query that maps keys in url to values passed in an array of ot_keywords structs * this new function cleans up much of url parameter parsing work, where read_ptr and write_ptr have been introduced rather than the confusing char *c, *data variables * I now use memcmp instead of byte_diff to allow compiler to optimize constant size string compares * got rid of UTORRENT_1600_WORKAROUND * livesync_ticker is now only called from one (currently main) thread to avoid race conditions
Diffstat (limited to 'trackerlogic.h')
-rw-r--r--trackerlogic.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/trackerlogic.h b/trackerlogic.h
index 34cee3b..eb2906b 100644
--- a/trackerlogic.h
+++ b/trackerlogic.h
@@ -96,6 +96,31 @@ struct ot_peerlist {
96}; 96};
97#define OT_PEERLIST_HASBUCKETS(peer_list) ((peer_list) && ((peer_list)->peers.size > (peer_list)->peers.space)) 97#define OT_PEERLIST_HASBUCKETS(peer_list) ((peer_list) && ((peer_list)->peers.size > (peer_list)->peers.space))
98 98
99struct ot_workstruct {
100 /* Thread specific, static */
101#define THREAD_INBUF_SIZE 8192
102 char *inbuf;
103 size_t inbuf_size;
104#define THREAD_OUTBUF_SIZE 8192
105 char *outbuf;
106 size_t outbuf_size;
107#ifdef _DEBUG_HTTPERROR
108#define THREAD_DEBUGBUF_SIZE 8192
109 char *debugbuf;
110 size_t debugbuf_size;
111#endif
112
113 /* HTTP specific, non static */
114 char *request;
115 ssize_t request_size;
116 char *reply;
117 ssize_t reply_size;
118#ifdef _DEBUG_PEERID
119 char *peer_id;
120 ssize_t peer_id_size;
121#endif
122};
123
99/* 124/*
100 Exported functions 125 Exported functions
101*/ 126*/