+ void ServeData()
+ {
+ /* Headers are complete */
+ InternalState = HTTP_SERVE_SEND_DATA;
+
+ Instance->Timers->DelTimer(Timeout);
+ Timeout = NULL;
+
+ if ((http_version != "HTTP/1.1") && (http_version != "HTTP/1.0"))
+ {
+ SendHeaders(0, 505, "");
+ }
+ else
+ {
+ if ((request_type == "GET") && (uri == "/"))
+ {
+ SendHeaders(index->ContentSize(), 200, "");
+ this->Write(index->Contents());
+ }
+ else
+ {
+ claimed = false;
+ HTTPRequest httpr(request_type,uri,&headers,this,this->GetIP(),postdata);
+ Event e((char*)&httpr, (Module*)HttpModule, "httpd_url");
+ e.Send(this->Instance);
+ if (!claimed)
+ {
+ SendHeaders(0, 404, "");
+ }
+ }
+ }
+ Timeout = new HttpServerTimeout(this, Instance->SE);
+ Instance->Timers->AddTimer(Timeout);
+ }
+