Lines Matching refs:httpd
56 bozohttpd_t *httpd = request->hr_httpd;
65 if (!isindex || !httpd->dir_indexing)
68 if (strlen(dirpath) <= strlen(httpd->index_html))
71 file = bozostrdup(httpd, request, dirpath);
73 file[strlen(file) - strlen(httpd->index_html)] = '\0';
76 debug((httpd, DEBUG_FAT, "bozo_dir_index: dirpath '%s'", dirpath));
80 bozo_http_error(httpd, 403, request,
83 bozo_http_error(httpd, 404, request, "no file");
85 bozo_http_error(httpd, 500, request, "open directory");
90 bozo_printf(httpd, "%s 200 OK\r\n", request->hr_proto);
92 if (request->hr_proto != httpd->consts.http_09) {
94 bozo_printf(httpd, "\r\n");
96 bozo_flush(httpd, stdout);
105 bozoasprintf(httpd, &printname, "~%s/%s",
108 printname = bozostrdup(httpd, request, request->hr_file);
110 printname = bozostrdup(httpd, request, request->hr_file);
112 if ((p = strstr(printname, httpd->index_html)) != NULL) {
113 if (strcmp(printname, httpd->index_html) == 0)
118 if ((p = bozo_escape_html(httpd, printname)) != NULL) {
123 bozo_printf(httpd,
135 bozo_printf(httpd, "<title>Index of %s</title></head>\r\n",
137 bozo_printf(httpd, "<body><h1>Index of %s</h1>\r\n",
139 bozo_printf(httpd,
152 httpd->hide_dots && name[0] == '.'))
162 urlname = bozo_escape_rfc3986(httpd, name, 0);
163 htmlname = bozo_escape_html(httpd, name);
166 bozo_printf(httpd, "<tr><td>");
168 bozo_printf(httpd, "<a href=\"../\">");
169 bozo_printf(httpd, "Parent Directory");
171 bozo_printf(httpd, "<a href=\"%s/\">", urlname);
172 bozo_printf(httpd, "%s/", htmlname);
175 bozo_printf(httpd, "<a href=\"./%s\">", urlname);
176 bozo_printf(httpd, "%s", htmlname);
178 bozo_printf(httpd, "<a href=\"%s\">", urlname);
179 bozo_printf(httpd, "%s", htmlname);
183 bozo_printf(httpd, "</a>");
186 bozo_printf(httpd, "<td>?<td>?\r\n");
191 bozo_printf(httpd, "<td>%s", buf);
194 bozo_printf(httpd, "<td align=right>%llukB", len);
196 bozo_printf(httpd, "\r\n");
203 bozo_printf(httpd, "</table>\r\n");
204 if (httpd->dir_readme != NULL) {
205 if (httpd->dir_readme[0] == '/')
206 snprintf(buf, sizeof buf, "%s", httpd->dir_readme);
208 snprintf(buf, sizeof buf, "%s/%s", dirpath, httpd->dir_readme);
211 bozo_flush(httpd, stdout);
216 bozo_write(httpd, STDOUT_FILENO, buf, rlen);
221 bozo_printf(httpd, "</body></html>\r\n\r\n");
222 bozo_flush(httpd, stdout);