summaryrefslogtreecommitdiff
path: root/net_ntrip.c
diff options
context:
space:
mode:
authorDirk Stöcker <dirk@dstoecker.de>2011-04-10 18:14:59 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-04-10 18:14:59 -0400
commit56e40baed0e986ca9c2391980870ea46d5e94fbf (patch)
treecc37ae331b03fcb6da05893795756dbd2d3ca280 /net_ntrip.c
parentff8ba115120e3749e0f6d6a7e74e97736b158af8 (diff)
downloadgpsd-56e40baed0e986ca9c2391980870ea46d5e94fbf.tar.gz
Dirk wrote: "Could you add the header line "Host:" in the NTRIP
accesses of GPSD (like in net_ntrip.c). This is required to have virtual hosts support working. Currently we still need to provide individual IP's for NTRIP casters, as not all software supports this header line." Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Diffstat (limited to 'net_ntrip.c')
-rw-r--r--net_ntrip.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net_ntrip.c b/net_ntrip.c
index bcdc1dfb..a8b03de2 100644
--- a/net_ntrip.c
+++ b/net_ntrip.c
@@ -313,8 +313,9 @@ static int ntrip_stream_req_probe(const struct ntrip_stream_t *stream)
(void)snprintf(buf, sizeof(buf),
"GET / HTTP/1.1\r\n"
"User-Agent: NTRIP gpsd/%s\r\n"
+ "Host: %s\r\n"
"Connection: close\r\n"
- "\r\n", VERSION);
+ "\r\n", VERSION, stream->url);
r = write(dsock, buf, strlen(buf));
if (r != (ssize_t)strlen(buf)) {
gpsd_report(LOG_ERROR, "ntrip stream write error %d on fd %d during probe request %zd\n",
@@ -367,10 +368,11 @@ static int ntrip_stream_get_req(const struct ntrip_stream_t *stream)
(void)snprintf(buf, sizeof(buf),
"GET /%s HTTP/1.1\r\n"
"User-Agent: NTRIP gpsd/%s\r\n"
+ "Host: %s\r\n"
"Accept: rtk/rtcm, dgps/rtcm\r\n"
"%s"
"Connection: close\r\n"
- "\r\n", stream->mountpoint, VERSION, stream->authStr);
+ "\r\n", stream->mountpoint, VERSION, stream->url, stream->authStr);
if (write(dsock, buf, strlen(buf)) != (ssize_t) strlen(buf)) {
gpsd_report(LOG_ERROR, "ntrip stream write error %d on fd %d during get request\n", errno,
dsock);