这篇教程C++ H2O_STRUCT_FROM_MEMBER函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中H2O_STRUCT_FROM_MEMBER函数的典型用法代码示例。如果您正苦于以下问题:C++ H2O_STRUCT_FROM_MEMBER函数的具体用法?C++ H2O_STRUCT_FROM_MEMBER怎么用?C++ H2O_STRUCT_FROM_MEMBER使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了H2O_STRUCT_FROM_MEMBER函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: pthread_mutex_lockstatic h2o_memcached_req_t *pop_inflight(struct st_h2o_memcached_conn_t *conn, uint32_t serial){ h2o_memcached_req_t *req; pthread_mutex_lock(&conn->mutex); if (conn->yrmcds.text_mode) { /* in text mode, responses are returned in order (and we may receive responses for commands other than GET) */ if (!h2o_linklist_is_empty(&conn->inflight)) { req = H2O_STRUCT_FROM_MEMBER(h2o_memcached_req_t, inflight, conn->inflight.next); assert(req->type == REQ_TYPE_GET); if (req->data.get.serial == serial) goto Found; } } else { /* in binary mode, responses are received out-of-order (and we would only recieve responses for GET) */ h2o_linklist_t *node; for (node = conn->inflight.next; node != &conn->inflight; node = node->next) { req = H2O_STRUCT_FROM_MEMBER(h2o_memcached_req_t, inflight, node); assert(req->type == REQ_TYPE_GET); if (req->data.get.serial == serial) goto Found; } } /* not found */ pthread_mutex_unlock(&conn->mutex); return NULL;Found: h2o_linklist_unlink(&req->inflight); pthread_mutex_unlock(&conn->mutex); return req;}
开发者ID:ConfusedReality,项目名称:h2o,代码行数:34,
示例2: H2O_STRUCT_FROM_MEMBERstatic h2o_http2_scheduler_queue_node_t *queue_pop(h2o_http2_scheduler_queue_t *queue){ if (!h2o_linklist_is_empty(&queue->anchor257)) { h2o_http2_scheduler_queue_node_t *node = H2O_STRUCT_FROM_MEMBER(h2o_http2_scheduler_queue_node_t, _link, queue->anchor257.next); h2o_linklist_unlink(&node->_link); return node; } while (queue->bits != 0) { int zeroes = __builtin_clzll(queue->bits); queue->bits <<= zeroes; queue->offset = (queue->offset + zeroes) % (sizeof(queue->anchors) / sizeof(queue->anchors[0])); if (!h2o_linklist_is_empty(queue->anchors + queue->offset)) { h2o_http2_scheduler_queue_node_t *node = H2O_STRUCT_FROM_MEMBER(h2o_http2_scheduler_queue_node_t, _link, queue->anchors[queue->offset].next); h2o_linklist_unlink(&node->_link); if (h2o_linklist_is_empty(queue->anchors + queue->offset)) queue->bits &= (1ULL << (sizeof(queue->bits) * 8 - 1)) - 1; return node; } queue->bits &= (1ULL << (sizeof(queue->bits) * 8 - 1)) - 1; } return NULL;}
开发者ID:pmeenan,项目名称:h2o,代码行数:25,
示例3: kh_geth2o_filecache_ref_t *h2o_filecache_open_file(h2o_filecache_t *cache, const char *path, int oflag){ khiter_t iter = kh_get(opencache_set, cache->hash, path); h2o_filecache_ref_t *ref; int dummy; /* lookup cache, and return the one if found */ if (iter != kh_end(cache->hash)) { ref = H2O_STRUCT_FROM_MEMBER(h2o_filecache_ref_t, _path, kh_key(cache->hash, iter)); ++ref->_refcnt; goto Exit; } /* create a new cache entry */ ref = h2o_mem_alloc(offsetof(h2o_filecache_ref_t, _path) + strlen(path) + 1); ref->_refcnt = 1; ref->_lru = (h2o_linklist_t){NULL}; strcpy(ref->_path, path); /* if cache is used, then... */ if (cache->capacity != 0) { /* purge one entry from LRU if cache is full */ if (kh_size(cache->hash) == cache->capacity) { h2o_filecache_ref_t *purge_ref = H2O_STRUCT_FROM_MEMBER(h2o_filecache_ref_t, _lru, cache->lru.prev); khiter_t purge_iter = kh_get(opencache_set, cache->hash, purge_ref->_path); assert(purge_iter != kh_end(cache->hash)); release_from_cache(cache, purge_iter); } /* assign the new entry */ ++ref->_refcnt; kh_put(opencache_set, cache->hash, ref->_path, &dummy); h2o_linklist_insert(cache->lru.next, &ref->_lru); } /* open the file, or memoize the error */ if ((ref->fd = open(path, oflag)) != -1 && fstat(ref->fd, &ref->st) == 0) { ref->_last_modified.str[0] = '/0'; ref->_etag.len = 0; } else { ref->open_err = errno; if (ref->fd != -1) { close(ref->fd); ref->fd = -1; } }Exit: /* if the cache entry retains an error, return it instead of the reference */ if (ref->fd == -1) { errno = ref->open_err; h2o_filecache_close_file(ref); ref = NULL; } return ref;}
开发者ID:IvwsIgeMq,项目名称:h2o,代码行数:55,
示例4: graceful_shutdown_resend_goawaystatic void graceful_shutdown_resend_goaway(h2o_timeout_entry_t *entry){ h2o_context_t *ctx = H2O_STRUCT_FROM_MEMBER(h2o_context_t, http2._graceful_shutdown_timeout, entry); h2o_linklist_t *node; for (node = ctx->http2._conns.next; node != &ctx->http2._conns; node = node->next) { h2o_http2_conn_t *conn = H2O_STRUCT_FROM_MEMBER(h2o_http2_conn_t, _conns, node); if (conn->state < H2O_HTTP2_CONN_STATE_HALF_CLOSED) enqueue_goaway(conn, H2O_HTTP2_ERROR_NONE, (h2o_iovec_t){}); }}
开发者ID:cautonwong,项目名称:h2o,代码行数:11,
示例5: compare_fortunesstatic int compare_fortunes(const list_t *x, const list_t *y){ const fortune_t * const f1 = H2O_STRUCT_FROM_MEMBER(fortune_t, l, x); const fortune_t * const f2 = H2O_STRUCT_FROM_MEMBER(fortune_t, l, y); const size_t sz = MIN(f1->message.len, f2->message.len); int ret = memcmp(f1->message.base, f2->message.base, sz); if (!ret) ret = f1->message.len < f2->message.len ? -1 : f1->message.len > f2->message.len; return ret;}
开发者ID:yogthos,项目名称:FrameworkBenchmarks,代码行数:12,
示例6: complete_fortunesstatic void complete_fortunes(struct st_h2o_generator_t *self, h2o_req_t *req){ fortune_ctx_t * const fortune_ctx = H2O_STRUCT_FROM_MEMBER(fortune_ctx_t, generator, self); iovec_list_t * const iovec_list = H2O_STRUCT_FROM_MEMBER(iovec_list_t, l, fortune_ctx->iovec_list); fortune_ctx->iovec_list = iovec_list->l.next; const h2o_send_state_t state = fortune_ctx->iovec_list ? H2O_SEND_STATE_IN_PROGRESS : H2O_SEND_STATE_FINAL; h2o_send(req, iovec_list->iov, iovec_list->iovcnt, state);}
开发者ID:yogthos,项目名称:FrameworkBenchmarks,代码行数:15,
示例7: on_idle_timeoutstatic void on_idle_timeout(h2o_timeout_entry_t *entry){ h2o_http2_conn_t *conn = H2O_STRUCT_FROM_MEMBER(h2o_http2_conn_t, _timeout_entry, entry); enqueue_goaway(conn, H2O_HTTP2_ERROR_NONE, h2o_iovec_init(H2O_STRLIT("idle timeout"))); close_connection(conn);}
开发者ID:cautonwong,项目名称:h2o,代码行数:7,
示例8: proceedstatic int proceed(h2o_http2_scheduler_node_t *node, h2o_http2_scheduler_run_cb cb, void *cb_arg){Redo: if (node->_queue == NULL) return 0; h2o_http2_scheduler_queue_node_t *drr_node = queue_pop(node->_queue); if (drr_node == NULL) return 0; h2o_http2_scheduler_openref_t *ref = H2O_STRUCT_FROM_MEMBER(h2o_http2_scheduler_openref_t, _queue_node, drr_node); if (!ref->_self_is_active) { /* run the children (manually-unrolled tail recursion) */ queue_set(node->_queue, &ref->_queue_node, ref->weight); node = &ref->node; goto Redo; } assert(ref->_active_cnt != 0); /* call the callbacks */ int still_is_active, bail_out = cb(ref, &still_is_active, cb_arg); if (still_is_active) { queue_set(node->_queue, &ref->_queue_node, ref->weight); } else { ref->_self_is_active = 0; if (--ref->_active_cnt != 0) { queue_set(node->_queue, &ref->_queue_node, ref->weight); } else if (ref->node._parent != NULL) { decr_active_cnt(ref->node._parent); } } return bail_out;}
开发者ID:pmeenan,项目名称:h2o,代码行数:35,
示例9: accept_connectionstatic void accept_connection(h2o_socket_t *listener, const char *err){ if (err) ERROR(err); else { thread_context_t * const ctx = H2O_STRUCT_FROM_MEMBER(thread_context_t, event_loop, listener->data); if (!ctx->global_data->shutdown) { size_t accepted = ctx->config->max_accept; do { h2o_socket_t * const sock = h2o_evloop_socket_accept(listener); if (!sock) break; ctx->event_loop.conn_num++; sock->on_close.cb = on_close_connection; sock->on_close.data = &ctx->event_loop.conn_num; h2o_accept(&ctx->event_loop.h2o_accept_ctx, sock); } while (--accepted > 0); } }}
开发者ID:TechEmpower,项目名称:FrameworkBenchmarks,代码行数:26,
示例10: shutdown_serverstatic void shutdown_server(h2o_socket_t *listener, const char *err){ if (err) ERROR(err); else { thread_context_t * const ctx = H2O_STRUCT_FROM_MEMBER(thread_context_t, event_loop, listener->data); ctx->global_data->shutdown = true; // Close the listening sockets immediately, so that if another instance // of the application is started before the current one exits (e.g. when // doing an update), it will accept all incoming connections. if (ctx->event_loop.h2o_https_socket) { h2o_socket_read_stop(ctx->event_loop.h2o_https_socket); h2o_socket_close(ctx->event_loop.h2o_https_socket); ctx->event_loop.h2o_https_socket = NULL; } if (ctx->event_loop.h2o_socket) { h2o_socket_read_stop(ctx->event_loop.h2o_socket); h2o_socket_close(ctx->event_loop.h2o_socket); ctx->event_loop.h2o_socket = NULL; } for (size_t i = ctx->config->thread_num - 1; i > 0; i--) h2o_multithread_send_message(&ctx->global_thread_data[i].h2o_receiver, NULL); }}
开发者ID:TechEmpower,项目名称:FrameworkBenchmarks,代码行数:30,
示例11: on_fortune_sectionstatic uintmax_t on_fortune_section(mustache_api_t *api, void *userdata, mustache_token_section_t *token){ fortune_ctx_t * const fortune_ctx = userdata; uintmax_t ret = 1; if (fortune_ctx->num_result) { assert(fortune_ctx->result); const list_t *iter = fortune_ctx->result; do { fortune_ctx->fortune_iter = H2O_STRUCT_FROM_MEMBER(fortune_t, l, iter); iter = iter->next; if (!mustache_render(api, fortune_ctx, token->section)) { ret = 0; break; } } while (iter); } return ret;}
开发者ID:yogthos,项目名称:FrameworkBenchmarks,代码行数:25,
示例12: finalostream_sendvoid finalostream_send(h2o_ostream_t *self, h2o_req_t *req, h2o_iovec_t *bufs, size_t bufcnt, int is_final){ h2o_http2_stream_t *stream = H2O_STRUCT_FROM_MEMBER(h2o_http2_stream_t, _ostr_final, self); h2o_http2_conn_t *conn = (h2o_http2_conn_t*)req->conn; assert(stream->_data.size == 0); /* send headers */ switch (stream->state) { case H2O_HTTP2_STREAM_STATE_SEND_HEADERS: send_headers(conn, stream); /* fallthru */ case H2O_HTTP2_STREAM_STATE_SEND_BODY: if (is_final) stream->state = H2O_HTTP2_STREAM_STATE_END_STREAM; break; case H2O_HTTP2_STREAM_STATE_END_STREAM: /* might get set by h2o_http2_stream_reset */ return; default: assert(!"cannot be in a receiving state"); } /* save the contents in queue */ if (bufcnt != 0) { h2o_vector_reserve(&req->pool, (h2o_vector_t*)&stream->_data, sizeof(h2o_iovec_t), bufcnt); memcpy(stream->_data.entries, bufs, sizeof(h2o_iovec_t) * bufcnt); stream->_data.size = bufcnt; } h2o_http2_conn_register_for_proceed_callback(conn, stream);}
开发者ID:bowlofstew,项目名称:h2o,代码行数:32,
示例13: initiate_graceful_shutdownstatic void initiate_graceful_shutdown(h2o_context_t *ctx){ /* draft-16 6.8 * A server that is attempting to gracefully shut down a connection SHOULD send an initial GOAWAY frame with the last stream * identifier set to 231-1 and a NO_ERROR code. This signals to the client that a shutdown is imminent and that no further * requests can be initiated. After waiting at least one round trip time, the server can send another GOAWAY frame with an * updated last stream identifier. This ensures that a connection can be cleanly shut down without losing requests. */ h2o_linklist_t *node; /* only doit once */ if (ctx->http2._graceful_shutdown_timeout.cb != NULL) return; ctx->http2._graceful_shutdown_timeout.cb = graceful_shutdown_resend_goaway; for (node = ctx->http2._conns.next; node != &ctx->http2._conns; node = node->next) { h2o_http2_conn_t *conn = H2O_STRUCT_FROM_MEMBER(h2o_http2_conn_t, _conns, node); if (conn->state < H2O_HTTP2_CONN_STATE_HALF_CLOSED) { h2o_http2_encode_goaway_frame(&conn->_write.buf, INT32_MAX, H2O_HTTP2_ERROR_NONE, (h2o_iovec_t){H2O_STRLIT("graceful shutdown")}); h2o_http2_conn_request_write(conn); } } h2o_timeout_link(ctx->loop, &ctx->one_sec_timeout, &ctx->http2._graceful_shutdown_timeout);}
开发者ID:cautonwong,项目名称:h2o,代码行数:25,
示例14: finalostream_start_pullstatic void finalostream_start_pull(h2o_ostream_t *_self, h2o_ostream_pull_cb cb){ h2o_http1_conn_t *conn = H2O_STRUCT_FROM_MEMBER(h2o_http1_conn_t, _ostr_final.super, _self); const char *connection = conn->req.http1_is_persistent ? "keep-alive" : "close"; size_t bufsz, headers_len; assert(conn->req._ostr_top == &conn->_ostr_final.super); assert(! conn->_ostr_final.sent_headers); /* register the pull callback */ conn->_ostr_final.pull.cb = cb; /* setup the buffer */ bufsz = flatten_headers_estimate_size(&conn->req, conn->super.ctx->globalconf->server_name.len + strlen(connection)); if (bufsz < MAX_PULL_BUF_SZ) { if (MAX_PULL_BUF_SZ - bufsz < conn->req.res.content_length) { bufsz = MAX_PULL_BUF_SZ; } else { bufsz += conn->req.res.content_length; } } conn->_ostr_final.pull.buf = h2o_mem_alloc_pool(&conn->req.pool, bufsz); /* fill-in the header */ headers_len = flatten_headers(conn->_ostr_final.pull.buf, &conn->req, connection); conn->_ostr_final.sent_headers = 1; proceed_pull(conn, headers_len);}
开发者ID:laysakura,项目名称:h2o,代码行数:29,
示例15: purgestatic void purge(h2o_cache_t *cache, uint64_t now){ /* by cache size */ while (cache->capacity < cache->size) { h2o_cache_ref_t *last; assert(!h2o_linklist_is_empty(&cache->lru)); last = H2O_STRUCT_FROM_MEMBER(h2o_cache_ref_t, _lru_link, cache->lru.next); erase_ref(cache, kh_get(cache, cache->table, last), 0); } /* by TTL */ while (!h2o_linklist_is_empty(&cache->age)) { h2o_cache_ref_t *oldest = H2O_STRUCT_FROM_MEMBER(h2o_cache_ref_t, _age_link, cache->age.next); if (get_timeleft(cache, oldest, now) >= 0) break; erase_ref(cache, kh_get(cache, cache->table, oldest), 0); }}
开发者ID:ConfusedReality,项目名称:h2o,代码行数:17,
示例16: reqread_on_timeoutstatic void reqread_on_timeout(h2o_timeout_entry_t *entry){ h2o_http1_conn_t *conn = H2O_STRUCT_FROM_MEMBER(h2o_http1_conn_t, _timeout_entry, entry); /* TODO log */ conn->req.http1_is_persistent = 0; close_connection(conn);}
开发者ID:laysakura,项目名称:h2o,代码行数:8,
示例17: h2o_timeout_get_wake_atuint64_t h2o_timeout_get_wake_at(h2o_linklist_t *timeouts){ h2o_linklist_t *node; uint64_t wake_at = UINT64_MAX; /* change wake_at to the minimum value of the timeouts */ for (node = timeouts->next; node != timeouts; node = node->next) { h2o_timeout_t *timeout = H2O_STRUCT_FROM_MEMBER(h2o_timeout_t, _link, node); if (!h2o_linklist_is_empty(&timeout->_entries)) { h2o_timeout_entry_t *entry = H2O_STRUCT_FROM_MEMBER(h2o_timeout_entry_t, _link, timeout->_entries.next); uint64_t entry_wake_at = entry->registered_at + timeout->timeout; if (entry_wake_at < wake_at) wake_at = entry_wake_at; } } return wake_at;}
开发者ID:topcpporg,项目名称:h2,代码行数:18,
示例18: process_messagesstatic void process_messages(h2o_multithread_receiver_t *receiver, h2o_linklist_t *messages){ IGNORE_FUNCTION_PARAMETER(messages); thread_context_t * const ctx = H2O_STRUCT_FROM_MEMBER(thread_context_t, event_loop.h2o_receiver, receiver); h2o_socket_read_stop(ctx->event_loop.h2o_socket);}
开发者ID:dreis2211,项目名称:FrameworkBenchmarks,代码行数:10,
示例19: h2o_configurator__dispose_configuratorsvoid h2o_configurator__dispose_configurators(h2o_globalconf_t *conf){ while (!h2o_linklist_is_empty(&conf->configurators)) { h2o_configurator_t *c = H2O_STRUCT_FROM_MEMBER(h2o_configurator_t, _link, conf->configurators.next); h2o_linklist_unlink(&c->_link); if (c->dispose != NULL) c->dispose(c); destroy_configurator(c); }}
开发者ID:alfoeternia,项目名称:h2o,代码行数:10,
示例20: complete_configuratorsstatic int complete_configurators(h2o_linklist_t *configurators, void *config){ h2o_linklist_t *node; for (node = configurators->next; node != configurators; node = node->next) { h2o_configurator_t *configurator = H2O_STRUCT_FROM_MEMBER(h2o_configurator_t, _link, node); if (configurator->on_complete != NULL) if (configurator->on_complete(configurator, config) != 0) return -1; } return 0;}
开发者ID:Gwill,项目名称:h2o,代码行数:11,
示例21: accept_http_connectionstatic void accept_http_connection(h2o_socket_t *listener, const char *err){ // Assume that err is most often NULL. thread_context_t * const ctx = H2O_STRUCT_FROM_MEMBER(thread_context_t, event_loop, listener->data); SSL_CTX * const ssl_ctx = ctx->event_loop.h2o_accept_ctx.ssl_ctx; ctx->event_loop.h2o_accept_ctx.ssl_ctx = NULL; accept_connection(listener, err); ctx->event_loop.h2o_accept_ctx.ssl_ctx = ssl_ctx;}
开发者ID:TechEmpower,项目名称:FrameworkBenchmarks,代码行数:12,
示例22: H2O_STRUCT_FROM_MEMBERh2o_configurator_t *h2o_config_get_configurator(h2o_linklist_t *anchor, const char *cmd){ h2o_linklist_t *node; for (node = anchor->next; node != anchor; node = node->next) { h2o_configurator_t *configurator = H2O_STRUCT_FROM_MEMBER(h2o_configurator_t, _link, node); if (strcmp(configurator->cmd, cmd) == 0) return configurator; } return NULL;}
开发者ID:Gwill,项目名称:h2o,代码行数:12,
示例23: release_from_cachestatic inline void release_from_cache(h2o_filecache_t *cache, khiter_t iter){ const char *path = kh_key(cache->hash, iter); h2o_filecache_ref_t *ref = H2O_STRUCT_FROM_MEMBER(h2o_filecache_ref_t, _path, path); /* detach from list */ kh_del(opencache_set, cache->hash, iter); h2o_linklist_unlink(&ref->_lru); /* and close */ h2o_filecache_close_file(ref);}
开发者ID:IvwsIgeMq,项目名称:h2o,代码行数:12,
示例24: h2o_http2_scheduler_closevoid h2o_http2_scheduler_close(h2o_http2_scheduler_openref_t *ref){ assert(h2o_http2_scheduler_is_open(ref)); /* move dependents to parent */ if (!h2o_linklist_is_empty(&ref->node._all_refs)) { /* proportionally distribute the weight to the children (draft-16 5.3.4) */ uint32_t total_weight = 0, factor; h2o_linklist_t *link; for (link = ref->node._all_refs.next; link != &ref->node._all_refs; link = link->next) { h2o_http2_scheduler_openref_t *child_ref = H2O_STRUCT_FROM_MEMBER(h2o_http2_scheduler_openref_t, _all_link, link); total_weight += child_ref->weight; } assert(total_weight != 0); factor = ((uint32_t)ref->weight * 65536 + total_weight / 2) / total_weight; do { h2o_http2_scheduler_openref_t *child_ref = H2O_STRUCT_FROM_MEMBER(h2o_http2_scheduler_openref_t, _all_link, ref->node._all_refs.next); uint16_t weight = (child_ref->weight * factor / 32768 + 1) / 2; if (weight < 1) weight = 1; else if (weight > 256) weight = 256; h2o_http2_scheduler_rebind(child_ref, ref->node._parent, weight, 0); } while (!h2o_linklist_is_empty(&ref->node._all_refs)); } free(ref->node._queue); ref->node._queue = NULL; /* detach self */ h2o_linklist_unlink(&ref->_all_link); if (ref->_self_is_active) { assert(ref->_active_cnt == 1); queue_unset(&ref->_queue_node); decr_active_cnt(ref->node._parent); } else { assert(ref->_active_cnt == 0); }}
开发者ID:pmeenan,项目名称:h2o,代码行数:40,
示例25: run_pending_requestsstatic void run_pending_requests(h2o_http2_conn_t *conn){ while (!h2o_linklist_is_empty(&conn->_pending_reqs) && can_run_requests(conn)) { /* fetch and detach a pending stream */ h2o_http2_stream_t *stream = H2O_STRUCT_FROM_MEMBER(h2o_http2_stream_t, _refs.link, conn->_pending_reqs.next); h2o_linklist_unlink(&stream->_refs.link); /* handle it */ h2o_http2_stream_set_state(conn, stream, H2O_HTTP2_STREAM_STATE_SEND_HEADERS); if (!h2o_http2_stream_is_push(stream->stream_id) && conn->pull_stream_ids.max_processed < stream->stream_id) conn->pull_stream_ids.max_processed = stream->stream_id; h2o_process_request(&stream->req); }}
开发者ID:tidatida,项目名称:h2o,代码行数:13,
示例26: h2o_config_disposevoid h2o_config_dispose(h2o_global_configuration_t *config){ while (! h2o_linklist_is_empty(&config->virtual_hosts)) { h2o_host_configuration_t *host_config = H2O_STRUCT_FROM_MEMBER(h2o_host_configuration_t, _link, config->virtual_hosts.next); h2o_linklist_unlink(&host_config->_link); dispose_host_config(host_config); free(host_config); } dispose_host_config(&config->default_host); DESTROY_LIST(h2o_configurator_t, config->global_configurators); DESTROY_LIST(h2o_configurator_t, config->host_configurators);}
开发者ID:Gwill,项目名称:h2o,代码行数:13,
示例27: h2o_config_on_context_createint h2o_config_on_context_create(h2o_global_configuration_t *config, h2o_context_t *ctx){ h2o_linklist_t *node; for (node = config->global_configurators.next; node != &config->global_configurators; node = node->next) { h2o_configurator_t *configurator = H2O_STRUCT_FROM_MEMBER(h2o_configurator_t, _link, node); if (configurator->on_context_create != NULL) if (configurator->on_context_create(configurator, ctx) != 0) return -1; } return 0;}
开发者ID:Gwill,项目名称:h2o,代码行数:13,
示例28: convert_to_exclusivestatic void convert_to_exclusive(h2o_http2_scheduler_node_t *parent, h2o_http2_scheduler_openref_t *added){ while (!h2o_linklist_is_empty(&parent->_all_refs)) { h2o_http2_scheduler_openref_t *child_ref = H2O_STRUCT_FROM_MEMBER(h2o_http2_scheduler_openref_t, _all_link, parent->_all_refs.next); if (child_ref == added) { /* precond: the added node should exist as the last item within parent */ assert(parent->_all_refs.prev == &added->_all_link); break; } h2o_http2_scheduler_rebind(child_ref, &added->node, h2o_http2_scheduler_get_weight(child_ref), 0); }}
开发者ID:pmeenan,项目名称:h2o,代码行数:13,
示例29: h2o_cache_clearvoid h2o_cache_clear(h2o_cache_t *cache){ lock_cache(cache); while (!h2o_linklist_is_empty(&cache->lru)) { h2o_cache_ref_t *ref = H2O_STRUCT_FROM_MEMBER(h2o_cache_ref_t, _lru_link, cache->lru.next); erase_ref(cache, kh_get(cache, cache->table, ref), 0); } assert(h2o_linklist_is_linked(&cache->age)); assert(kh_size(cache->table) == 0); assert(cache->size == 0); unlock_cache(cache);}
开发者ID:ConfusedReality,项目名称:h2o,代码行数:14,
注:本文中的H2O_STRUCT_FROM_MEMBER函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ H2W_DBG函数代码示例 C++ H2O_STRLIT函数代码示例 |