您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ AP_DEBUG_ASSERT函数代码示例

51自学网 2021-06-01 19:35:48
  C++
这篇教程C++ AP_DEBUG_ASSERT函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中AP_DEBUG_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ AP_DEBUG_ASSERT函数的具体用法?C++ AP_DEBUG_ASSERT怎么用?C++ AP_DEBUG_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了AP_DEBUG_ASSERT函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: h2_session_handle_response

/* Start submitting the response to a stream request. This is possible * once we have all the response headers. The response body will be * read by the session using the callback we supply. */apr_status_t h2_session_handle_response(h2_session *session, h2_stream *stream){    apr_status_t status = APR_SUCCESS;    int rv = 0;    AP_DEBUG_ASSERT(session);    AP_DEBUG_ASSERT(stream);    AP_DEBUG_ASSERT(stream->response);        if (stream->response->ngheader) {        rv = submit_response(session, stream->response);    }    else {        rv = nghttp2_submit_rst_stream(session->ngh2, NGHTTP2_FLAG_NONE,                                       stream->id, NGHTTP2_PROTOCOL_ERROR);    }        if (nghttp2_is_fatal(rv)) {        status = APR_EGENERAL;        h2_session_abort_int(session, rv);        ap_log_cerror(APLOG_MARK, APLOG_ERR, status, session->c,                      APLOGNO(02940) "submit_response: %s",                       nghttp2_strerror(rv));    }    return status;}
开发者ID:MichealYangGitHub,项目名称:C,代码行数:29,


示例2: ap_queue_push

/** * Push a new socket onto the queue. * * precondition: ap_queue_info_wait_for_idler has already been called *               to reserve an idle worker thread */apr_status_t ap_queue_push(fd_queue_t *queue, apr_socket_t *sd, apr_pool_t *p){    fd_queue_elem_t *elem;    apr_status_t rv;    if ((rv = apr_thread_mutex_lock(queue->one_big_mutex)) != APR_SUCCESS) {        return rv;    }    AP_DEBUG_ASSERT(!queue->terminated);    AP_DEBUG_ASSERT(!ap_queue_full(queue));    elem = &queue->data[queue->in];    queue->in++;    if (queue->in >= queue->bounds)        queue->in -= queue->bounds;    elem->sd = sd;    elem->p = p;    queue->nelts++;    apr_thread_cond_signal(queue->not_empty);    if ((rv = apr_thread_mutex_unlock(queue->one_big_mutex)) != APR_SUCCESS) {        return rv;    }    return APR_SUCCESS;}
开发者ID:Aimbot2,项目名称:apache2,代码行数:34,


示例3: h2_request_rwrite

apr_status_t h2_request_rwrite(h2_request *req, request_rec *r){    apr_status_t status;        req->config    = h2_config_rget(r);    req->method    = r->method;    req->scheme    = (r->parsed_uri.scheme? r->parsed_uri.scheme                      : ap_http_scheme(r));    req->authority = r->hostname;    req->path      = apr_uri_unparse(r->pool, &r->parsed_uri,                                      APR_URI_UNP_OMITSITEPART);    if (!ap_strchr_c(req->authority, ':') && r->server && r->server->port) {        apr_port_t defport = apr_uri_port_of_scheme(req->scheme);        if (defport != r->server->port) {            /* port info missing and port is not default for scheme: append */            req->authority = apr_psprintf(r->pool, "%s:%d", req->authority,                                          (int)r->server->port);        }    }        AP_DEBUG_ASSERT(req->scheme);    AP_DEBUG_ASSERT(req->authority);    AP_DEBUG_ASSERT(req->path);    AP_DEBUG_ASSERT(req->method);    status = add_all_h1_header(req, r->pool, r->headers_in);    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, status, r,                  "h2_request(%d): rwrite %s host=%s://%s%s",                  req->id, req->method, req->scheme, req->authority, req->path);                      return status;}
开发者ID:Sp1l,项目名称:mod_h2,代码行数:34,


