ext/iodine/redis_engine.c
/* listens to channel -2 for commands that need to be sent (only ROOT) */
listens to channel -2 for commands that need to be sent (only ROOT)
listens to channel - 2 for commands that need to be sent ( only ROOT )
static void redis_on_internal_cmd(fio_msg_s *msg) {
  fio_pubsub_engine_s *engine =
      (fio_pubsub_engine_s *)fio_str2u64(msg->channel.data + 0);
  if (engine != msg->udata1) {
    return;
  }
  redis_commands_s *cmd = fio_malloc(sizeof(*cmd) + msg->msg.len + 1 + 28);
  FIO_ASSERT_ALLOC(cmd);
  *cmd = (redis_commands_s){.callback = redis_forward_reply,
                            .udata = (cmd->cmd + msg->msg.len + 1),
                            .cmd_len = msg->msg.len};
  memcpy(cmd->cmd, msg->msg.data, msg->msg.len);
  memcpy(cmd->cmd + msg->msg.len + 1, msg->channel.data, 28);
  redis_attach_cmd((redis_engine_s *)engine, cmd);
}
static void redis_on_internal_cmd ( fio_msg_s * msg ) { fio_pubsub_engine_s * engine = ( fio_pubsub_engine_s * ) fio_str2u64 ( msg -> channel . data + 0 ) ; if ( engine != msg -> udata1 ) { return ; } redis_commands_s * cmd = fio_malloc ( sizeof ( * cmd ) + msg -> msg . len + 1 + 28 ) ; FIO_ASSERT_ALLOC ( cmd ) ; * cmd = ( redis_commands_s ) { . callback = redis_forward_reply , . udata = ( cmd -> cmd + msg -> msg . len + 1 ) , . cmd_len = msg -> msg . len } ; memcpy ( cmd -> cmd , msg -> msg . data , msg -> msg . len ) ; memcpy ( cmd -> cmd + msg -> msg . len + 1 , msg -> channel . data , 28 ) ; redis_attach_cmd ( ( redis_engine_s * ) engine , cmd ) ; }
listens to channel -2 for commands that need to be sent (only ROOT)
listens to channel - 2 for commands that need to be sent ( only ROOT )
// void*(void *)fio_str2u64(msg->msg.data); // fprintf(stderr, " *** Attached CMD (%d) ***\n%s\n", getpid(), cmd->cmd);