/*
 * http_bobo.c: Handles things associated with BOBO
 *
 * tom@mit.edu
 */

#include "httpd.h"

static char *do_bobo();

void process_bobo(FILE *out) 
{
  log_transaction();
  fputs(out, do_bobo());
}


static char *bobos[] = {"Bobo", "bobo", "BoBo", "bObO", "bOBo", "BobO"};

static char *
do_bobo()
{
  static char buf[BUFSIZ];
  int ld;
  int i;
  
  ld = getla();
  srandom(getpid() * time(0) * ld);
  bzero(buf, sizeof(buf));
  for(i = 1; i < ld; i++)
    {
      strcat(buf, bobos[random() % 6]);
      strcat(buf, ".. ");
    }
  strcat(buf, "BOBO!");
  if((random() % 20) == 6)
    strcat(buf, " bored, huh?");
  return(buf);
}

