Skip to content

Commit

Permalink
sources: apply clang-format11 (#659)
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Khapov <[email protected]>
Co-authored-by: Roman Khapov <[email protected]>
  • Loading branch information
rkhapov and Roman Khapov authored Aug 13, 2024
1 parent a4bf150 commit da72d68
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion sources/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ static inline int od_console_show_servers_server_cb(od_server_t *server,
/* type */
char data[64];
size_t data_len;
od_client_t * client = server->client;
od_client_t *client = server->client;
if (client != NULL && client->type == OD_POOL_CLIENT_INTERNAL) {
data_len = od_snprintf(data, sizeof(data), "SI");
} else {
Expand Down
26 changes: 14 additions & 12 deletions sources/relay.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,22 +146,23 @@ static inline int od_relay_stop(od_relay_t *relay)
return 0;
}

static inline int od_relay_full_packet_required(char *data, int require_full_prep_stmt)
static inline int od_relay_full_packet_required(char *data,
int require_full_prep_stmt)
{
kiwi_header_t *header;
header = (kiwi_header_t *)data;

switch (header->type) {
case KIWI_BE_PARAMETER_STATUS:
case KIWI_BE_READY_FOR_QUERY:
case KIWI_BE_ERROR_RESPONSE:
return 1;
case KIWI_FE_PARSE:
case KIWI_FE_BIND:
case KIWI_FE_DESCRIBE:
return require_full_prep_stmt;
default:
return 0;
case KIWI_BE_PARAMETER_STATUS:
case KIWI_BE_READY_FOR_QUERY:
case KIWI_BE_ERROR_RESPONSE:
return 1;
case KIWI_FE_PARSE:
case KIWI_FE_BIND:
case KIWI_FE_DESCRIBE:
return require_full_prep_stmt;
default:
return 0;
}
}

Expand Down Expand Up @@ -257,7 +258,8 @@ od_relay_process(od_relay_t *relay, int *progress, char *data, int size)
relay->packet = total - size;
relay->packet_skip = 0;

rc = od_relay_full_packet_required(data, relay->require_full_prep_stmt);
rc = od_relay_full_packet_required(
data, relay->require_full_prep_stmt);
if (!rc)
return od_relay_on_packet(relay, data, size);

Expand Down

0 comments on commit da72d68

Please sign in to comment.