Codebase list squidview / upstream/0.68
Imported Upstream version 0.68 Willi Mann 11 years ago
5 changed file(s) with 36 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
00 >> Squidview history:
1
2 v0.68: 18 April 2004:
3 - incorporated bug fixs by Willi Mann in CreateLinks():
4 - sizeof() doesn't return count of items in array
5 - zero length log files now count; they are just empty
16
27 v0.67: 5 March 2004
38 - endwin() goes back in
693693
694694 PACKAGE=squidview
695695
696 VERSION=0.67
696 VERSION=0.68
697697
698698 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
699699 { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
00 AC_INIT(squidview.cpp)
11 AM_CONFIG_HEADER(config.h)
2 AM_INIT_AUTOMAKE(squidview,0.67)
2 AM_INIT_AUTOMAKE(squidview,0.68)
33 AC_PROG_CXX
44 AC_PROG_INSTALL
55
721721 char szTemp [80];
722722
723723 strncpy (szTemp, ctime (&iTime), sizeof (szTemp) - 1);
724 szTemp [sizeof (szTemp) - 1] = '\0'; // Ensure the time string is null-terminated.
725
724 // Ensure the time string is null-terminated.
725 szTemp [sizeof (szTemp) - 1] = '\0';
726726 iCount = strlen (szTemp);
727727 if (iCount > 0)
728728 if (szTemp [iCount - 1] == '\n')
23502350 if (sDispLine != "")
23512351 {
23522352 GetColumn (sDispLine.c_str(), 1, sTemp);
2353 for (iVectorCount = 0; iVectorCount < iNumRecords; iVectorCount++)
2353 for (iVectorCount = 0; iVectorCount < iNumRecords;
2354 iVectorCount++)
23542355 {
23552356 if (sTemp == vUserDetails [iVectorCount].sLoginName)
23562357 {
24282429 {
24292430 bMadeOutput = true;
24302431 sTemp = RightJustify (
2431 ItoCommas (
2432 rDomainPointers.vList [iVectorCount].iBytes), nSizeCols);
2432 ItoCommas (
2433 rDomainPointers.vList [iVectorCount].iBytes), nSizeCols);
24332434 if (iRepWordHits == CSV)
24342435 sTemp += sRepSeperator;
24352436 else
28022803 GetColumn (sLine.c_str(), 2, sTemp);
28032804 if (sTemp == "")
28042805 sTemp = "unkown";
2805 sLine = "Total bytes including small requests: " + sTemp + "\n";
2806 sLine = "Total bytes including small requests: " + sTemp
2807 + "\n";
28062808 bWrite = true;
28072809 iLen = 0;
28082810 }
31563158 }
31573159
31583160 MyCls();
3159 con << "Filter a report leaving one user.\n\nEnter new report name: ";
3161 con << "Filter a report leaving one user.\n\n"
3162 << "Enter new report name: ";
31603163 GetFileName (sDest, &bGood);
31613164 if (!bGood)
31623165 break;
44434446 CalcPercentage (iSouthMarkEnd, iOneUserFileSize, sTemp);
44444447 NoLeadingSpaces (sTemp);
44454448 sLine += " to " + sTemp;
4446 CalcPercentage (iSelectedAddress, iTotalRows == 0 ? 0 : iTotalRows - 1, sTemp);
4449 CalcPercentage (iSelectedAddress,
4450 iTotalRows == 0 ? 0 : iTotalRows - 1, sTemp);
44474451 NoLeadingSpaces (sTemp);
44484452 sLine += ") " + sTemp;
44494453
54165420
54175421 printf ("Making .squidview directory and links....\n");
54185422
5423 // bug fix contributed by Willi Mann: check for file existance, not size
54195424 sLogLocation = "";
5420 for (iTemp = 0; iTemp < int (sizeof (sLogLocations)); iTemp++)
5421 if (GetFileSize (sLogLocations [iTemp]) > 0)
5425 for (iTemp = 0; sLogLocations [iTemp] != ""; iTemp++)
5426 if (stat (sLogLocations [iTemp].c_str(), &sStatTable) == 0)
54225427 {
54235428 sLogLocation = sLogLocations [iTemp];
54245429 break;
54465451 {
54475452 printf ("The squid log file doesn't exist or is of zero size.\n");
54485453 printf ("You may need to manually adjust the symlinks in ~/.squidview\n");
5449 exit (1);
5454 printf ("It was assumed that your access.log is at %s\n",
5455 sLogLocation.c_str());
5456
5457 // Don't exit if logfile is empty but does exist.
5458 if (stat (sLogLocation.c_str(), &sStatTable) != 0)
5459 {
5460 #ifdef DEBIANIZED
5461 printf ("You may want to add your username to the group proxy.\n");
5462 #endif
5463 exit (1);
5464 }
54505465 }
54515466 }
54525467
6363 const char szSquidHome[] = ".squidview";
6464 string sPathToFiles;
6565 const string sLogLocations[] = {"/var/log/squid/access.log",
66 "/usr/local/squid/var/logs/access.log"};
67 // disribution builders: put your log location first in the list
66 "/usr/local/squid/var/logs/access.log", ""};
67 // disribution builders: put your log location first in the list
68 // last entry must be ""
6869
6970 const char szLog1[] = "log1";
7071 const char szLog2[] = "log2";