示例4: procmgr_init_spawn_cmd

void procmgr_init_spawn_cmd(fcgid_command * command, request_rec * r,                            fcgid_cmd_conf *cmd_conf){    fcgid_server_conf *sconf =        ap_get_module_config(r->server->module_config, &fcgid_module);    /* no truncation should ever occur */    AP_DEBUG_ASSERT(sizeof command->cgipath > strlen(cmd_conf->cgipath));    apr_cpystrn(command->cgipath, cmd_conf->cgipath, sizeof command->cgipath);    AP_DEBUG_ASSERT(sizeof command->cmdline > strlen(cmd_conf->cmdline));    apr_cpystrn(command->cmdline, cmd_conf->cmdline, sizeof command->cmdline);    command->inode = (apr_ino_t) -1;    command->deviceid = (dev_t) -1;    command->uid = (uid_t) - 1;    command->gid = (gid_t) - 1;    command->userdir = 0;    command->vhost_id = sconf->vhost_id;    if (r->server->server_hostname) {        apr_cpystrn(command->server_hostname, r->server->server_hostname,                    sizeof command->server_hostname);    }    else {        command->server_hostname[0] = '/0';    }    get_cmd_options(r, command->cgipath, &command->cmdopts, &command->cmdenv);}
开发者ID:famzah,项目名称:mod_fcgid,代码行数:28,


示例5: h2_io_set_response

void h2_io_set_response(h2_io *io, h2_response *response) {    AP_DEBUG_ASSERT(response);    AP_DEBUG_ASSERT(!io->response);    io->response = h2_response_copy(io->pool, response);    if (response->rst_error) {        h2_io_rst(io, response->rst_error);    }}
开发者ID:NeedfulThings,项目名称:mod_h2,代码行数:9,


示例6: AP_DEBUG_ASSERT

h2_stream *h2_mplx_next_submit(h2_mplx *m, h2_stream_set *streams){    apr_status_t status;    h2_stream *stream = NULL;    AP_DEBUG_ASSERT(m);    if (m->aborted) {        return NULL;    }    status = apr_thread_mutex_lock(m->lock);    if (APR_SUCCESS == status) {        h2_io *io = h2_io_set_pop_highest_prio(m->ready_ios);        if (io) {            stream = h2_stream_set_get(streams, io->id);            if (stream) {                if (io->rst_error) {                    h2_stream_rst(stream, io->rst_error);                }                else {                    AP_DEBUG_ASSERT(io->response);                    H2_MPLX_IO_OUT(APLOG_TRACE2, m, io, "h2_mplx_next_submit_pre");                    h2_stream_set_response(stream, io->response, io->bbout);                    H2_MPLX_IO_OUT(APLOG_TRACE2, m, io, "h2_mplx_next_submit_post");                }                            }            else {                /* We have the io ready, but the stream has gone away, maybe                 * reset by the client. Should no longer happen since such                 * streams should clear io's from the ready queue.                 */                ap_log_cerror(APLOG_MARK, APLOG_INFO, 0, m->c, APLOGNO(02953)                               "h2_mplx(%ld): stream for response %d closed, "                              "resetting io to close request processing",                              m->id, io->id);                io->orphaned = 1;                if (io->task_done) {                    io_destroy(m, io, 1);                }                else {                    /* hang around until the h2_task is done, but                     * shutdown input and send out any events (e.g. window                     * updates) asap. */                    h2_io_in_shutdown(io);                    h2_io_rst(io, H2_ERR_STREAM_CLOSED);                    io_process_events(m, io);                }            }                        if (io->output_drained) {                apr_thread_cond_signal(io->output_drained);            }        }        apr_thread_mutex_unlock(m->lock);    }    return stream;}
开发者ID:AzerTyQsdF,项目名称:osx,代码行数:56,


