Commit 6e39d606 authored by Geoff Simmons's avatar Geoff Simmons

varnishevent: minor cleanup in varnishevent.c

parent 4165081e
...@@ -33,33 +33,16 @@ ...@@ -33,33 +33,16 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* Obtain log data from the shared memory log, order it by session ID, and * Obtain log data from the shared memory log and output single-line
* display it in Apache / NCSA combined log format: * events to an output stream. By default just like varnishncsa, but:
* *
* %h %l %u %t "%r" %s %b "%{Referer}i" "%{User-agent}i" * - output lines may correspond to both client and backend transactions
* * - also events on the pseudo fd 0, such as backend health checks, may be
* where the fields are defined as follows: * logged
* * - output formats are defined for client, backend and "zero" events
* %h Client host name or IP address (always the latter) * - some additional formatting tags are available
* %l Client user ID as reported by identd (always "-") * - the internal architecture is designed to ensure that the VSL-reading
* %u User ID if using HTTP authentication, or "-" * process keeps pace with varnishd writing to VSL under heavy loads
* %t Date and time of request
* %r Request line
* %s Status code
* %b Length of reply body, or "-"
* %{Referer}i Contents of "Referer" request header
* %{User-agent}i Contents of "User-agent" request header
*
* Actually, we cheat a little and replace "%r" with something close to
* "%m http://%{Host}i%U%q %H", where the additional fields are:
*
* %m Request method
* %{Host}i Contents of "Host" request header
* %U URL path
* %q Query string
* %H Protocol version
*
* TODO: - Maybe rotate/compress log
*/ */
#include "config.h" #include "config.h"
...@@ -190,8 +173,8 @@ static inline logline_t ...@@ -190,8 +173,8 @@ static inline logline_t
waits++; waits++;
if (!WRT_Waiting()) if (!WRT_Waiting())
AZ(pthread_cond_wait(&data_ready_cond, &data_ready_lock)); AZ(pthread_cond_wait(&data_ready_cond, &data_ready_lock));
AZ(pthread_mutex_unlock(&data_ready_lock));
waiting = 0; waiting = 0;
AZ(pthread_mutex_unlock(&data_ready_lock));
rdr_free = DATA_Take_Freelist(&reader_freelist); rdr_free = DATA_Take_Freelist(&reader_freelist);
LOG_Log(LOG_DEBUG, "Reader: took %u from free list", rdr_free); LOG_Log(LOG_DEBUG, "Reader: took %u from free list", rdr_free);
} }
...@@ -440,10 +423,11 @@ event(void *priv, enum VSL_tag_e tag, unsigned fd, ...@@ -440,10 +423,11 @@ event(void *priv, enum VSL_tag_e tag, unsigned fd,
AZ(lp->incomplete); AZ(lp->incomplete);
AZ(lp->bitmap); AZ(lp->bitmap);
AZ(lp->spec); AZ(lp->spec);
AZ(lp->t);
assert(lp->rx_headers == NULL || lp->rx_headers->nrec == 0); assert(lp->rx_headers == NULL || lp->rx_headers->nrec == 0);
assert(lp->tx_headers == NULL || lp->tx_headers->nrec == 0); assert(lp->tx_headers == NULL || lp->tx_headers->nrec == 0);
assert(lp->vcl_log == NULL || lp->vcl_log->nrec == 0); assert(lp->vcl_log == NULL || lp->vcl_log->nrec == 0);
/* XXX: assert that all lp->tag[i].len == 0 ? */ assert(lp->vcl_call == NULL || lp->vcl_call->nrec == 0);
t = TIM_real(); t = TIM_real();
fd_tbl[fd].ll = lp; fd_tbl[fd].ll = lp;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment