MINOR: log: make the backend fall back to the frontend when there's no stream

This is already what happens before the backend is assigned, except that
now we don't need to dereference a NULL stream to figure this.
This commit is contained in:
Willy Tarreau 2018-09-05 15:07:15 +02:00
parent 43c538eab6
commit a21c0e60d2

View File

@ -1571,7 +1571,7 @@ void deinit_log_buffers()
int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t maxsize, struct list *list_format)
{
struct proxy *fe = sess->fe;
struct proxy *be = s->be;
struct proxy *be = s ? s->be : fe;
struct http_txn *txn = s->txn;
struct buffer chunk;
char *uri;
@ -1995,7 +1995,7 @@ int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t
break;
case LOG_FMT_TD: // %Td
if (s->be->mode == PR_MODE_HTTP)
if (be->mode == PR_MODE_HTTP)
ret = ltoa_o((s->logs.t_data >= 0) ? s->logs.t_close - s->logs.t_data : -1,
tmplog, dst + maxsize - tmplog);
else