示例7: h2_stream_write_data

apr_status_t h2_stream_write_data(h2_stream *stream,                                  const char *data, size_t len){    AP_DEBUG_ASSERT(stream);    AP_DEBUG_ASSERT(stream);    switch (stream->state) {        case H2_STREAM_ST_OPEN:            break;        default:            return APR_EINVAL;    }    return h2_request_write_data(stream->request, data, len);}
开发者ID:r4-keisuke,项目名称:mod_h2,代码行数:13,


示例8: AP_DEBUG_ASSERT

h2_stream *h2_mplx_next_submit(h2_mplx *m, h2_stream_set *streams){    apr_status_t status;    h2_stream *stream = NULL;    int acquired;    AP_DEBUG_ASSERT(m);    if ((status = enter_mutex(m, &acquired)) == APR_SUCCESS) {        h2_io *io = h2_io_set_pop_highest_prio(m->ready_ios);        if (io && !m->aborted) {            stream = h2_stream_set_get(streams, io->id);            if (stream) {                if (io->rst_error) {                    h2_stream_rst(stream, io->rst_error);                }                else {                    AP_DEBUG_ASSERT(io->response);                    H2_MPLX_IO_OUT(APLOG_TRACE2, m, io, "h2_mplx_next_submit_pre");                    h2_stream_set_response(stream, io->response, io->bbout);                    H2_MPLX_IO_OUT(APLOG_TRACE2, m, io, "h2_mplx_next_submit_post");                }            }            else {                /* We have the io ready, but the stream has gone away, maybe                 * reset by the client. Should no longer happen since such                 * streams should clear io's from the ready queue.                 */                ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c,                                "h2_mplx(%ld): stream for response %d closed, "                              "resetting io to close request processing",                              m->id, io->id);                h2_io_make_orphaned(io, H2_ERR_STREAM_CLOSED);                if (!io->worker_started || io->worker_done) {                    io_destroy(m, io, 1);                }                else {                    /* hang around until the h2_task is done, but                     * shutdown input and send out any events (e.g. window                     * updates) asap. */                    h2_io_in_shutdown(io);                    io_process_events(m, io);                }            }                        h2_io_signal(io, H2_IO_WRITE);        }        leave_mutex(m, acquired);    }    return stream;}
开发者ID:Sp1l,项目名称:mod_h2,代码行数:50,


示例9: h2_stream_schedule

apr_status_t h2_stream_schedule(h2_stream *stream, int eos,                                h2_stream_pri_cmp *cmp, void *ctx){    apr_status_t status;    AP_DEBUG_ASSERT(stream);    AP_DEBUG_ASSERT(stream->session);    AP_DEBUG_ASSERT(stream->session->mplx);        if (!output_open(stream)) {        return APR_ECONNRESET;    }    if (stream->scheduled) {        return APR_EINVAL;    }    if (eos) {        close_input(stream);    }        /* Seeing the end-of-headers, we have everything we need to      * start processing it.     */    status = h2_request_end_headers(stream->request, stream->pool, eos);    if (status == APR_SUCCESS) {        if (!eos) {            stream->bbin = apr_brigade_create(stream->pool,                                               stream->session->c->bucket_alloc);        }        stream->input_remaining = stream->request->content_length;                status = h2_mplx_process(stream->session->mplx, stream->id,                                  stream->request, eos, cmp, ctx);        stream->scheduled = 1;                ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, stream->session->c,                      "h2_stream(%ld-%d): scheduled %s %s://%s%s",                      stream->session->id, stream->id,                      stream->request->method, stream->request->scheme,                      stream->request->authority, stream->request->path);    }    else {        h2_stream_rst(stream, H2_ERR_INTERNAL_ERROR);        ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, stream->session->c,                      "h2_stream(%ld-%d): RST=2 (internal err) %s %s://%s%s",                      stream->session->id, stream->id,                      stream->request->method, stream->request->scheme,                      stream->request->authority, stream->request->path);    }        return status;}
开发者ID:AzerTyQsdF,项目名称:osx,代码行数:50,


