IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16002


Ignore:
Timestamp:
Jan 4, 2008, 11:24:10 AM (18 years ago)
Author:
eugene
Message:

partial solution to server timeouts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/lib.shell/multicommand.c

    r12404 r16002  
    22
    33static int server = 0;
     4static int bufferPending = FALSE;
    45
    56// XXX this is rather pantasks-specific...
     
    5556    if (*tmpline) {
    5657
     58      if (bufferPending) {
     59        // flush old messages
     60        while (ExpectMessage (server, 0.2, &message));
     61        bufferPending = FALSE;
     62      }
     63
    5764      status = command (tmpline, &outline, verbose);
    5865
     
    6673                exit (1);
    6774              default:
    68                 gprint (GP_ERR, "I/O error sending server message\n");
    69                 exit (2);
     75                gprint (GP_ERR, "server is busy...\n");
     76                bufferPending = TRUE;
     77                goto escape;
    7078            }
    7179          }
     
    7886                exit (1);
    7987              default:
    80                 gprint (GP_ERR, "I/O error sending server message\n");
    81                 exit (2);
     88                gprint (GP_ERR, "server is busy...\n");
     89                bufferPending = TRUE;
     90                goto escape;
    8291            }
    8392          } else {
     
    92101                exit (1);
    93102              default:
    94                 gprint (GP_ERR, "I/O error sending server message\n");
    95                 exit (2);
     103                gprint (GP_ERR, "server is busy...\n");
     104                bufferPending = TRUE;
     105                goto escape;
    96106            }
    97107          } else {
     
    106116                exit (1);
    107117              default:
    108                 gprint (GP_ERR, "I/O error sending server message\n");
    109                 exit (2);
     118                gprint (GP_ERR, "server is busy...\n");
     119                bufferPending = TRUE;
     120                goto escape;
    110121            }
    111122          } else {
     
    117128        }       
    118129      }
    119 
     130    escape:
    120131      if (outline != NULL) free (outline);
    121132      if (!status && auto_break) done = TRUE;
Note: See TracChangeset for help on using the changeset viewer.