IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 23, 2008, 1:17:40 PM (18 years ago)
Author:
eugene
Message:

fixed up the pcontrol / pclient interactions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pcontrol/PclientCommand.c

    r17475 r17476  
    66
    77  int status;
    8   IOBuffer buffer;
    98
    109  ASSERT (host != NULL, "host missing");
     
    1211
    1312  // flush the stdout and stderr buffers here
    14   ReadtoIOBuffer (&buffer, host[0].stdout_fd);
    15   FlushIOBuffer (&buffer);
    16   ReadtoIOBuffer (&buffer, host[0].stderr_fd);
    17   FlushIOBuffer (&buffer);
     13  // recycle comms_buffer to minimize page thrashing
     14  ReadtoIOBuffer (&host[0].comms_buffer, host[0].stdout_fd);
     15  FlushIOBuffer (&host[0].comms_buffer);
     16  ReadtoIOBuffer (&host[0].comms_buffer, host[0].stderr_fd);
     17  FlushIOBuffer (&host[0].comms_buffer);
    1818
    1919  /* send command to client (adding on \n) */
     
    3030  host[0].response = response;
    3131  FlushIOBuffer (&host[0].comms_buffer);
     32
     33  // fprintf (stderr, "command: %s\n", command);
    3234
    3335  return (PCLIENT_GOOD);
     
    6769  if (status == -1) return (PCLIENT_HUNG);
    6870
    69   // fprintf (stderr, "buffer.buffer: %s\n", buffer[0].buffer);
    70 
    71   // we have detected a valid response, clear the response data
    72   host[0].response_state = PCONTROL_RESP_NONE;
    73   host[0].response = NULL;
     71  // fprintf (stderr, "response: %s\n", buffer[0].buffer);
    7472
    7573  return (PCLIENT_GOOD);
Note: See TracChangeset for help on using the changeset viewer.