示例10: session_receive

/* h2_io_on_read_cb implementation that offers the data read * directly to the session for consumption. */static apr_status_t session_receive(const char *data, apr_size_t len,                                    apr_size_t *readlen, int *done,                                    void *puser){    h2_session *session = (h2_session *)puser;    AP_DEBUG_ASSERT(session);    if (len > 0) {        ssize_t n = nghttp2_session_mem_recv(session->ngh2,                                             (const uint8_t *)data, len);        if (n < 0) {            ap_log_cerror(APLOG_MARK, APLOG_DEBUG, APR_EGENERAL,                          session->c,                          "h2_session: nghttp2_session_mem_recv error %d",                          (int)n);            if (nghttp2_is_fatal((int)n)) {                *done = 1;                h2_session_abort_int(session, (int)n);                return APR_EGENERAL;            }        }        else {            *readlen = n;        }    }    return APR_SUCCESS;}
开发者ID:MichealYangGitHub,项目名称:C,代码行数:29,


示例11: h2_stream_write_eoh

apr_status_t h2_stream_write_eoh(h2_stream *stream, int eos){    apr_status_t status;    AP_DEBUG_ASSERT(stream);        /* Seeing the end-of-headers, we have everything we need to      * start processing it.     */    status = h2_mplx_create_task(stream->m, stream);    status = h2_mplx_create_task(stream->m, stream);    if (status == APR_SUCCESS) {        status = h2_request_end_headers(stream->request,                                         stream->m, stream->task, eos);        if (status == APR_SUCCESS) {            status = h2_mplx_do_task(stream->m, stream->task);        }        if (eos) {            status = h2_stream_write_eos(stream);        }        ap_log_cerror(APLOG_MARK, APLOG_DEBUG, status, stream->m->c,                      "h2_mplx(%ld-%d): start stream, task %s %s (%s)",                      stream->m->id, stream->id,                      stream->request->method, stream->request->path,                      stream->request->authority);            }    return status;}
开发者ID:r4-keisuke,项目名称:mod_h2,代码行数:28,


示例12: apr_pcalloc

static h2_ctx *h2_ctx_create(conn_rec *c){    h2_ctx *ctx = apr_pcalloc(c->pool, sizeof(h2_ctx));    AP_DEBUG_ASSERT(ctx);    ap_set_module_config(c->conn_config, &h2_module, ctx);    return ctx;}
开发者ID:ikyaqoob,项目名称:mod_h2,代码行数:7,


示例13: h2_mplx_out_trywait

apr_status_t h2_mplx_out_trywait(h2_mplx *m, apr_interval_time_t timeout,                                 apr_thread_cond_t *iowait){    apr_status_t status;    int acquired;        AP_DEBUG_ASSERT(m);    if ((status = enter_mutex(m, &acquired)) == APR_SUCCESS) {        if (m->aborted) {            status = APR_ECONNABORTED;        }        else {            m->added_output = iowait;            status = apr_thread_cond_timedwait(m->added_output, m->lock, timeout);            if (APLOGctrace2(m->c)) {                ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c,                              "h2_mplx(%ld): trywait on data for %f ms)",                              m->id, timeout/1000.0);            }            m->added_output = NULL;        }        leave_mutex(m, acquired);    }    return status;}
开发者ID:Sp1l,项目名称:mod_h2,代码行数:25,


示例14: h2_mplx_out_write

apr_status_t h2_mplx_out_write(h2_mplx *m, int stream_id,                                ap_filter_t* f, apr_bucket_brigade *bb,                               apr_table_t *trailers,                               struct apr_thread_cond_t *iowait){    apr_status_t status;    int acquired;        AP_DEBUG_ASSERT(m);    if ((status = enter_mutex(m, &acquired)) == APR_SUCCESS) {        h2_io *io = h2_io_set_get(m->stream_ios, stream_id);        if (io && !io->orphaned) {            status = out_write(m, io, f, bb, trailers, iowait);            ap_log_cerror(APLOG_MARK, APLOG_TRACE1, status, m->c,                          "h2_mplx(%ld-%d): write with trailers=%s",                           m->id, io->id, trailers? "yes" : "no");            H2_MPLX_IO_OUT(APLOG_TRACE2, m, io, "h2_mplx_out_write");                        have_out_data_for(m, stream_id);        }        else {            status = APR_ECONNABORTED;        }        leave_mutex(m, acquired);    }    return status;}
开发者ID:Sp1l,项目名称:mod_h2,代码行数:27,


示例15: h2_mplx_out_read_to

apr_status_t h2_mplx_out_read_to(h2_mplx *m, int stream_id,                                  apr_bucket_brigade *bb,                                  apr_off_t *plen, int *peos,                                 apr_table_t **ptrailers){    apr_status_t status;    int acquired;    AP_DEBUG_ASSERT(m);    if ((status = enter_mutex(m, &acquired)) == APR_SUCCESS) {        h2_io *io = h2_io_set_get(m->stream_ios, stream_id);        if (io && !io->orphaned) {            H2_MPLX_IO_OUT(APLOG_TRACE2, m, io, "h2_mplx_out_read_to_pre");                        status = h2_io_out_read_to(io, bb, plen, peos);                        H2_MPLX_IO_OUT(APLOG_TRACE2, m, io, "h2_mplx_out_read_to_post");            if (status == APR_SUCCESS) {                h2_io_signal(io, H2_IO_WRITE);            }        }        else {            status = APR_ECONNABORTED;        }        *ptrailers = (*peos && io->response)? io->response->trailers : NULL;        leave_mutex(m, acquired);    }    return status;}
开发者ID:Sp1l,项目名称:mod_h2,代码行数:29,


示例16: h2_mplx_stream_done

apr_status_t h2_mplx_stream_done(h2_mplx *m, int stream_id, int rst_error){    apr_status_t status = APR_SUCCESS;    apr_thread_mutex_t *holding;    int acquired;        /* This maybe called from inside callbacks that already hold the lock.     * E.g. when we are streaming out DATA and the EOF triggers the stream     * release.     */    AP_DEBUG_ASSERT(m);    if ((status = enter_mutex(m, &acquired)) == APR_SUCCESS) {        h2_io *io = h2_io_set_get(m->stream_ios, stream_id);        /* there should be an h2_io, once the stream has been scheduled         * for processing, e.g. when we received all HEADERs. But when         * a stream is cancelled very early, it will not exist. */        if (io) {            io_stream_done(m, io, rst_error);        }        leave_mutex(m, acquired);    }    return status;}
开发者ID:Sp1l,项目名称:mod_h2,代码行数:25,


示例17: h2_mplx_out_read_to

apr_status_t h2_mplx_out_read_to(h2_mplx *m, int stream_id,                                  apr_bucket_brigade *bb,                                  apr_off_t *plen, int *peos,                                 apr_table_t **ptrailers){    apr_status_t status;    AP_DEBUG_ASSERT(m);    if (m->aborted) {        return APR_ECONNABORTED;    }    status = apr_thread_mutex_lock(m->lock);    if (APR_SUCCESS == status) {        h2_io *io = h2_io_set_get(m->stream_ios, stream_id);        if (io && !io->orphaned) {            H2_MPLX_IO_OUT(APLOG_TRACE2, m, io, "h2_mplx_out_read_to_pre");                        status = h2_io_out_read_to(io, bb, plen, peos);                        H2_MPLX_IO_OUT(APLOG_TRACE2, m, io, "h2_mplx_out_read_to_post");            if (status == APR_SUCCESS && io->output_drained) {                apr_thread_cond_signal(io->output_drained);            }        }        else {            status = APR_ECONNABORTED;        }        *ptrailers = (*peos && io->response)? io->response->trailers : NULL;        apr_thread_mutex_unlock(m->lock);    }    return status;}
开发者ID:AzerTyQsdF,项目名称:osx,代码行数:31,


