Bontiv-Sourceer source code viewer
Root | Help
./web-crawler/src/cgi/kill.c
#include <stdlib.h>
#include "../tplcp/strct.h"
#include <signal.h>
#include <stdio.h>

char* display_killed(tpl_data tpl, int *length);

void main()
{
  tpl_data tpl = new_tpl();
  size_t length = 0;
  char* page;

  page = getenv("QUERY_STRING");
  if (page)
    {
      kill(atoi(page), SIGTERM);
      page = display_killed(tpl, &length);
      puts("Content-Type: text/html; charset=UTF-8");
      printf("Content-Length: %u\n\n", length);
      puts(page);
    }
  else
    {
      puts("HTTP/1.1 404 Not Found");
      puts("Location: process");
      puts("");
    }
}
Presented with Bontiv-Sourceer