| /lighttpd1.4/src/ |
| H A D | fdevent.c | 53 close(fd); in fdevent_socket_nb_cloexec_init() 63 UNUSED(fd); in fdevent_setfd_cloexec() 71 UNUSED(fd); in fdevent_clrfd_cloexec() 79 UNUSED(fd); in fdevent_fcntl_set_nb() 98 int fd; in fdevent_socket_cloexec() local 108 return fd; in fdevent_socket_cloexec() 112 int fd; in fdevent_socket_nb_cloexec() local 267 if (fd < 0) return fd; in fdevent_mkostemp() 298 int fd; in fdevent_accept_listenfd() local 648 if (fd >= 0) close(fd); in fdevent_load_file() [all …]
|
| H A D | network_write.c | 85 static int network_write_error(int fd, log_error_st *errh) { in network_write_error() argument 125 return send(fd, data, len, 0); in network_write_data_len() 127 return write(fd, data, len); in network_write_data_len() 139 return network_write_error(fd, errh); in network_write_accounting() 181 ssize_t wr = network_write_data_len(fd, buf, toSend); in network_write_file_chunk_no_mmap() 274 ssize_t wr = writev(fd, chunks, num_chunks); in network_writev_mem_chunks() 314 wr = sendfile(fd, c->file.fd, &offset, toSend); in network_write_file_chunk_sendfile() 320 wr = sendfile(c->file.fd, fd, offset, &written, NULL, 0); in network_write_file_chunk_sendfile() 325 wr = sendfile(c->file.fd, fd, offset, toSend, NULL, &written, 0); in network_write_file_chunk_sendfile() 331 fvec.sfv_fd = c->file.fd; in network_write_file_chunk_sendfile() [all …]
|
| H A D | fdlog_maint.c | 129 close(fdp->fd); in fdlog_pipes_close() 130 fdp->fd = -1; in fdlog_pipes_close() 151 fdlog_pipe_serrh (const int fd) in fdlog_pipe_serrh() argument 155 if (fdlog->fd != fd) continue; in fdlog_pipe_serrh() 157 fdlog->fd = STDERR_FILENO; in fdlog_pipe_serrh() 170 fdp->fd = fds[0]; in fdlog_pipe_init() 234 return (-1 != fd) ? fdlog_file_init(fn, fd) : NULL; in fdlog_file_open() 272 if (-1 != fd) { in fdlog_files_cycle() 275 fdlog->fd = fd; in fdlog_files_cycle() 278 if (fdlog->fd != dup2(fd, fdlog->fd)) in fdlog_files_cycle() [all …]
|
| H A D | fdevent_impl.c | 279 int fd = fdn->fd; in fdevent_sched_run() local 325 int fd = fdn->fde_ndx = fdn->fd; in fdevent_linux_sysepoll_event_set() local 402 int fd = fdn->fd; in fdevent_freebsd_kqueue_event_del() local 425 int fd = fdn->fde_ndx = fdn->fd; in fdevent_freebsd_kqueue_event_set() local 535 int fd = fdn->fde_ndx = fdn->fd; in fdevent_solaris_port_event_set() local 633 pfd.fd = fdn->fd; in fdevent_solaris_devpoll_event_del() 643 pfd.fd = fdn->fde_ndx = fdn->fd; in fdevent_solaris_devpoll_event_set() 731 int fd = fdn->fd; in fdevent_poll_event_del() local 754 int fd = fdn->fd; in fdevent_poll_event_set() local 782 ev->pollfds[k].fd = fd; in fdevent_poll_event_set() [all …]
|
| H A D | fdevent.h | 15 int fd; member 79 void fdevent_setfd_cloexec(int fd); 80 void fdevent_clrfd_cloexec(int fd); 81 int fdevent_fcntl_set_nb(int fd); 82 int fdevent_fcntl_set_nb_cloexec(int fd); 83 int fdevent_fcntl_set_nb_cloexec_sock(int fd); 86 int fdevent_dup_cloexec(int fd); 109 int fdevent_connect_status(int fd); 112 int fdevent_is_tcp_half_closed(int fd); 113 int fdevent_set_tcp_nodelay (const int fd, const int opt); [all …]
|
| H A D | network.c | 71 int fd = fdevent_accept_listenfd(srv_socket->fd, in network_server_handle_fdevent() local 73 if (-1 == fd) break; in network_server_handle_fdevent() 441 srv_socket->fd = -1; in network_server_init() 638 if (srv_socket->fd < fd) continue; in network_socket_activation_to_env() 639 if (srv_socket->fd == fd) { in network_socket_activation_to_env() 641 ++fd; in network_socket_activation_to_env() 646 if (fd == srv->srv_sockets.ptr[i]->fd) in network_socket_activation_to_env() 651 ++fd; in network_socket_activation_to_env() 657 if (fd != dup2(srv_socket->fd, fd)) continue; in network_socket_activation_to_env() 658 ++fd; in network_socket_activation_to_env() [all …]
|
| H A D | chunk.c | 121 c->file.fd = -1; in chunk_init() 205 close(c->file.fd); in chunk_reset_file_chunk() 211 c->file.fd = -1; in chunk_reset_file_chunk() 499 (chunkqueue_append_file_chunk(cq, fn, offset, len))->file.fd = fd; in chunkqueue_append_file_fd() 502 close(fd); in chunkqueue_append_file_fd() 683 d->file.fd = c->file.fd; in chunkqueue_dup_file_chunk_fd() 689 d->file.fd = fdevent_dup_cloexec(c->file.fd); in chunkqueue_dup_file_chunk_fd() 766 c->file.fd = in chunkqueue_get_append_newtempfile() 772 c->file.fd = in chunkqueue_get_append_newtempfile() 1069 ssize_t wr = splice(fd, NULL, c->file.fd, &off, len, in chunkqueue_append_splice_pipe_tempfile() [all …]
|
| H A D | fdlog.c | 10 fdlog_init (const char * const fn, const int fd, const int mode) in fdlog_init() argument 14 fdlog->fd = fd >= 0 ? fd : STDERR_FILENO; in fdlog_init() 23 if (fdlog->fd > STDERR_FILENO) in fdlog_free() 24 close(fdlog->fd); in fdlog_free()
|
| H A D | stat_cache.c | 173 (-1 != (*(fd)) ? close(*(fd)) : 0) 240 int fd; member 567 scf->fd = -1; in stat_cache_handle_fdevent() 575 scf->fd = -1; in stat_cache_init_fam() 584 scf->fd = -1; in stat_cache_init_fam() 599 if (scf->fd >= 0) fdevent_setfd_cloexec(scf->fd); in stat_cache_init_fam() 645 scf->fd = -1; in stat_cache_free_fam() 826 if (sce->fd >= 0) close(sce->fd); in stat_cache_entry_free() 1464 if (fd >= 0) { in stat_cache_open_rdonly_fstat() 1466 return fd; in stat_cache_open_rdonly_fstat() [all …]
|
| H A D | fdevent_fdnode.c | 26 fdevent_register (fdevents *ev, int fd, fdevent_handler handler, void *ctx) in fdevent_register() argument 28 fdnode *fdn = ev->fdarray[fd] = fdnode_init(); in fdevent_register() 30 fdn->fd = fd; in fdevent_register() 40 fdnode **fdn_slot = &ev->fdarray[fdn->fd]; in fdevent_unregister() 49 fdnode **fdn_slot = &ev->fdarray[fdn->fd]; in fdevent_sched_close() 77 "fdevent event_del failed on fd %d", fdn->fd); in fdevent_fdnode_event_unsetter_retry() 114 "fdevent event_set failed on fd %d", fdn->fd); in fdevent_fdnode_event_setter_retry()
|
| H A D | http_chunk.c | 79 rd = chunk_file_pread(fd, b->ptr+offset, (size_t)len, foff+offset); in http_chunk_append_read_fd_range() 103 const int fd = sce->fd; in http_chunk_append_file_ref_range() local 104 chunkqueue_append_file_fd(cq, fn, fd, offset, len); in http_chunk_append_file_ref_range() 105 if (fd >= 0) { in http_chunk_append_file_ref_range() 123 chunkqueue_append_file_fd(cq, fn, fd, offset, len); in http_chunk_append_file_fd_range() 129 int http_chunk_append_file_fd(request_st * const r, const buffer * const fn, const int fd, const of… in http_chunk_append_file_fd() argument 131 http_chunk_append_file_fd_range(r, fn, fd, 0, sz); in http_chunk_append_file_fd() 136 int rc = (0 != sz) ? http_chunk_append_read_fd_range(r,fn,fd,0,sz) : 0; in http_chunk_append_file_fd() 137 close(fd); in http_chunk_append_file_fd() 150 const int fd = sce->fd; in http_chunk_append_file_ref() local [all …]
|
| H A D | chunk.h | 36 int fd; member 57 ssize_t chunk_file_pread (int fd, void *buf, size_t count, off_t offset); 87 void chunkqueue_append_file_fd(chunkqueue * restrict cq, const buffer * restrict fn, int fd, off_t … 116 ssize_t chunkqueue_append_splice_pipe_tempfile(chunkqueue * restrict cq, int fd, unsigned int len, … 117 ssize_t chunkqueue_append_splice_sock_tempfile(chunkqueue * restrict cq, int fd, unsigned int len, … 159 ssize_t chunkqueue_write_chunk (int fd, chunkqueue * restrict cq, log_error_st * restrict errh); 160 ssize_t chunkqueue_write_chunk_to_pipe (int fd, chunkqueue * restrict cq, log_error_st * restrict e…
|
| H A D | connections.c | 78 if (con->fd < 0) con->fd = -con->fd; in connection_close() 96 if (0 == closesocket(con->fd)) in connection_close() 98 if (0 == close(con->fd)) in connection_close() 103 "(warning) close: %d", con->fd); in connection_close() 107 "connection closed for fd %d", con->fd); in connection_close() 109 con->fd = -1; in connection_close() 163 if (con->fd >= 0 in connection_handle_shutdown() 171 "shutdown for fd %d", con->fd); in connection_handle_shutdown() 483 con->fd, rc); in connection_handle_write_state() 916 con->fd = cnt; in connection_accepted() [all …]
|
| H A D | mod_cgi.c | 72 int fd; member 104 hctx->fd = -1; in cgi_handler_ctx_init() 425 if (hctx->fd != -1) { in cgi_connection_close() 719 if (close(fd)) { in cgi_write_request() 736 hctx->fdtocgi = fd; in cgi_write_request() 784 if (-1 == c->file.fd in cgi_create_env() 795 to_cgi_fds[0] = c->file.fd; in cgi_create_env() 940 hctx->fd = from_cgi_fds[0]; in cgi_create_env() 960 close(hctx->fd); in cgi_create_env() 961 hctx->fd = -1; in cgi_create_env() [all …]
|
| H A D | fdlog.h | 10 int fd; member 17 fdlog_st * fdlog_init (const char *fn, int fd, int mode); 49 void fdlog_pipe_serrh (int fd);
|
| H A D | server.c | 477 int fd = con->fd; in server_oneshot_read_cq() local 478 con->fd = oneshot_fdn->fd; in server_oneshot_read_cq() 480 con->fd = fd; in server_oneshot_read_cq() 646 network_accept_tcp_nagle_disable(fd); in server_oneshot_init() 889 if (-1 == srv_socket->fd) continue; in server_sockets_close() 891 close(srv_socket->fd); in server_sockets_close() 892 srv_socket->fd = -1; in server_sockets_close() 1808 int fd = fdevent_open_devnull(); in server_main_setup() local 1809 if (fd >= 0) { in server_main_setup() 1810 srv->cur_fds = fd; in server_main_setup() [all …]
|
| H A D | rand.c | 178 int fd = fdevent_open_cloexec(devices[u], 1, O_RDONLY, 0); in li_rand_device_bytes() local 179 if (fd >= 0) { in li_rand_device_bytes() 183 if (0 == ioctl(fd, (unsigned long)(RNDGETENTCNT), &entropy) in li_rand_device_bytes() 186 rd = read(fd, buf, (size_t)num); in li_rand_device_bytes() 187 close(fd); in li_rand_device_bytes()
|
| H A D | mod_deflate.c | 1433 if (-1 == fd) { in mod_deflate_using_libdeflate_err() 1435 else if (fd == hctx->cache_fd) { in mod_deflate_using_libdeflate_err() 1436 if (0 != ftruncate(fd, 0)) in mod_deflate_using_libdeflate_err() 1438 if (0 != lseek(fd, 0, SEEK_SET)) in mod_deflate_using_libdeflate_err() 1444 close(fd); in mod_deflate_using_libdeflate_err() 1516 int fd = hctx->cache_fd; in mod_deflate_using_libdeflate() local 1517 if (-1 == fd) { in mod_deflate_using_libdeflate() 1526 fd = fdevent_mkostemp(fn->ptr, 0); in mod_deflate_using_libdeflate() 1527 if (-1 == fd) return 0; in mod_deflate_using_libdeflate() 1534 if (0 != ftruncate(fd, (off_t)sz)) { in mod_deflate_using_libdeflate() [all …]
|
| H A D | base.h | 24 int fd; /* the FD for this connection */ member 126 int fd; member 148 int (* network_backend_write)(int fd, chunkqueue *cq, off_t max_bytes, log_error_st *errh);
|
| H A D | mod_webdav.c | 4565 int fd; in mod_webdav_put_0() local 4569 if (fd >= 0) { in mod_webdav_put_0() 4575 close(fd); in mod_webdav_put_0() 4593 if (fd >= 0) { in mod_webdav_put_0() 4594 close(fd); in mod_webdav_put_0() 4637 int fd; in mod_webdav_put_prep() local 4646 if (fd < 0) in mod_webdav_put_prep() 4654 if (fd < 0) { in mod_webdav_put_prep() 4781 int fd = ifd; in mod_webdav_put_range() local 4835 wr = copy_file_range(c->file.fd,&zoff,fd,&ooff, in mod_webdav_put_range() [all …]
|
| H A D | http_chunk.h | 16 int http_chunk_append_file_fd(request_st *r, const buffer *fn, int fd, off_t sz); 18 void http_chunk_append_file_fd_range(request_st *r, const buffer *fn, int fd, off_t offset, off_t l…
|
| /lighttpd1.4/src/t/ |
| H A D | test_mod_ssi.c | 27 if (0 != lseek(fd, 0, SEEK_SET) in test_mod_ssi_write_testfile() 29 || 0 != ftruncate(fd, (off_t)len) in test_mod_ssi_write_testfile() 30 || 0 != lseek(fd, 0, SEEK_SET)) { in test_mod_ssi_write_testfile() 45 int fd = fdevent_mkostemp(fn, 0); in test_mod_ssi_read_fd() local 46 if (fd < 0) { in test_mod_ssi_read_fd() 50 if (0 != fstat(fd, &st)) { in test_mod_ssi_read_fd() 63 mod_ssi_read_fd(r, hctx, &st, fd); in test_mod_ssi_read_fd() 73 mod_ssi_read_fd(r, hctx, &st, fd); in test_mod_ssi_read_fd() 79 mod_ssi_read_fd(r, hctx, &st, fd); in test_mod_ssi_read_fd() 125 mod_ssi_read_fd(r, hctx, &st, fd); in test_mod_ssi_read_fd() [all …]
|
| H A D | test_mod_indexfile.c | 48 int fd = mkstemp(fn); in test_mod_indexfile_tryfiles() local 49 if (fd < 0) { in test_mod_indexfile_tryfiles() 54 if (0 != fstat(fd, &st)) { in test_mod_indexfile_tryfiles() 98 r.conf.errh->fd = -1; /* (disable) */ in test_mod_indexfile()
|
| /lighttpd1.4/tests/ |
| H A D | scgi-responder.c | 56 scgi_process (const int fd) in scgi_process() argument 64 fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK); in scgi_process() 67 struct pollfd pfd = { fd, POLLIN, 0 }; in scgi_process() 102 struct pollfd pfd = { fd, POLLIN, 0 }; in scgi_process() 148 fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) & ~O_NONBLOCK); in scgi_process() 210 int fd; in main() local 215 fd = accept(STDIN_FILENO, NULL, NULL); in main() 216 if (fd < 0) in main() 218 assert(fd == STDOUT_FILENO); in main() 219 scgi_process(fd); in main() [all …]
|
| H A D | fcgi-responder.c | 312 fcgi_recv (const int fd, FILE * const stream) in fcgi_recv() argument 320 struct pollfd pfd = { fd, POLLIN, 0 }; in fcgi_recv() 333 rd = recv(fd, buf+offset, sizeof(buf)-offset, MSG_DONTWAIT); in fcgi_recv() 358 int fd; in main() local 368 fd = accept(FCGI_LISTENSOCK_FILENO, NULL, NULL); in main() 369 if (fd < 0) in main() 375 FILE *stream = fdopen(fd, "r+"); in main() 377 close(fd); in main() 380 fcgi_recv(fd, stream); in main() 383 } while (fd > 0 ? !finished : errno == EINTR); in main()
|