示例18: h2_mplx_in_close

apr_status_t h2_mplx_in_close(h2_mplx *m, int stream_id){    apr_status_t status;    AP_DEBUG_ASSERT(m);    if (m->aborted) {        return APR_ECONNABORTED;    }    status = apr_thread_mutex_lock(m->lock);    if (APR_SUCCESS == status) {        h2_io *io = h2_io_set_get(m->stream_ios, stream_id);        if (io && !io->orphaned) {            status = h2_io_in_close(io);            H2_MPLX_IO_IN(APLOG_TRACE2, m, io, "h2_mplx_in_close");            if (io->input_arrived) {                apr_thread_cond_signal(io->input_arrived);            }            io_process_events(m, io);        }        else {            status = APR_ECONNABORTED;        }        apr_thread_mutex_unlock(m->lock);    }    return status;}
开发者ID:AzerTyQsdF,项目名称:osx,代码行数:25,


示例19: h2_mplx_in_read

apr_status_t h2_mplx_in_read(h2_mplx *m, apr_read_type_e block,                             int stream_id, apr_bucket_brigade *bb,                             struct apr_thread_cond_t *iowait){    apr_status_t status;     AP_DEBUG_ASSERT(m);    if (m->aborted) {        return APR_ECONNABORTED;    }    status = apr_thread_mutex_lock(m->lock);    if (APR_SUCCESS == status) {        h2_io *io = h2_io_set_get(m->stream_ios, stream_id);        if (io && !io->orphaned) {            io->input_arrived = iowait;            H2_MPLX_IO_IN(APLOG_TRACE2, m, io, "h2_mplx_in_read_pre");            status = h2_io_in_read(io, bb, -1);            while (APR_STATUS_IS_EAGAIN(status)                    && !is_aborted(m, &status)                   && block == APR_BLOCK_READ) {                apr_thread_cond_wait(io->input_arrived, m->lock);                status = h2_io_in_read(io, bb, -1);            }            H2_MPLX_IO_IN(APLOG_TRACE2, m, io, "h2_mplx_in_read_post");            io->input_arrived = NULL;        }        else {            status = APR_EOF;        }        apr_thread_mutex_unlock(m->lock);    }    return status;}
开发者ID:AzerTyQsdF,项目名称:osx,代码行数:32,


示例20: set_state

static void set_state(h2_stream *stream, h2_stream_state_t state){    AP_DEBUG_ASSERT(stream);    if (stream->state != state) {        stream->state = state;    }}
开发者ID:r4-keisuke,项目名称:mod_h2,代码行数:7,


示例21: h2_mplx_in_update_windows

apr_status_t h2_mplx_in_update_windows(h2_mplx *m){    apr_status_t status;    int acquired;        AP_DEBUG_ASSERT(m);    if (m->aborted) {        return APR_ECONNABORTED;    }    if ((status = enter_mutex(m, &acquired)) == APR_SUCCESS) {        update_ctx ctx;                ctx.m               = m;        ctx.streams_updated = 0;        status = APR_EAGAIN;        h2_io_set_iter(m->stream_ios, update_window, &ctx);                if (ctx.streams_updated) {            status = APR_SUCCESS;        }        leave_mutex(m, acquired);    }    return status;}
开发者ID:Sp1l,项目名称:mod_h2,代码行数:25,


示例22: h2_mplx_out_rst

