Changeset 10 in ntrip


Ignore:
Timestamp:
Jan 27, 2005, 8:38:04 AM (20 years ago)
Author:
stoecker
Message:

fixed some minor issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ntripclient/NtripLinuxClient.c

    r9 r10  
    11/*
    22  Easy example NTRIP client for Linux/Unix.
    3   $Id: NtripLinuxClient.c,v 1.6 2004/12/13 16:41:41 stoecker Exp $
     3  $Id: NtripLinuxClient.c,v 1.7 2005/01/03 11:33:39 stoecker Exp $
    44  Copyright (C) 2003 by Dirk Stoecker <stoecker@epost.de>
    55   
     
    1818  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1919  or read http://www.gnu.org/licenses/gpl.txt
    20 */
    21 
    22 /* Version history
    23   Please always keep revision history and the two related strings up to date!
    24   1.1   2003-02-24 stoecker    initial version
    25   1.2   2003-02-25 stoecker    fixed agent string
    26   1.6   2004-12-13 stoecker    fixed server string
    27   1.7   2005-01-03 stoecker    fixed for GNCaster access
    2820*/
    2921
     
    4638
    4739/* CVS revision and version */
    48 static char revisionstr[] = "$Revision: 1.6 $";
    49 static char datestr[]     = "$Date: 2004/12/13 16:41:41 $";
     40static char revisionstr[] = "$Revision: 1.7 $";
     41static char datestr[]     = "$Date: 2005/01/03 11:33:39 $";
    5042
    5143struct Args
     
    273265        }
    274266        else
     267        {
    275268          fwrite(buf, numbytes, 1, stdout);
     269          fflush(stdout);
     270        }
    276271      }
    277272    }
    278273    else
    279274    {
    280       while((numbytes=recv(sockfd, buf, MAXDATASIZE-1, 0)) != -1)
     275      while((numbytes=recv(sockfd, buf, MAXDATASIZE-1, 0)) > 0)
    281276      {
    282277        fwrite(buf, numbytes, 1, stdout);
    283         if(!strncmp("ENDSOURCETABLE\r\n", buf+numbytes-16, 16)) break;
    284         if(!strncmp("\r\nENDSOURCETABLE\r\n", buf+numbytes-18, 18)) break;
    285         if(!strncmp("\r\nENDSOURCETABLE\r", buf+numbytes-17, 17)){fprintf(stdout, "\n"); break;}
    286         if(!strncmp("\r\nENDSOURCETABLE", buf+numbytes-16, 16)){fprintf(stdout, "\r\n"); break;}
    287         if(!strncmp("\r\nENDSOURCETABL", buf+numbytes-15, 15)){fprintf(stdout, "E\r\n"); break;}
    288         if(!strncmp("\r\nENDSOURCETAB", buf+numbytes-14, 14)){fprintf(stdout, "LE\r\n"); break;}
    289         if(!strncmp("\r\nENDSOURCETA", buf+numbytes-13, 13)){fprintf(stdout, "BLE\r\n"); break;}
    290         if(!strncmp("\r\nENDSOURCET", buf+numbytes-12, 12)){fprintf(stdout, "ABLE\r\n"); break;}
    291         if(!strncmp("\r\nENDSOURCE", buf+numbytes-11, 11)){fprintf(stdout, "TABLE\r\n"); break;}
    292         if(!strncmp("\r\nENDSOURC", buf+numbytes-10, 10)){fprintf(stdout, "ETABLE\r\n"); break;}
    293         if(!strncmp("\r\nENDSOUR", buf+numbytes-9,   9)){fprintf(stdout, "CETABLE\r\n"); break;}
    294         if(!strncmp("\r\nENDSOU", buf+numbytes-8,   8)){fprintf(stdout, "RCETABLE\r\n"); break;}
    295         if(!strncmp("\r\nENDSO", buf+numbytes-7,   7)){fprintf(stdout, "URCETABLE\r\n"); break;}
    296         if(!strncmp("\r\nENDS", buf+numbytes-6,   6)){fprintf(stdout, "OURCETABLE\r\n"); break;}
    297         if(!strncmp("\r\nEND", buf+numbytes-5,   5)){fprintf(stdout, "SOURCETABLE\r\n"); break;}
    298         if(!strncmp("\r\nEN", buf+numbytes-4,   4)){fprintf(stdout, "DSOURCETABLE\r\n"); break;}
    299         if(!strncmp("\r\nE", buf+numbytes-3,   3)){fprintf(stdout, "NDSOURCETABLE\r\n"); break;}
    300278      }
    301279    }
Note: See TracChangeset for help on using the changeset viewer.