Changeset 1847 in ntrip
- Timestamp:
- Jun 8, 2009, 4:07:22 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ntripclient/ntripclient.c
r1830 r1847 1 1 /* 2 2 NTRIP client for POSIX. 3 $Id: ntripclient.c,v 1.4 8 2009/04/27 09:49:54 stoeckerExp $3 $Id: ntripclient.c,v 1.49 2009/05/06 14:52:52 stuerze Exp $ 4 4 Copyright (C) 2003-2008 by Dirk Stöcker <soft@dstoecker.de> 5 5 … … 65 65 66 66 /* CVS revision and version */ 67 static char revisionstr[] = "$Revision: 1.4 8$";68 static char datestr[] = "$Date: 2009/0 4/27 09:49:54$";67 static char revisionstr[] = "$Revision: 1.49 $"; 68 static char datestr[] = "$Date: 2009/05/06 14:52:52 $"; 69 69 70 70 enum MODE { HTTP = 1, RTSP = 2, NTRIP1 = 3, AUTO = 4, UDP = 5, END }; … … 1085 1085 "Ntrip-Component: Ntripclient\r\n" 1086 1086 "User-Agent: %s/%s\r\n" 1087 "%s%s%s" 1087 1088 "Transport: RTP/GNSS;unicast;client_port=%u%s", 1088 1089 args.server, proxyserver ? ":" : "", proxyserver ? args.port : "", 1089 args.data, cseq++, AGENTSTRING, revisionstr, localport, 1090 args.data, cseq++, AGENTSTRING, revisionstr, 1091 args.nmea ? "Ntrip-GGA: " : "", args.nmea ? args.nmea : "", 1092 args.nmea ? "\r\n" : "", 1093 localport, 1090 1094 (*args.user || *args.password) ? "\r\nAuthorization: Basic " : ""); 1091 1095 if(i > MAXDATASIZE-40 || i < 0) /* second check for old glibc */ … … 1104 1108 buf[i++] = '\r'; 1105 1109 buf[i++] = '\n'; 1106 if(args.nmea)1107 {1108 int j = snprintf(buf+i, MAXDATASIZE-i, "%s\r\n", args.nmea);1109 if(j >= 0 && j < MAXDATASIZE-i)1110 i += j;1111 else1112 {1113 fprintf(stderr, "NMEA string too long\n");1114 stop = 1;1115 }1116 }1117 1110 } 1118 1111 if(!stop && !error) … … 1420 1413 else 1421 1414 { 1415 const char *nmeahead = (args.nmea && args.mode == HTTP) ? args.nmea : 0; 1416 1422 1417 i=snprintf(buf, MAXDATASIZE-40, /* leave some space for login */ 1423 1418 "GET %s%s%s%s/%s HTTP/1.1\r\n" 1424 1419 "Host: %s\r\n%s" 1425 1420 "User-Agent: %s/%s\r\n" 1421 "%s%s%s" 1426 1422 "Connection: close%s" 1427 1423 , proxyserver ? "http://" : "", proxyserver ? proxyserver : "", … … 1430 1426 args.mode == NTRIP1 ? "" : "Ntrip-Version: Ntrip/2.0\r\n", 1431 1427 AGENTSTRING, revisionstr, 1428 nmeahead ? "Ntrip-GGA: " : "", nmeahead ? nmeahead : "", 1429 nmeahead ? "\r\n" : "", 1432 1430 (*args.user || *args.password) ? "\r\nAuthorization: Basic " : ""); 1433 1431 if(i > MAXDATASIZE-40 || i < 0) /* second check for old glibc */ … … 1450 1448 buf[i++] = '\r'; 1451 1449 buf[i++] = '\n'; 1452 if(args.nmea )1450 if(args.nmea && !nmeahead) 1453 1451 { 1454 1452 int j = snprintf(buf+i, MAXDATASIZE-i, "%s\r\n", args.nmea);
Note:
See TracChangeset
for help on using the changeset viewer.