diff options
author | kikht <kikht@yandex-team.ru> | 2022-02-10 16:45:14 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:14 +0300 |
commit | 194cae0e8855b11be2005e1eff12c660c3ee9774 (patch) | |
tree | ed29c437b616690880c017855ebe0be34fdf81a2 /contrib/libs/libevent/evrpc.c | |
parent | 49116032d905455a7b1c994e4a696afc885c1e71 (diff) | |
download | ydb-194cae0e8855b11be2005e1eff12c660c3ee9774.tar.gz |
Restoring authorship annotation for <kikht@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/libevent/evrpc.c')
-rw-r--r-- | contrib/libs/libevent/evrpc.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/contrib/libs/libevent/evrpc.c b/contrib/libs/libevent/evrpc.c index 4a60ca5f07..979d3bdf32 100644 --- a/contrib/libs/libevent/evrpc.c +++ b/contrib/libs/libevent/evrpc.c @@ -25,9 +25,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "event2/event-config.h" -#include "evconfig-private.h" +#include "evconfig-private.h" -#ifdef _WIN32 +#ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include <winsock2.h> #include <windows.h> @@ -35,16 +35,16 @@ #endif #include <sys/types.h> -#ifndef _WIN32 +#ifndef _WIN32 #include <sys/socket.h> #endif -#ifdef EVENT__HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include <sys/time.h> #endif #include <sys/queue.h> #include <stdio.h> #include <stdlib.h> -#ifndef _WIN32 +#ifndef _WIN32 #include <unistd.h> #endif #include <errno.h> @@ -122,7 +122,7 @@ evrpc_add_hook(void *vbase, int (*cb)(void *, struct evhttp_request *, struct evbuffer *, void *), void *cb_arg) { - struct evrpc_hooks_ *base = vbase; + struct evrpc_hooks_ *base = vbase; struct evrpc_hook_list *head = NULL; struct evrpc_hook *hook = NULL; switch (hook_type) { @@ -168,7 +168,7 @@ evrpc_remove_hook_internal(struct evrpc_hook_list *head, void *handle) int evrpc_remove_hook(void *vbase, enum EVRPC_HOOK_TYPE hook_type, void *handle) { - struct evrpc_hooks_ *base = vbase; + struct evrpc_hooks_ *base = vbase; struct evrpc_hook_list *head = NULL; switch (hook_type) { case EVRPC_INPUT: @@ -302,7 +302,7 @@ evrpc_request_cb(struct evhttp_request *req, void *arg) if (TAILQ_FIRST(&rpc->base->input_hooks) != NULL) { int hook_res; - evrpc_hook_associate_meta_(&rpc_state->hook_meta, req->evcon); + evrpc_hook_associate_meta_(&rpc_state->hook_meta, req->evcon); /* * allow hooks to modify the outgoing request @@ -329,8 +329,8 @@ evrpc_request_cb(struct evhttp_request *req, void *arg) return; error: - if (rpc_state) - evrpc_reqstate_free_(rpc_state); + if (rpc_state) + evrpc_reqstate_free_(rpc_state); evhttp_send_error(req, HTTP_SERVUNAVAIL, NULL); return; } @@ -372,14 +372,14 @@ evrpc_request_cb_closure(void *arg, enum EVRPC_HOOK_RESULT hook_res) return; error: - evrpc_reqstate_free_(rpc_state); + evrpc_reqstate_free_(rpc_state); evhttp_send_error(req, HTTP_SERVUNAVAIL, NULL); return; } void -evrpc_reqstate_free_(struct evrpc_req_generic* rpc_state) +evrpc_reqstate_free_(struct evrpc_req_generic* rpc_state) { struct evrpc *rpc; EVUTIL_ASSERT(rpc_state != NULL); @@ -387,7 +387,7 @@ evrpc_reqstate_free_(struct evrpc_req_generic* rpc_state) /* clean up all memory */ if (rpc_state->hook_meta != NULL) - evrpc_hook_context_free_(rpc_state->hook_meta); + evrpc_hook_context_free_(rpc_state->hook_meta); if (rpc_state->request != NULL) rpc->request_free(rpc_state->request); if (rpc_state->reply != NULL) @@ -427,7 +427,7 @@ evrpc_request_done(struct evrpc_req_generic *rpc_state) if (TAILQ_FIRST(&rpc->base->output_hooks) != NULL) { int hook_res; - evrpc_hook_associate_meta_(&rpc_state->hook_meta, req->evcon); + evrpc_hook_associate_meta_(&rpc_state->hook_meta, req->evcon); /* do hook based tweaks to the request */ hook_res = evrpc_process_hooks(&rpc->base->output_hooks, @@ -453,7 +453,7 @@ evrpc_request_done(struct evrpc_req_generic *rpc_state) return; error: - evrpc_reqstate_free_(rpc_state); + evrpc_reqstate_free_(rpc_state); evhttp_send_error(req, HTTP_SERVUNAVAIL, NULL); return; } @@ -488,12 +488,12 @@ evrpc_request_done_closure(void *arg, enum EVRPC_HOOK_RESULT hook_res) } evhttp_send_reply(req, HTTP_OK, "OK", rpc_state->rpc_data); - evrpc_reqstate_free_(rpc_state); + evrpc_reqstate_free_(rpc_state); return; error: - evrpc_reqstate_free_(rpc_state); + evrpc_reqstate_free_(rpc_state); evhttp_send_error(req, HTTP_SERVUNAVAIL, NULL); return; } @@ -529,7 +529,7 @@ static void evrpc_request_wrapper_free(struct evrpc_request_wrapper *request) { if (request->hook_meta != NULL) - evrpc_hook_context_free_(request->hook_meta); + evrpc_hook_context_free_(request->hook_meta); mm_free(request->name); mm_free(request); } @@ -593,8 +593,8 @@ evrpc_pool_add_connection(struct evrpc_pool *pool, * unless a timeout was specifically set for a connection, * the connection inherits the timeout from the pool. */ - if (!evutil_timerisset(&connection->timeout)) - evhttp_connection_set_timeout(connection, pool->timeout); + if (!evutil_timerisset(&connection->timeout)) + evhttp_connection_set_timeout(connection, pool->timeout); /* * if we have any requests pending, schedule them with the new @@ -621,7 +621,7 @@ evrpc_pool_set_timeout(struct evrpc_pool *pool, int timeout_in_secs) { struct evhttp_connection *evcon; TAILQ_FOREACH(evcon, &pool->connections, next) { - evhttp_connection_set_timeout(evcon, timeout_in_secs); + evhttp_connection_set_timeout(evcon, timeout_in_secs); } pool->timeout = timeout_in_secs; } @@ -678,7 +678,7 @@ evrpc_schedule_request(struct evhttp_connection *connection, if (TAILQ_FIRST(&pool->output_hooks) != NULL) { int hook_res; - evrpc_hook_associate_meta_(&ctx->hook_meta, connection); + evrpc_hook_associate_meta_(&ctx->hook_meta, connection); /* apply hooks to the outgoing request */ hook_res = evrpc_process_hooks(&pool->output_hooks, @@ -763,7 +763,7 @@ static int evrpc_pause_request(void *vbase, void *ctx, void (*cb)(void *, enum EVRPC_HOOK_RESULT)) { - struct evrpc_hooks_ *base = vbase; + struct evrpc_hooks_ *base = vbase; struct evrpc_hook_ctx *pause = mm_malloc(sizeof(*pause)); if (pause == NULL) return (-1); @@ -778,7 +778,7 @@ evrpc_pause_request(void *vbase, void *ctx, int evrpc_resume_request(void *vbase, void *ctx, enum EVRPC_HOOK_RESULT res) { - struct evrpc_hooks_ *base = vbase; + struct evrpc_hooks_ *base = vbase; struct evrpc_pause_list *head = &base->pause_requests; struct evrpc_hook_ctx *pause; @@ -875,7 +875,7 @@ evrpc_reply_done(struct evhttp_request *req, void *arg) } if (TAILQ_FIRST(&pool->input_hooks) != NULL) { - evrpc_hook_associate_meta_(&ctx->hook_meta, ctx->evcon); + evrpc_hook_associate_meta_(&ctx->hook_meta, ctx->evcon); /* apply hooks to the incoming request */ hook_res = evrpc_process_hooks(&pool->input_hooks, @@ -892,7 +892,7 @@ evrpc_reply_done(struct evhttp_request *req, void *arg) * layer is going to free it. we need to * request ownership explicitly */ - evhttp_request_own(req); + evhttp_request_own(req); evrpc_pause_request(pool, ctx, evrpc_reply_done_closure); @@ -973,7 +973,7 @@ evrpc_request_timeout(evutil_socket_t fd, short what, void *arg) struct evhttp_connection *evcon = ctx->evcon; EVUTIL_ASSERT(evcon != NULL); - evhttp_connection_fail_(evcon, EVREQ_HTTP_TIMEOUT); + evhttp_connection_fail_(evcon, EVREQ_HTTP_TIMEOUT); } /* @@ -995,7 +995,7 @@ evrpc_meta_data_free(struct evrpc_meta_list *meta_data) } static struct evrpc_hook_meta * -evrpc_hook_meta_new_(void) +evrpc_hook_meta_new_(void) { struct evrpc_hook_meta *ctx; ctx = mm_malloc(sizeof(struct evrpc_hook_meta)); @@ -1008,17 +1008,17 @@ evrpc_hook_meta_new_(void) } static void -evrpc_hook_associate_meta_(struct evrpc_hook_meta **pctx, +evrpc_hook_associate_meta_(struct evrpc_hook_meta **pctx, struct evhttp_connection *evcon) { struct evrpc_hook_meta *ctx = *pctx; if (ctx == NULL) - *pctx = ctx = evrpc_hook_meta_new_(); + *pctx = ctx = evrpc_hook_meta_new_(); ctx->evcon = evcon; } static void -evrpc_hook_context_free_(struct evrpc_hook_meta *ctx) +evrpc_hook_context_free_(struct evrpc_hook_meta *ctx) { evrpc_meta_data_free(&ctx->meta_data); mm_free(ctx); @@ -1034,7 +1034,7 @@ evrpc_hook_add_meta(void *ctx, const char *key, struct evrpc_meta *meta = NULL; if ((store = req->hook_meta) == NULL) - store = req->hook_meta = evrpc_hook_meta_new_(); + store = req->hook_meta = evrpc_hook_meta_new_(); meta = mm_malloc(sizeof(struct evrpc_meta)); EVUTIL_ASSERT(meta != NULL); |