327 |
|
|
328 |
if (directory_index) { /* look for index.html first?? */ |
if (directory_index) { /* look for index.html first?? */ |
329 |
if (data_fd != -1) { /* user's index file */ |
if (data_fd != -1) { /* user's index file */ |
330 |
strcpy(req->request_uri, directory_index); /* for mimetype */ |
int ret; |
331 |
|
|
332 |
|
/* Check if we can execute the file |
333 |
|
*/ |
334 |
|
|
335 |
|
strcat(req->request_uri, directory_index); |
336 |
|
|
337 |
|
ret = is_executable_cgi( req, directory_index); |
338 |
|
if ( ret != 0) { /* it is a CGI */ |
339 |
|
close( data_fd); /* we don't need it */ |
340 |
|
if (ret == -1) { |
341 |
|
send_r_error(req); |
342 |
|
return -1; |
343 |
|
} |
344 |
|
return init_cgi(req); |
345 |
|
} |
346 |
|
|
347 |
|
/* Not a cgi */ |
348 |
|
|
349 |
fstat(data_fd, statbuf); |
fstat(data_fd, statbuf); |
350 |
return data_fd; |
return data_fd; |
351 |
} |
} |