gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog cygnal/cygnal.cpp cygnal/http.c...


From: Rob Savoye
Subject: [Gnash-commit] gnash ChangeLog cygnal/cygnal.cpp cygnal/http.c...
Date: Thu, 13 Dec 2007 21:20:30 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Rob Savoye <rsavoye>    07/12/13 21:20:29

Modified files:
        .              : ChangeLog 
        cygnal         : cygnal.cpp http.cpp http.h 

Log message:
                * cygnal/http.h: Rename getFileType() to getFileStats()
                * cygnal/http.cpp: Set the file size right so it works with all
                browsers.
                * cygnal/cygnal.cpp: Use getFileStats() instead of 
getFileType().

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5165&r2=1.5166
http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/cygnal.cpp?cvsroot=gnash&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/http.cpp?cvsroot=gnash&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/http.h?cvsroot=gnash&r1=1.10&r2=1.11

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5165
retrieving revision 1.5166
diff -u -b -r1.5165 -r1.5166
--- ChangeLog   13 Dec 2007 19:46:32 -0000      1.5165
+++ ChangeLog   13 Dec 2007 21:20:29 -0000      1.5166
@@ -1,5 +1,10 @@
 2007-12-13  Rob Savoye  <address@hidden>
 
+       * cygnal/http.h: Rename getFileType() to getFileStats()
+       * cygnal/http.cpp: Set the file size right so it works with all
+       browsers.
+       * cygnal/cygnal.cpp: Use getFileStats() instead of getFileType().
+       
        * cygnal/cygnal.cpp: Check the file type to set the HTTP
        Content-Tytpe field correctly. Also handle "file not found".
        * cygnal/http.cpp: Trap file not found errors. Format responses

Index: cygnal/cygnal.cpp
===================================================================
RCS file: /sources/gnash/gnash/cygnal/cygnal.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- cygnal/cygnal.cpp   13 Dec 2007 19:46:33 -0000      1.17
+++ cygnal/cygnal.cpp   13 Dec 2007 21:20:29 -0000      1.18
@@ -242,10 +242,11 @@
        parameters = url.substr(pos + 1, url.size());
        // Get the file size for the HTTP header
        
-       if (www.getFileType(filespec) == HTTP::ERROR) {
+       if (www.getFileStats(filespec) == HTTP::ERROR) {
            www.formatErrorResponse(HTTP::NOT_FOUND);
        }
        
+       cerr << "FileSize is: " << www.getFileSize() << endl;
        www.sendGetReply(HTTP::LIFE_IS_GOOD);
 //     strcpy(thread_data.filespec, filespec.c_str());
 //     thread_data.statistics = conndata->statistics;

Index: cygnal/http.cpp
===================================================================
RCS file: /sources/gnash/gnash/cygnal/http.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- cygnal/http.cpp     13 Dec 2007 19:46:33 -0000      1.12
+++ cygnal/http.cpp     13 Dec 2007 21:20:29 -0000      1.13
@@ -102,6 +102,7 @@
         log_error (_("Couldn't read initial GET Request"));
     }
     
+    clearHeader();
     extractAccept(buffer);
     extractMethod(buffer);
     extractReferer(buffer);
@@ -130,7 +131,7 @@
 {
     GNASH_REPORT_FUNCTION;
 
-    formatHeader(0, type);
+    formatHeader(_filesize, type);
 }
 
 
@@ -140,7 +141,7 @@
     GNASH_REPORT_FUNCTION;
 
     _header << "HTTP/1.1 200 OK" << endl;
-//    _header << "Server: Cygnal/0.8.1 (Linux)" << endl;
+    this->formatServer();
     this->formatDate();
     this->formatConnection("close");
 //     _header << "Accept-Ranges: bytes" << endl;
@@ -335,7 +336,7 @@
 {
     GNASH_REPORT_FUNCTION;
     
-    formatHeader(_filesize, RTMP);
+    formatHeader(_filesize, HTML);
     int ret = writeNet(_header.str().c_str(), _header.str().size());
     if ( _body.str().size() > 0) {
        ret += writeNet(_body.str().c_str(), _body.str().size());
@@ -747,7 +748,7 @@
 // Get the file type, so we know how to set the
 // Content-type in the header.
 HTTP::filetype_e
-HTTP::getFileType(std::string &filespec)
+HTTP::getFileStats(std::string &filespec)
 {
     GNASH_REPORT_FUNCTION;    
     bool try_again = true;
@@ -798,8 +799,7 @@
        } // end of stat()
     } // end of try_waiting
 
-    _filesize = st.st_mode;
-
+    _filesize = st.st_size;
     return _filetype;
 }
 

Index: cygnal/http.h
===================================================================
RCS file: /sources/gnash/gnash/cygnal/http.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- cygnal/http.h       13 Dec 2007 19:46:33 -0000      1.10
+++ cygnal/http.h       13 Dec 2007 21:20:29 -0000      1.11
@@ -173,7 +173,7 @@
     // Get the file type, so we know how to set the
     // Content-type in the header.
 //    filetype_e getFileType(std::string &filespec);
-    filetype_e getFileType(std::string &filespec);
+    filetype_e getFileStats(std::string &filespec);
     void dump();
 
     // These accessors are used mostly just for debugging.




reply via email to

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