Tech stuff

If you’ve ever clicked on the site stats link, you might have noticed that it takes a really long time to load -- as in 30 or 40 seconds -- or that it doesn’t load at all.  In that script, the code loops through a log file that keeps track of who’s browsing what.  But once it finds the current visitor in that logfile, there’s no reason to loop through the rest of it -- it should exit the loop and move on.  That’s accomplished with the keyword "last" in Perl, but apparently I used "break" instead, which is the C/C++ keyword for that function.  For some reason, that didn’t give any errors and the code ran OK, even though it didn’t do what it was supposed to.

Anyway back when I wrote that script, a year and a half ago, I wasn’t getting 200 visitors per day.  So it didn’t matter that the script was needlessly looping through the rest of the log, because the log was small.  Now, however, the log is big, and all that extra looping was causing the page to take forever to load.  But now I’ve fixed that bug -- it now says last instead of break -- and it loads normally.

In the security-news department, I discovered that someone was linking directly to a Thursday song on my server from their webpage.  In other words, I put up a server with a bunch of music, and create a webpage containing links to that music.  Then this kid, instead of linking to my music page, links directly to the songs on my server, bypassing my website completely.  That’s bandwidth theft and it’s dishonest and it’s inconsiderate.  So I learned how to use mod_rewrite and now that’s in place to prevent this kind of thing.  I knew I’d have to do that sooner or later.

Posted by Anthony on reply

Reply to this message here:

Your name
Email
Website (optional)
Subject

HomeCreate PostArchivesLoginCMS by Encodable ]