| 577 | | chunkqueue_append_file(con->write_queue, p->stat_fn, 0, st.st_size); |
| 578 | | break; |
| | 580 | /* do recursive SSI expansion */ |
| | 581 | |
| | 582 | /* prevents infinite loop */ |
| | 583 | if (con->loops_per_request > 25 || buffer_is_equal(con->physical.path, p->stat_fn)) { |
| | 584 | buffer_copy_string(srv->tmp_buf, "<!-- your include directives create an infinite loop; aborting -->"); |
| | 585 | chunkqueue_append_buffer(con->write_queue, srv->tmp_buf); |
| | 586 | break; |
| | 587 | } |
| | 588 | |
| | 589 | tmp = buffer_init(); |
| | 590 | buffer_copy_string_buffer(tmp, con->physical.path); /* save path of current document */ |
| | 591 | buffer_copy_string_buffer(con->physical.path, p->stat_fn); /* next sub-document to parse */ |
| | 592 | if (mod_ssi_physical_path(srv,con,p) != HANDLER_FINISHED) { |
| | 593 | /* the document was not processed, so write it as is */ |
| | 594 | chunkqueue_append_file(con->write_queue, con->physical.path, 0, st.st_size); |
| | 595 | } |
| | 596 | buffer_copy_string_buffer(con->physical.path, tmp); /* restore saved path */ |
| | 597 | buffer_free(tmp); |
| | 598 | break; |