From 582967286ac4d39caa3e1dac0498ea1b54e3bb8f Mon Sep 17 00:00:00 2001 From: Don BURNS Date: Tue, 7 Mar 2006 18:26:32 +0000 Subject: [PATCH] Improved the GET protocol for the http socket. By adding Connection: close the server sends a EOF immediately after the data, improving performance because readers are not left waiting for EOF. --- src/osgPlugins/net/ReaderWriterNET.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/osgPlugins/net/ReaderWriterNET.cpp b/src/osgPlugins/net/ReaderWriterNET.cpp index 3cb1b10fe..b22c69fe5 100644 --- a/src/osgPlugins/net/ReaderWriterNET.cpp +++ b/src/osgPlugins/net/ReaderWriterNET.cpp @@ -272,7 +272,14 @@ class NetReader : public osgDB::ReaderWriter return ReadResult::FILE_NOT_FOUND; } - *sio << "GET /" << fileName << " HTTP/1.1\n" << "Host: " << hostname << "\n\n"; + *sio << + "GET /" << fileName << " HTTP/1.1\n" + "User-Agent: OSGNetPlugin/1.0\n" + "Accept: */*\n" + "Host: " << hostname << "\n" + "Connection: close\n" + "\n"; + sio->flush(); char linebuff[256];