fixed incorrect bucket buffer copy
[httpd-crcsyncproxy.git] / support / check_forensic
blob3c8123fcbb734cdabe712614d8fc474f8b32a00d
1 #!/bin/sh
3 # check_forensic <forensic log file>
5 # check the forensic log for requests that did not complete
6 # output the request log for each one
8 F=$1
10 temp_create_method=file
11 if test -f `which mktemp`; then
12 temp_create_method=mktemp
13 elif test -f `which tempfile`; then
14 temp_create_method=tempfile
17 create_temp()
19 prefix=$1
20 case "$temp_create_method" in
21 file)
22 name="/tmp/$1.$$"
24 mktemp)
25 name=`mktemp -t $1.XXXXXX`
27 tempfile)
28 name=`tempfile --prefix=$1`
31 echo "$0: Cannot create temporary file"
32 exit 1
34 esac
37 create_temp fcall
38 all=$name
39 create_temp fcin
40 in=$name
41 create_temp fcout
42 out=$name
43 trap "rm -f -- \"$all\" \"$in\" \"$out\";" 0 1 2 3 13 15
45 cut -f 1 -d '|' $F > $all
46 grep + < $all | cut -c2- | sort > $in
47 grep -- - < $all | cut -c2- | sort > $out
49 # use -i instead of -I for GNU xargs
50 join -v 1 $in $out | xargs -I xx egrep "^\\+xx" $F
51 exit 0