apr_status_t h2_mplx_out_rst(h2_mplx *m, int stream_id, int error){    apr_status_t status;    AP_DEBUG_ASSERT(m);    if (m->aborted) {        return APR_ECONNABORTED;    }    status = apr_thread_mutex_lock(m->lock);    if (APR_SUCCESS == status) {        if (!m->aborted) {            h2_io *io = h2_io_set_get(m->stream_ios, stream_id);            if (io && !io->rst_error && !io->orphaned) {                h2_io_rst(io, error);                if (!io->response) {                        h2_io_set_add(m->ready_ios, io);                }                H2_MPLX_IO_OUT(APLOG_TRACE2, m, io, "h2_mplx_out_rst");                                have_out_data_for(m, stream_id);                if (io->output_drained) {                    apr_thread_cond_signal(io->output_drained);                }            }            else {                status = APR_ECONNABORTED;            }        }        apr_thread_mutex_unlock(m->lock);    }    return status;}
开发者ID:AzerTyQsdF,项目名称:osx,代码行数:31,


示例23: h2_mplx_process

apr_status_t h2_mplx_process(h2_mplx *m, int stream_id,                             const h2_request *req, int eos,                              h2_stream_pri_cmp *cmp, void *ctx){    apr_status_t status;        AP_DEBUG_ASSERT(m);    if (m->aborted) {        return APR_ECONNABORTED;    }    status = apr_thread_mutex_lock(m->lock);    if (APR_SUCCESS == status) {        h2_io *io = open_io(m, stream_id);        io->request = req;        io->request_body = !eos;        if (eos) {            status = h2_io_in_close(io);        }                h2_tq_add(m->q, io->id, cmp, ctx);        ap_log_cerror(APLOG_MARK, APLOG_TRACE1, status, m->c,                      "h2_mplx(%ld-%d): process", m->c->id, stream_id);        H2_MPLX_IO_IN(APLOG_TRACE2, m, io, "h2_mplx_process");        apr_thread_mutex_unlock(m->lock);    }        if (status == APR_SUCCESS) {        workers_register(m);    }    return status;}
开发者ID:AzerTyQsdF,项目名称:osx,代码行数:33,


示例24: h2_mplx_out_rst

apr_status_t h2_mplx_out_rst(h2_mplx *m, int stream_id, int error){    apr_status_t status;    int acquired;        AP_DEBUG_ASSERT(m);    if ((status = enter_mutex(m, &acquired)) == APR_SUCCESS) {        h2_io *io = h2_io_set_get(m->stream_ios, stream_id);        if (io && !io->rst_error && !io->orphaned) {            h2_io_rst(io, error);            if (!io->response) {                h2_io_set_add(m->ready_ios, io);            }            H2_MPLX_IO_OUT(APLOG_TRACE2, m, io, "h2_mplx_out_rst");                        have_out_data_for(m, stream_id);            h2_io_signal(io, H2_IO_WRITE);        }        else {            status = APR_ECONNABORTED;        }        leave_mutex(m, acquired);    }    return status;}
开发者ID:Sp1l,项目名称:mod_h2,代码行数:25,


示例25: ap_queue_info_set_idle

apr_status_t ap_queue_info_set_idle(fd_queue_info_t * queue_info,                                    apr_pool_t * pool_to_recycle){    apr_status_t rv;    apr_int32_t prev_idlers;    ap_push_pool(queue_info, pool_to_recycle);    /* Atomically increment the count of idle workers */    prev_idlers = apr_atomic_inc32(&(queue_info->idlers)) - zero_pt;    /* If other threads are waiting on a worker, wake one up */    if (prev_idlers < 0) {        rv = apr_thread_mutex_lock(queue_info->idlers_mutex);        if (rv != APR_SUCCESS) {            AP_DEBUG_ASSERT(0);            return rv;        }        rv = apr_thread_cond_signal(queue_info->wait_for_idler);        if (rv != APR_SUCCESS) {            apr_thread_mutex_unlock(queue_info->idlers_mutex);            return rv;        }        rv = apr_thread_mutex_unlock(queue_info->idlers_mutex);        if (rv != APR_SUCCESS) {            return rv;        }    }    return APR_SUCCESS;}
开发者ID:AzerTyQsdF,项目名称:osx,代码行数:31,


