/* Dump the file upload details. Don't actually do anything with the uploaded file. */ static void uploadTest(Webs *wp, char *path, char *query) { WebsKey *s; WebsUpload *up; char *upfile; websSetStatus(wp, 200); websWriteHeaders(wp, -1, 0); websWriteHeader(wp, "Content-Type", "text/plain"); websWriteEndHeaders(wp); if (scaselessmatch(wp->method, "POST")) { for (s = hashFirst(wp->files); s; s = hashNext(wp->files, s)) { up = s->content.value.symbol; websWrite(wp, "FILE: %s\r\n", s->name.value.string); websWrite(wp, "FILENAME=%s\r\n", up->filename); websWrite(wp, "CLIENT=%s\r\n", up->clientFilename); websWrite(wp, "TYPE=%s\r\n", up->contentType); websWrite(wp, "SIZE=%d\r\n", up->size); upfile = sfmt("%s/tmp/%s", websGetDocuments(), up->clientFilename); rename(up->filename, upfile); wfree(upfile); } websWrite(wp, "\r\nVARS:\r\n"); for (s = hashFirst(wp->vars); s; s = hashNext(wp->vars, s)) { websWrite(wp, "%s=%s\r\n", s->name.value.string, s->content.value.string); } } websDone(wp); }
static void logHeader() { char home[ME_GOAHEAD_LIMIT_STRING]; getcwd(home, sizeof(home)); logmsg(2, "Configuration for %s", ME_TITLE); logmsg(2, "---------------------------------------------"); logmsg(2, "Version: %s", ME_VERSION); logmsg(2, "BuildType: %s", ME_DEBUG ? "Debug" : "Release"); logmsg(2, "CPU: %s", ME_CPU); logmsg(2, "OS: %s", ME_OS); logmsg(2, "Host: %s", websGetServer()); logmsg(2, "Directory: %s", home); logmsg(2, "Documents: %s", websGetDocuments()); logmsg(2, "Configure: %s", ME_CONFIG_CMD); logmsg(2, "---------------------------------------------"); }
static void logHeader() { char home[BIT_LIMIT_STRING]; getcwd(home, sizeof(home)); trace(2, "Configuration for %s\n", BIT_TITLE); trace(2, "---------------------------------------------\n"); trace(2, "Version: %s-%s\n", BIT_VERSION, BIT_BUILD_NUMBER); trace(2, "BuildType: %s\n", BIT_DEBUG ? "Debug" : "Release"); trace(2, "CPU: %s\n", BIT_CPU); trace(2, "OS: %s\n", BIT_OS); trace(2, "Host: %s\n", websGetServer()); trace(2, "Directory: %s\n", home); trace(2, "Documents: %s\n", websGetDocuments()); trace(2, "Configure: %s\n", BIT_CONFIG_CMD); trace(2, "---------------------------------------------\n"); }