Changeset 339 in ntrip for trunk/ntripserver
- Timestamp:
- Nov 29, 2006, 11:43:15 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ntripserver/NtripLinuxServer.c
r326 r339 41 41 */ 42 42 43 /* $Id: NtripLinuxServer.c,v 1.2 3 2006/08/16 08:33:04stoecker Exp $43 /* $Id: NtripLinuxServer.c,v 1.24 2006/11/23 14:39:50 stoecker Exp $ 44 44 * Changes - Version 0.7 45 45 * Sep 22 2003 Steffen Tschirpke <St.Tschirpke@actina.de> … … 463 463 } 464 464 nBufferBytes += encode(szSendBuffer+nBufferBytes, 465 sizeof(szSendBuffer)-nBufferBytes- 5, stream_user, stream_password);466 if(nBufferBytes > (int)sizeof(szSendBuffer)- 5)465 sizeof(szSendBuffer)-nBufferBytes-4, stream_user, stream_password); 466 if(nBufferBytes > (int)sizeof(szSendBuffer)-4) 467 467 { 468 468 fprintf(stderr, "Username and/or password too long\n"); 469 469 exit(1); 470 470 } 471 snprintf(szSendBuffer+nBufferBytes, 5, "\r\n\r\n"); 472 nBufferBytes += 5; 471 szSendBuffer[nBufferBytes++] = '\r'; 472 szSendBuffer[nBufferBytes++] = '\n'; 473 szSendBuffer[nBufferBytes++] = '\r'; 474 szSendBuffer[nBufferBytes++] = '\n'; 473 475 } 474 476 else … … 624 626 sizeof(const char *)); 625 627 /* send message to caster */ 626 szSendBuffer[0] = '\0'; 627 sprintf(szSendBuffer, "SOURCE %s /%s\r\n", password, mountpoint); 628 strcat(szSendBuffer, "Source-Agent: "); 629 strcat(szSendBuffer, VERSION); 630 strcat(szSendBuffer, "\r\n"); 631 strcat(szSendBuffer, "\r\n"); 632 strcat(szSendBuffer, "\0"); 633 nBufferBytes = strlen(szSendBuffer); 628 nBufferBytes = sprintf(szSendBuffer, "SOURCE %s /%s\r\nSource-Agent: " 629 VERSION "\r\n\r\n", password, mountpoint); 634 630 if((send(sock_id, szSendBuffer, (size_t)nBufferBytes, 0)) != nBufferBytes) 635 631 {
Note:
See TracChangeset
for help on using the changeset viewer.