public void run()
	{
		try
		{
			in = new BufferedReader( new InputStreamReader(
				client.getInputStream() ) );
			out = client.getOutputStream();
			pout = new PrintStream(out);

			String request = in.readLine();
			if ( request == null )
				error(400, "Empty Request");

			if(request.toLowerCase().indexOf("http/1.") != -1)
			{
				String s;
				while((!(s = in.readLine()).equals("")) && (s != null))
				{ ; }

				isHttp1 = true;
			}

			StringTokenizer st = new StringTokenizer(request);
			if(st.countTokens() < 2) 
				error(400, "Bad Request");
			else
			{
				String command = st.nextToken();
				if(command.equals("GET"))
					serveFile(st.nextToken());
				else
					error(400, "Bad Request");
			}

			client.close();
		}
		catch(IOException e)
		{
			System.out.println("I/O error " + e); 
			try
			{
				client.close();
			}
			catch(Exception e2) { }
		}
	}