Index: trunk/willow/src/include/flowio.h |
— | — | @@ -86,7 +86,7 @@ |
87 | 87 | |
88 | 88 | enum dio_source { |
89 | 89 | dio_source_fd, |
90 | | - dio_source_socket, |
| 90 | + dio_source_socket |
91 | 91 | }; |
92 | 92 | |
93 | 93 | /* |
Index: trunk/willow/src/include/flalloc.h |
— | — | @@ -49,6 +49,9 @@ |
50 | 50 | return pos; |
51 | 51 | } |
52 | 52 | |
| 53 | + void operator delete (void *, T *) { |
| 54 | + } |
| 55 | + |
53 | 56 | void operator delete (void *p) { |
54 | 57 | T *o = (T *)p; |
55 | 58 | o->_freelist_next = _freelist; |
Index: trunk/willow/src/include/willow.h |
— | — | @@ -32,10 +32,6 @@ |
33 | 33 | #include "radix.h" |
34 | 34 | #include "ptalloc.h" |
35 | 35 | |
36 | | -#ifdef __INTEL_COMPILER |
37 | | -# pragma warning (disable: 869 981 304 383 1418 1469 810) |
38 | | -#endif |
39 | | - |
40 | 36 | typedef unsigned long long w_size_t; |
41 | 37 | |
42 | 38 | #include <stdlib.h> |
Index: trunk/willow/src/include/util.h |
— | — | @@ -15,6 +15,10 @@ |
16 | 16 | #include <iostream> |
17 | 17 | #include <string> |
18 | 18 | |
| 19 | +#ifdef __INTEL_COMPILER |
| 20 | +# pragma warning (disable: 869 981 304 383 1418 1469 810 444) |
| 21 | +#endif |
| 22 | + |
19 | 23 | struct noncopyable { |
20 | 24 | noncopyable() {}; |
21 | 25 | private: |
— | — | @@ -54,5 +58,4 @@ |
55 | 59 | return lexical_caster<From, To>::cast(f); |
56 | 60 | } |
57 | 61 | |
58 | | - |
59 | 62 | #endif |
Index: trunk/willow/src/include/wnet.h |
— | — | @@ -173,7 +173,7 @@ |
174 | 174 | |
175 | 175 | enum socktype { |
176 | 176 | st_stream = SOCK_STREAM, |
177 | | - st_dgram = SOCK_DGRAM, |
| 177 | + st_dgram = SOCK_DGRAM |
178 | 178 | }; |
179 | 179 | |
180 | 180 | struct address : freelist_allocator<address> { |
Index: trunk/willow/src/include/wbackend.h |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | enum lb_type { |
30 | 30 | lb_rr, |
31 | 31 | lb_carp, |
32 | | - lb_carp_hostonly, |
| 32 | + lb_carp_hostonly |
33 | 33 | }; |
34 | 34 | |
35 | 35 | struct backend_list; |
Index: trunk/willow/src/include/confparse.h |
— | — | @@ -26,6 +26,7 @@ |
27 | 27 | using std::pair; |
28 | 28 | |
29 | 29 | #include "willow.h" |
| 30 | +#include "util.h" |
30 | 31 | |
31 | 32 | /* |
32 | 33 | * the config tree. |
Index: trunk/willow/src/include/format.h |
— | — | @@ -34,7 +34,9 @@ |
35 | 35 | format (string const &); |
36 | 36 | |
37 | 37 | template<typename T> |
38 | | - format& operator%(T const &); |
| 38 | + format& operator% (T const &); |
| 39 | + template<typename T, int i> |
| 40 | + format& operator% (T (&)[i]); |
39 | 41 | |
40 | 42 | string str(void) const; |
41 | 43 | operator string(void) const; |
— | — | @@ -47,7 +49,7 @@ |
48 | 50 | at_decint, |
49 | 51 | at_hexint, |
50 | 52 | at_octint, |
51 | | - at_errno, |
| 53 | + at_errno |
52 | 54 | }; |
53 | 55 | vector<argtype> _argtypes; |
54 | 56 | vector<string> _args; |
— | — | @@ -83,4 +85,11 @@ |
84 | 86 | return *this; |
85 | 87 | } |
86 | 88 | |
| 89 | +template<typename T, int i> |
| 90 | +format& |
| 91 | +format::operator% (T (&s)[i]) |
| 92 | +{ |
| 93 | + return *this % (T *)s; |
| 94 | +} |
| 95 | + |
87 | 96 | #endif |
Index: trunk/willow/src/willow/wconfig.cc |
— | — | @@ -123,6 +123,8 @@ |
124 | 124 | try { |
125 | 125 | nl->sock = it->makesocket("HTTP listener", prio_accept); |
126 | 126 | } catch (socket_error &ex) { |
| 127 | + wlog(WLOG_DEBUG, format("creating listener %s: %s") |
| 128 | + % e.item_key % ex.what()); |
127 | 129 | delete nl; |
128 | 130 | delete res; |
129 | 131 | return; |
— | — | @@ -170,9 +172,8 @@ |
171 | 173 | static bool |
172 | 174 | v_udp_log(tree_entry &e, value &v) |
173 | 175 | { |
174 | | -value *val; |
175 | 176 | bool ret = true; |
176 | | - if ((val = e/"udp-host") == NULL) { |
| 177 | + if (e/"udp-host" == NULL) { |
177 | 178 | v.report_error("udp-host must be specified for UDP logging"); |
178 | 179 | ret = false; |
179 | 180 | } |
— | — | @@ -253,7 +254,6 @@ |
254 | 255 | { |
255 | 256 | vector<avalue>::iterator it = v.cv_values.begin(), |
256 | 257 | end = v.cv_values.end(); |
257 | | -prefix p; |
258 | 258 | for (; it != end; ++it) { |
259 | 259 | if (it->av_type != cv_qstring) { |
260 | 260 | v.report_error("access prefix must be a list of quoted strings"); |
— | — | @@ -339,9 +339,9 @@ |
340 | 340 | bpools.insert(make_pair(gn, backend_pool(e.item_key, lbtype, fogroup))); |
341 | 341 | |
342 | 342 | if ((v = e/"hosts") != NULL) { |
343 | | - vector<avalue>::iterator it = v->cv_values.begin(), end = v->cv_values.end(); |
344 | | - for (; it != end; ++it) |
345 | | - host_to_bpool[imstring(it->av_strval)] = gn; |
| 343 | + vector<avalue>::iterator hit = v->cv_values.begin(), hend = v->cv_values.end(); |
| 344 | + for (; hit != hend; ++hit) |
| 345 | + host_to_bpool[imstring(hit->av_strval)] = gn; |
346 | 346 | used_pools.insert(gn); |
347 | 347 | } |
348 | 348 | } |
Index: trunk/willow/src/willow/whttp.cc |
— | — | @@ -1012,13 +1012,13 @@ |
1013 | 1013 | if (alf.is_open()) { |
1014 | 1014 | string line; |
1015 | 1015 | line = format("[%s] %s %s\"%s\" %d %d %s MISS") |
1016 | | - % current_time_short |
| 1016 | + % (char *)current_time_short |
1017 | 1017 | % _client_socket->straddr(false) |
1018 | 1018 | % request_string[_header_parser->_http_reqtype] |
1019 | 1019 | % _request_path |
1020 | 1020 | % size |
1021 | 1021 | % _response |
1022 | | - % (_backend ? _backend->be_name : "-"); |
| 1022 | + % (_backend ? _backend->be_name : string("-")); |
1023 | 1023 | |
1024 | 1024 | HOLDING(alf_lock); |
1025 | 1025 | |
— | — | @@ -1028,7 +1028,7 @@ |
1029 | 1029 | } |
1030 | 1030 | } |
1031 | 1031 | |
1032 | | - if (config.udp_log) { |
| 1032 | + if (do_udplog) { |
1033 | 1033 | char buf[65535]; |
1034 | 1034 | char *bufp = buf, *endp = buf + sizeof(buf); |
1035 | 1035 | /* |
Index: trunk/willow/src/willow/wlog.cc |
— | — | @@ -70,7 +70,7 @@ |
71 | 71 | if (sev < logging.level) |
72 | 72 | return; |
73 | 73 | |
74 | | - r = format("%s| %s: %s") % current_time_short % sev_names[sev] % e; |
| 74 | + r = format("%s| %s: %s") % (char *)current_time_short % sev_names[sev] % e; |
75 | 75 | |
76 | 76 | HOLDING(log_lock); |
77 | 77 | if (logging.syslog) |
Index: trunk/willow/src/willow/wnet.cc |
— | — | @@ -124,7 +124,6 @@ |
125 | 125 | void |
126 | 126 | ioloop_t::_accept(wsocket *s, int) |
127 | 127 | { |
128 | | - int val; |
129 | 128 | wsocket *newe; |
130 | 129 | static atomic<time_t> last_nfile = 0; |
131 | 130 | time_t now = time(NULL); |
Index: trunk/willow/src/willow/willow.cc |
— | — | @@ -351,7 +351,7 @@ |
352 | 352 | static struct event stats_ev; |
353 | 353 | static struct timeval stats_tv; |
354 | 354 | static void stats_sched(void); |
355 | | -void add_stats_listener(pair<string,string> const &ip); |
| 355 | +static void add_stats_listener(pair<string,string> const &ip); |
356 | 356 | |
357 | 357 | struct stats_handler_stru : noncopyable { |
358 | 358 | void callback (wsocket *, int); |
— | — | @@ -425,7 +425,7 @@ |
426 | 426 | stats_sched(); |
427 | 427 | } |
428 | 428 | |
429 | | -void |
| 429 | +static void |
430 | 430 | add_stats_listener(pair<string,string> const &ip) |
431 | 431 | { |
432 | 432 | addrlist *alist; |
Index: trunk/willow/src/willow/confparse.cc |
— | — | @@ -294,7 +294,6 @@ |
295 | 295 | if (*ap != '"' || ap[strlen(ap) - 1] != '"') |
296 | 296 | report_parse_error("%%pragma include_path must be followed by a quoted string"); |
297 | 297 | else { |
298 | | - const char *sp; |
299 | 298 | ap++; |
300 | 299 | ap[strlen(ap) - 1] = '\0'; |
301 | 300 | add_ipath(ap); |