Lines Matching refs:httpd

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