static void on_accept(grpc_exec_ctx *exec_ctx, void *statep,
                      grpc_endpoint *tcp) {
  grpc_server_secure_state *state = statep;
  state_ref(state);
  grpc_security_connector_do_handshake(exec_ctx, state->sc, tcp,
                                       on_secure_handshake_done, state);
}
Exemple #2
0
static void on_accept(grpc_exec_ctx *exec_ctx, void *statep, grpc_endpoint *tcp,
                      grpc_pollset *accepting_pollset,
                      grpc_tcp_server_acceptor *acceptor) {
  server_secure_connect *state = gpr_malloc(sizeof(*state));
  state->state = statep;
  state_ref(state->state);
  state->accepting_pollset = accepting_pollset;
  grpc_server_security_connector_do_handshake(
      exec_ctx, state->state->sc, acceptor, tcp,
      gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
                   gpr_time_from_seconds(120, GPR_TIMESPAN)),
      on_secure_handshake_done, state);
}
Exemple #3
0
Transition* trans_new(State *dest){
    Transition *trans = NULL;
    
    if((trans = (Transition *) calloc(1, sizeof(Transition))) == NULL){
        dbg_e("Error on malloc() the new transition'", NULL);
        goto end;
    }
    trans->dest = dest;
    state_ref(dest);
    trans->clistnext = trans;
    trans->clistprev = trans;
    trans->raction = NULL;
end:
    return trans;
}
Exemple #4
0
static void on_accept(grpc_exec_ctx *exec_ctx, void *statep, grpc_endpoint *tcp,
                      grpc_pollset *accepting_pollset,
                      grpc_tcp_server_acceptor *acceptor) {
  server_secure_connect *state = gpr_malloc(sizeof(*state));
  state->state = statep;
  state_ref(state->state);
  state->accepting_pollset = accepting_pollset;
  state->acceptor = acceptor;
  state->handshake_mgr = grpc_handshake_manager_create();
  // TODO(roth): We should really get this timeout value from channel
  // args instead of hard-coding it.
  state->deadline = gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
                                 gpr_time_from_seconds(120, GPR_TIMESPAN));
  grpc_handshake_manager_do_handshake(
      exec_ctx, state->handshake_mgr, tcp,
      grpc_server_get_channel_args(state->state->server), state->deadline,
      acceptor, on_handshake_done, state);
}
Exemple #5
0
static void on_accept(void *statep, grpc_endpoint *tcp) {
  grpc_server_secure_state *state = statep;
  state_ref(state);
  grpc_setup_secure_transport(state->ctx, tcp, on_secure_transport_setup_done,
                              state);
}
Exemple #6
0
void state_set_fsminitial(State *ste, State *fsminitial){
    state_ref(fsminitial);
    ste->fsminitial = fsminitial;
}