Android 中的微型云
2010-04-09 05:40:00 来源:WEB开发网核心提示:<h3>"); apname(); strcat(mainbuf, "</h3>"); strcat(mainbuf, "<a href=\"/About_\">About</a>&
<h3>");
apname();
strcat(mainbuf, "</h3> ");
strcat(mainbuf, "<a href=\"/About_\">About</a><br> ");
strcat(mainbuf, "<a href=\"/Home_\">Home</a><br> ");
strcat(mainbuf, "<hr> ");
strcat(mainbuf, "Dir: ");
strcat(mainbuf, theDir);
strcat(mainbuf, "<br> <hr> <pre> ");
strcat(mainbuf, data);
strcat(mainbuf, " </pre> ");
strcat(mainbuf, "</body> </html> ");
}
void htmlout(int fd, char* data)
{
fstr=mimes[0].mimetype;
sprintf(mainbuf, "HTTP/1.0 200 OK Content-Type: %s ", fstr);
ret=write(fd, mainbuf, strlen(mainbuf));
buildbuf(data);
ret=write(fd, mainbuf, strlen(mainbuf));
}
void error404(int fd)
{
fstr=mimes[0].mimetype;
sprintf(mainbuf, "HTTP/1.0 404 OK Content-Type: %s ", fstr);
ret=write(fd, mainbuf, strlen(mainbuf));
buildbuf("404 Error - File not found!");
ret=write(fd, mainbuf, strlen(mainbuf));
}
apname();
strcat(mainbuf, "</h3> ");
strcat(mainbuf, "<a href=\"/About_\">About</a><br> ");
strcat(mainbuf, "<a href=\"/Home_\">Home</a><br> ");
strcat(mainbuf, "<hr> ");
strcat(mainbuf, "Dir: ");
strcat(mainbuf, theDir);
strcat(mainbuf, "<br> <hr> <pre> ");
strcat(mainbuf, data);
strcat(mainbuf, " </pre> ");
strcat(mainbuf, "</body> </html> ");
}
void htmlout(int fd, char* data)
{
fstr=mimes[0].mimetype;
sprintf(mainbuf, "HTTP/1.0 200 OK Content-Type: %s ", fstr);
ret=write(fd, mainbuf, strlen(mainbuf));
buildbuf(data);
ret=write(fd, mainbuf, strlen(mainbuf));
}
void error404(int fd)
{
fstr=mimes[0].mimetype;
sprintf(mainbuf, "HTTP/1.0 404 OK Content-Type: %s ", fstr);
ret=write(fd, mainbuf, strlen(mainbuf));
buildbuf("404 Error - File not found!");
ret=write(fd, mainbuf, strlen(mainbuf));
}
更多精彩
赞助商链接