Browse Source

*** debugging main

wip/debug-various
Oswald Buddenhagen 3 years ago
parent
commit
4e3fe8c0b6
  1. 13
      src/main_sync.c

13
src/main_sync.c

@ -423,6 +423,7 @@ store_bad( void *aux )
{ {
MVARS(aux) MVARS(aux)
info("bad store %d\n", t);
mvars->drv[t]->cancel_store( mvars->ctx[t] ); mvars->drv[t]->cancel_store( mvars->ctx[t] );
mvars->state[t] = ST_CLOSED; mvars->state[t] = ST_CLOSED;
mvars->cvars->ret = 1; mvars->cvars->ret = 1;
@ -432,6 +433,7 @@ store_bad( void *aux )
static void static void
advance_chan( main_vars_t *mvars ) advance_chan( main_vars_t *mvars )
{ {
info("advance chan\n");
if (!mvars->cvars->list) { if (!mvars->cvars->list) {
chans_done++; chans_done++;
stats(); stats();
@ -444,7 +446,9 @@ advance_chan( main_vars_t *mvars )
static void static void
do_sync_chans( main_vars_t *mvars ) do_sync_chans( main_vars_t *mvars )
{ {
info("sync chans entry\n");
while (mvars->chanptr) { while (mvars->chanptr) {
info("sync chans round\n");
stats_steps = 0; // Determine main loop use afresh stats_steps = 0; // Determine main loop use afresh
mvars->chan = mvars->chanptr->conf; mvars->chan = mvars->chanptr->conf;
info( "Channel %s\n", mvars->chan->name ); info( "Channel %s\n", mvars->chan->name );
@ -500,6 +504,7 @@ do_sync_chans( main_vars_t *mvars )
static void static void
sync_next_chan( main_vars_t *mvars ) sync_next_chan( main_vars_t *mvars )
{ {
info("next chan\n");
if (mvars->chan_cben) { if (mvars->chan_cben) {
advance_chan( mvars ); advance_chan( mvars );
do_sync_chans( mvars ); do_sync_chans( mvars );
@ -511,6 +516,7 @@ store_connected( int sts, void *aux )
{ {
MVARS(aux) MVARS(aux)
info("connected %d\n", t);
switch (sts) { switch (sts) {
case DRV_CANCELED: case DRV_CANCELED:
return; return;
@ -571,6 +577,7 @@ store_listed( int sts, string_list_t *boxes, void *aux )
{ {
MVARS(aux) MVARS(aux)
int fail = 0; int fail = 0;
info("listed %d\n", t);
switch (sts) { switch (sts) {
case DRV_CANCELED: case DRV_CANCELED:
@ -612,6 +619,7 @@ store_listed( int sts, string_list_t *boxes, void *aux )
static void static void
sync_opened( main_vars_t *mvars, int t ) sync_opened( main_vars_t *mvars, int t )
{ {
info("opened %d\n", t);
mvars->state[t] = ST_OPEN; mvars->state[t] = ST_OPEN;
if (mvars->state[t^1] != ST_OPEN) if (mvars->state[t^1] != ST_OPEN)
return; return;
@ -667,8 +675,10 @@ sync_opened( main_vars_t *mvars, int t )
static void static void
do_sync_boxes( main_vars_t *mvars ) do_sync_boxes( main_vars_t *mvars )
{ {
info("sync boxes entry\n");
mvars->box_cben = 0; mvars->box_cben = 0;
for (;;) { for (;;) {
info("sync boxes round\n");
if (mvars->chanptr->boxlist) { if (mvars->chanptr->boxlist) {
box_ent_t *mbox = mvars->boxptr; box_ent_t *mbox = mvars->boxptr;
if (!mbox) if (!mbox)
@ -726,6 +736,7 @@ done_sync( int sts, void *aux )
{ {
main_vars_t *mvars = (main_vars_t *)aux; main_vars_t *mvars = (main_vars_t *)aux;
info("done sync\n");
boxes_done++; boxes_done++;
stats(); stats();
if (sts) { if (sts) {
@ -747,6 +758,7 @@ static void sync_finalized( void *aux );
static void static void
finalize_sync( main_vars_t *mvars ) finalize_sync( main_vars_t *mvars )
{ {
info("finalize\n");
if (mvars->chanptr->boxlist) { if (mvars->chanptr->boxlist) {
box_ent_t *mbox, *nmbox; box_ent_t *mbox, *nmbox;
for (nmbox = mvars->chanptr->boxes; (mbox = nmbox); ) { for (nmbox = mvars->chanptr->boxes; (mbox = nmbox); ) {
@ -783,6 +795,7 @@ sync_finalized( void *aux )
{ {
MVARS(aux) MVARS(aux)
info("finalized %d\n", t);
mvars->drv[t]->free_store( mvars->ctx[t] ); mvars->drv[t]->free_store( mvars->ctx[t] );
mvars->state[t] = ST_CLOSED; mvars->state[t] = ST_CLOSED;
if (mvars->state[t^1] != ST_CLOSED) if (mvars->state[t^1] != ST_CLOSED)

Loading…
Cancel
Save