public final static void read_http_headers(DataInputStream in, List <String> headers) throws IOException {
	String oldheader=null,req;
	while(true)
	{  
		req=in.readLine();
		if(req==null) {
			if(trace_inkeepalive)
			{
				System.out.println("[TRACE "+Thread.currentThread().getName()+"] = EOF when reading request's headers.");
				throw new EOFException("EOF when reading request's headers");
			}
		}
		if(req.length()==0) {
			if(oldheader!=null)
				headers.add(oldheader);
			break;
		} else
		{
			char c=req.charAt(0);
			if (c==' ' || c=='\t') {
				if (oldheader!=null)
					oldheader += req;
			}
			else {
				if(oldheader!=null)
					headers.add(oldheader);
				oldheader = req;
			}
		}
	}
}