diff options
Diffstat (limited to 'src/examples/mhd2spdy_structures.h')
-rw-r--r-- | src/examples/mhd2spdy_structures.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/examples/mhd2spdy_structures.h b/src/examples/mhd2spdy_structures.h index 863661b2..c9aa4c39 100644 --- a/src/examples/mhd2spdy_structures.h +++ b/src/examples/mhd2spdy_structures.h | |||
@@ -159,10 +159,22 @@ struct global_options | |||
159 | bool verbose; | 159 | bool verbose; |
160 | bool only_proxy; | 160 | bool only_proxy; |
161 | bool spdy_data_received; | 161 | bool spdy_data_received; |
162 | bool statistics; | ||
162 | } | 163 | } |
163 | glob_opt; | 164 | glob_opt; |
164 | 165 | ||
165 | 166 | ||
167 | struct global_statistics | ||
168 | { | ||
169 | //unsigned long long http_bytes_sent; | ||
170 | //unsigned long long http_bytes_received; | ||
171 | unsigned long long spdy_bytes_sent; | ||
172 | unsigned long long spdy_bytes_received; | ||
173 | unsigned long long spdy_bytes_received_and_dropped; | ||
174 | } | ||
175 | glob_stat; | ||
176 | |||
177 | |||
166 | //forbidden headers | 178 | //forbidden headers |
167 | #define SPDY_HTTP_HEADER_TRANSFER_ENCODING "transfer-encoding" | 179 | #define SPDY_HTTP_HEADER_TRANSFER_ENCODING "transfer-encoding" |
168 | #define SPDY_HTTP_HEADER_PROXY_CONNECTION "proxy-connection" | 180 | #define SPDY_HTTP_HEADER_PROXY_CONNECTION "proxy-connection" |
@@ -241,6 +253,13 @@ glob_opt; | |||
241 | while(0) | 253 | while(0) |
242 | 254 | ||
243 | 255 | ||
256 | #define UPDATE_STAT(stat, value) do{\ | ||
257 | if(glob_opt.statistics)\ | ||
258 | {\ | ||
259 | stat += value;\ | ||
260 | }\ | ||
261 | }\ | ||
262 | while(0) | ||
244 | 263 | ||
245 | 264 | ||
246 | void | 265 | void |