gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/rtmp r9801: always send the close connecti


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r9801: always send the close connection after a GET request, apache does.
Date: Sat, 29 Nov 2008 12:33:52 -0700
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9801
committer: address@hidden
branch nick: rtmp
timestamp: Sat 2008-11-29 12:33:52 -0700
message:
  always send the close connection after a GET request, apache does.
modified:
  libnet/http.cpp
=== modified file 'libnet/http.cpp'
--- a/libnet/http.cpp   2008-11-29 01:09:55 +0000
+++ b/libnet/http.cpp   2008-11-29 19:33:52 +0000
@@ -610,10 +610,12 @@
     formatDate();
     formatServer();
     formatLastModified();
-    formatAcceptRanges("bytes");
+    formatAcceptRanges("nytes");
     formatContentLength(size);
-    formatKeepAlive("timeout=15, max=100");
+    // Apache closes the connection on GET requests, so we do the same.
+    formatConnection("close");
     formatContentType(type);
+
     // All HTTP messages are followed by a blank line.
     terminateHeader();
 
@@ -1221,6 +1223,8 @@
            filestream.reset(new DiskStream);
 //         cerr << "New Filestream at 0x" << hex << filestream.get() << endl;
 
+//         cache.addFile(url, filestream);     FIXME: always reload from disk 
for now.
+           
            // Oopen the file and read the furst chunk into memory
            filestream->open(url);
            
@@ -1234,10 +1238,10 @@
        
        
        // Send the reply
-       amf::Buffer &fooby = www.formatHeader(filestream->getFileType(),
+       amf::Buffer &reply = www.formatHeader(filestream->getFileType(),
                                              filestream->getFileSize(),
                                              HTTP::OK);
-       www.writeNet(args->netfd, fooby);
+       www.writeNet(args->netfd, reply);
 //     hand->writeNet(args->netfd, www.getHeader(), 
www.getHeader().allocated());
 //     strcpy(thread_data.filespec, filespec.c_str());
 //     thread_data.statistics = conndata->statistics;
@@ -1249,6 +1253,7 @@
 //     st.setBytes(www.getBytesIn() + www.getBytesOut());
 //     conndata->statistics->addStats();
 
+#if 0
        string response = cache.findResponse(filestream->getFilespec());
        if (response.empty()) {
            cerr << "FIXME no cache hit for: " << www.getFilespec() << endl;
@@ -1260,7 +1265,8 @@
            cerr << "FIXME cache hit on: " << www.getFilespec() << endl;
            www.writeNet(args->netfd, (boost::uint8_t *)response.c_str(), 
response.size());
        }       
-
+#endif
+       
 //     cerr << www.getHeader().c_str() << endl;
 
        size_t filesize = filestream->getFileSize();
@@ -1303,7 +1309,6 @@
                 << time << " seconds." << endl;
 #endif
 //         filestream->close();
-//         cache.addFile(www.getFilespec(), filestream);
        }
        log_debug("http_handler all done transferring requested file...");
 //     cache.dump();


reply via email to

[Prev in Thread] Current Thread [Next in Thread]