示例26: h2_mplx_process

apr_status_t h2_mplx_process(h2_mplx *m, int stream_id, const h2_request *req,                              h2_stream_pri_cmp *cmp, void *ctx){    apr_status_t status;    int was_empty = 0;    int acquired;        AP_DEBUG_ASSERT(m);    if ((status = enter_mutex(m, &acquired)) == APR_SUCCESS) {        if (m->aborted) {            status = APR_ECONNABORTED;        }        else {            h2_io *io = open_io(m, stream_id);            io->request = req;                        if (!io->request->body) {                status = h2_io_in_close(io);            }                        was_empty = h2_tq_empty(m->q);            h2_tq_add(m->q, io->id, cmp, ctx);                        ap_log_cerror(APLOG_MARK, APLOG_TRACE1, status, m->c,                          "h2_mplx(%ld-%d): process", m->c->id, stream_id);            H2_MPLX_IO_IN(APLOG_TRACE2, m, io, "h2_mplx_process");        }        leave_mutex(m, acquired);    }    if (status == APR_SUCCESS && was_empty) {        workers_register(m);    }    return status;}
开发者ID:Sp1l,项目名称:mod_h2,代码行数:34,


示例27: h2_session_destroy

void h2_session_destroy(h2_session *session){    AP_DEBUG_ASSERT(session);    if (session->mplx) {        h2_mplx_release_and_join(session->mplx, session->iowait);        session->mplx = NULL;    }    if (session->streams) {        if (h2_stream_set_size(session->streams)) {            ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, session->c,                          "h2_session(%ld): destroy, %d streams open",                          session->id, (int)h2_stream_set_size(session->streams));        }        h2_stream_set_destroy(session->streams);        session->streams = NULL;    }    if (session->ngh2) {        nghttp2_session_del(session->ngh2);        session->ngh2 = NULL;    }    h2_conn_io_destroy(&session->io);        if (session->iowait) {        apr_thread_cond_destroy(session->iowait);        session->iowait = NULL;    }        if (session->pool) {        apr_pool_destroy(session->pool);    }}
开发者ID:MichealYangGitHub,项目名称:C,代码行数:31,


示例28: h2_mplx_out_write

apr_status_t h2_mplx_out_write(h2_mplx *m, int stream_id,                                ap_filter_t* f, apr_bucket_brigade *bb,                               struct apr_thread_cond_t *iowait){    apr_status_t status;    AP_DEBUG_ASSERT(m);    if (m->aborted) {        return APR_ECONNABORTED;    }    status = apr_thread_mutex_lock(m->lock);    if (APR_SUCCESS == status) {        if (!m->aborted) {            h2_io *io = h2_io_set_get(m->stream_ios, stream_id);            if (io) {                status = out_write(m, io, f, bb, iowait);                have_out_data_for(m, stream_id);                if (m->aborted) {                    return APR_ECONNABORTED;                }            }            else {                status = APR_ECONNABORTED;            }        }                if (m->lock) {            apr_thread_mutex_unlock(m->lock);        }    }    return status;}
开发者ID:stevedien,项目名称:mod_h2,代码行数:31,


示例29: h2_stream_rwrite

apr_status_t h2_stream_rwrite(h2_stream *stream, request_rec *r){    AP_DEBUG_ASSERT(stream);    set_state(stream, H2_STREAM_ST_OPEN);    apr_status_t status = h2_request_rwrite(stream->request, r, stream->m);    return status;}
开发者ID:r4-keisuke,项目名称:mod_h2,代码行数:7,



注:本文中的AP_DEBUG_ASSERT函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ AP_GROUPINFO函数代码示例
C++ APUSetZN8函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。