stream::~stream(void) { if (hook_) hook_->destroy(); if (stream_) acl_vstream_free(stream_); }
void acl_master_status_cleanup(ACL_MASTER_SERV *serv) { const char *myname = "acl_master_status_cleanup"; /* * Sanity checks. */ if (serv->status_fd[0] < 0 || serv->status_fd[1] < 0) acl_msg_panic("%s: status events not enabled", myname); if (acl_msg_verbose) acl_msg_info("%s: %s", myname, serv->name); /* * Dispose of this service's status pipe after disabling read events. */ acl_event_disable_readwrite(acl_var_master_global_event, serv->status_read_stream); if (close(serv->status_fd[0]) != 0) acl_msg_warn("%s: close status descriptor (read side): %s", myname, strerror(errno)); if (close(serv->status_fd[1]) != 0) acl_msg_warn("%s: close status descriptor (write side): %s", myname, strerror(errno)); serv->status_fd[0] = serv->status_fd[1] = -1; if (serv->status_read_stream) acl_vstream_free(serv->status_read_stream); serv->status_read_stream = NULL; }
acl_int64 gid_cmdline_get(int fd, const char *tag, int *errnum) { acl_int64 gid; ACL_VSTREAM *client = acl_vstream_fdopen(fd, 0, 1024, var_gid_rw_timeout, ACL_VSTREAM_TYPE_SOCK); gid = gid_cmdline_next(client, tag, errnum); acl_vstream_free(client); return (gid); }
void acl_master_vars_init(int buf_size, int rw_timeout) { const char *myname = "acl_master_vars_init"; if (ACL_MASTER_STAT_STREAM != NULL) acl_vstream_free(ACL_MASTER_STAT_STREAM); if (ACL_MASTER_FLOW_READ_STREAM != NULL) acl_vstream_free(ACL_MASTER_FLOW_READ_STREAM); if (ACL_MASTER_FLOW_WRITE_STREAM != NULL) acl_vstream_free(ACL_MASTER_FLOW_WRITE_STREAM); ACL_MASTER_STAT_STREAM = acl_vstream_fdopen(ACL_MASTER_STATUS_FD, O_RDWR, buf_size, rw_timeout, ACL_VSTREAM_TYPE_SOCK); ACL_MASTER_FLOW_READ_STREAM = acl_vstream_fdopen(ACL_MASTER_FLOW_READ, O_RDONLY, buf_size, rw_timeout, ACL_VSTREAM_TYPE_SOCK); ACL_MASTER_FLOW_WRITE_STREAM = acl_vstream_fdopen(ACL_MASTER_FLOW_WRITE, O_WRONLY, buf_size, rw_timeout, ACL_VSTREAM_TYPE_SOCK); if (acl_var_master_thread_pool == NULL) acl_var_master_thread_pool = acl_thread_pool_create(100, 60); if (acl_var_master_thread_pool == NULL) acl_msg_fatal("%s(%d): create thread pool error(%s)", myname, __LINE__, strerror(errno)); }
void stream::reopen_stream(bool is_file /* = false */) { if (stream_) acl_vstream_free(stream_); open_stream(is_file); }
void stream::reopen_stream(void) { if (stream_) acl_vstream_free(stream_); open_stream(); }
stream::~stream(void) { if (stream_) acl_vstream_free(stream_); }