Lines 272-277
Link Here
|
272 |
char *arg; |
272 |
char *arg; |
273 |
int condition_sense; |
273 |
int condition_sense; |
274 |
int want_orig; |
274 |
int want_orig; |
|
|
275 |
int want_empty; |
275 |
apr_array_header_t *conditions; |
276 |
apr_array_header_t *conditions; |
276 |
} log_format_item; |
277 |
} log_format_item; |
277 |
|
278 |
|
Lines 283-289
Link Here
|
283 |
static char *pfmt(apr_pool_t *p, int i) |
284 |
static char *pfmt(apr_pool_t *p, int i) |
284 |
{ |
285 |
{ |
285 |
if (i <= 0) { |
286 |
if (i <= 0) { |
286 |
return "-"; |
287 |
return NULL; |
287 |
} |
288 |
} |
288 |
else { |
289 |
else { |
289 |
return format_integer(p, i); |
290 |
return format_integer(p, i); |
Lines 322-328
Link Here
|
322 |
char *rvalue = r->user; |
323 |
char *rvalue = r->user; |
323 |
|
324 |
|
324 |
if (rvalue == NULL) { |
325 |
if (rvalue == NULL) { |
325 |
rvalue = "-"; |
326 |
return NULL; |
326 |
} |
327 |
} |
327 |
else if (strlen(rvalue) == 0) { |
328 |
else if (strlen(rvalue) == 0) { |
328 |
rvalue = "\"\""; |
329 |
rvalue = "\"\""; |
Lines 381-387
Link Here
|
381 |
static const char *clf_log_bytes_sent(request_rec *r, char *a) |
382 |
static const char *clf_log_bytes_sent(request_rec *r, char *a) |
382 |
{ |
383 |
{ |
383 |
if (!r->sent_bodyct || !r->bytes_sent) { |
384 |
if (!r->sent_bodyct || !r->bytes_sent) { |
384 |
return "-"; |
385 |
return NULL; |
385 |
} |
386 |
} |
386 |
else { |
387 |
else { |
387 |
return apr_off_t_toa(r->pool, r->bytes_sent); |
388 |
return apr_off_t_toa(r->pool, r->bytes_sent); |
Lines 774-779
Link Here
|
774 |
it->want_orig = -1; |
775 |
it->want_orig = -1; |
775 |
it->arg = ""; /* For safety's sake... */ |
776 |
it->arg = ""; /* For safety's sake... */ |
776 |
|
777 |
|
|
|
778 |
it->want_empty = 0; |
779 |
|
777 |
while (*s) { |
780 |
while (*s) { |
778 |
int i; |
781 |
int i; |
779 |
|
782 |
|
Lines 802-807
Link Here
|
802 |
it->arg = ap_getword(p, &s, '}'); |
805 |
it->arg = ap_getword(p, &s, '}'); |
803 |
break; |
806 |
break; |
804 |
|
807 |
|
|
|
808 |
case '^': |
809 |
++s; |
810 |
it->want_empty = 1; |
811 |
break; |
812 |
|
805 |
case '0': |
813 |
case '0': |
806 |
case '1': |
814 |
case '1': |
807 |
case '2': |
815 |
case '2': |
Lines 887-900
Link Here
|
887 |
|
895 |
|
888 |
if ((item->condition_sense && in_list) |
896 |
if ((item->condition_sense && in_list) |
889 |
|| (!item->condition_sense && !in_list)) { |
897 |
|| (!item->condition_sense && !in_list)) { |
890 |
return "-"; |
898 |
return item->want_empty ? "" : "-"; |
891 |
} |
899 |
} |
892 |
} |
900 |
} |
893 |
|
901 |
|
894 |
/* We do. Do it... */ |
902 |
/* We do. Do it... */ |
895 |
|
903 |
|
896 |
cp = (*item->func) (item->want_orig ? orig : r, item->arg); |
904 |
cp = (*item->func) (item->want_orig ? orig : r, item->arg); |
897 |
return cp ? cp : "-"; |
905 |
|
|
|
906 |
if (cp == NULL) |
907 |
return item->want_empty ? "" : "-"; |
908 |
|
909 |
return cp; |
898 |
} |
910 |
} |
899 |
|
911 |
|
900 |
static void flush_log(buffered_log *buf) |
912 |
static void flush_log(buffered_log *buf) |
Lines 1375-1381
Link Here
|
1375 |
|
1387 |
|
1376 |
pl = ap_open_piped_log(p, name + 1); |
1388 |
pl = ap_open_piped_log(p, name + 1); |
1377 |
if (pl == NULL) { |
1389 |
if (pl == NULL) { |
1378 |
return NULL;; |
1390 |
return NULL; |
1379 |
} |
1391 |
} |
1380 |
return ap_piped_log_write_fd(pl); |
1392 |
return ap_piped_log_write_fd(pl); |
1381 |
} |
1393 |
} |