IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26415


Ignore:
Timestamp:
Dec 15, 2009, 6:08:46 PM (16 years ago)
Author:
eugene
Message:

ensure socket communication is completed before exiting functions

Location:
branches/eam_branches/20091201/Ohana/src/kapa2/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/Ohana/src/kapa2/src/EraseOverlay.c

    r14590 r26415  
    88  KapaImageWidget *image;
    99
     10  // We have to accept the incoming message even if we cannot perform the action
     11  KiiScanCommand (sock, 16, "%*s %d", &N);
     12
    1013  graphic = GetGraphic();
    1114  section = GetActiveSection();
    1215  image = section->image;
    1316  if (image == NULL) return (TRUE);
    14 
    15   KiiScanCommand (sock, 16, "%*s %d", &N);
    1617
    1718  if (N > NOVERLAYS) {
  • branches/eam_branches/20091201/Ohana/src/kapa2/src/LoadPicture.c

    r25757 r26415  
    7373    if (status == 0) {  /* No more pipe */
    7474      fprintf (stderr, "error: pipe closed\n");
     75      fcntl (sock, F_SETFL, !O_NONBLOCK); 
    7576      return (FALSE);
    7677    }
  • branches/eam_branches/20091201/Ohana/src/kapa2/src/PNGit.c

    r13479 r26415  
    1616
    1717  /* expect a line telling the number of bytes and a filename */
    18   status = read (sock, filename, 16);
    19   filename[16] = 0;
    20   sscanf (filename, "%*s %d", &Nbytes);
    21   status = read (sock, filename, Nbytes);
    22   filename[status] = 0; /* make the string easy to parse */
     18  KiiScanMessage (sock, "%s", filename);
    2319
    2420  f = fopen (filename, "w");
  • branches/eam_branches/20091201/Ohana/src/kapa2/src/PPMit.c

    r13479 r26415  
    1313
    1414  /* expect a line telling the number of bytes and a filename */
    15   status = read (sock, filename, 16);
    16   filename[16] = 0;
    17   sscanf (filename, "%*s %d", &Nbytes);
    18   status = read (sock, filename, Nbytes);
    19   filename[status] = 0; /* make the string easy to parse */
     15  KiiScanMessage (sock, "%s", filename);
    2016
    2117  f = fopen (filename, "w");
  • branches/eam_branches/20091201/Ohana/src/kapa2/src/Resize.c

    r21153 r26415  
    1111  graphic = GetGraphic();
    1212
     13  // must scan the message before possible return
    1314  KiiScanMessage (sock, "%d %d", &NX, &NY);
    1415
  • branches/eam_branches/20091201/Ohana/src/kapa2/src/SaveOverlay.c

    r13479 r26415  
    99  KapaImageWidget *image;
    1010
     11  KiiScanMessage (sock, "%*s %d %s", &N, filename);
     12 
    1113  section = GetActiveSection();
    1214  image   = section->image;
    1315  if (image == NULL) return (TRUE);
    1416
    15   KiiScanMessage (sock, "%*s %d %s", &N, filename);
    16  
    1717  f = fopen (filename, "w");
    1818  if (f == NULL) {
Note: See TracChangeset for help on using the changeset viewer.