gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/rtmp r9779: tweak the test for HTTP versio


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r9779: tweak the test for HTTP version numbers.
Date: Sun, 23 Nov 2008 21:18:09 -0700
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9779
committer: address@hidden
branch nick: rtmp
timestamp: Sun 2008-11-23 21:18:09 -0700
message:
  tweak the test for HTTP version numbers.
modified:
  libnet/http.h
  testsuite/libnet.all/test_http.cpp
=== modified file 'libnet/http.h'
--- a/libnet/http.h     2008-11-24 04:11:30 +0000
+++ b/libnet/http.h     2008-11-24 04:18:09 +0000
@@ -308,7 +308,7 @@
     std::string &getURL() { return _url; }
     std::map<int, struct status_codes *> getStatusCodes()
        { return _status_codes; }
-    http_version_t &getVersion() { return _version; }
+    http_version_t *getVersion() { return &_version; }
     std::string getMethod() { return _method; }
     std::string getReferer() { return _referer; }
     std::string getCommand() { return _command; }

=== modified file 'testsuite/libnet.all/test_http.cpp'
--- a/testsuite/libnet.all/test_http.cpp        2008-11-24 04:11:30 +0000
+++ b/testsuite/libnet.all/test_http.cpp        2008-11-24 04:18:09 +0000
@@ -346,9 +346,8 @@
 
     Network::byte_t *field1 = (Network::byte_t *)"GET /index.html HTTP/1.1";
     HTTP http1;
-    HTTP::http_version_t version = http1.getVersion();
     http1.extractMethod(field1);
-    if ((http1.keepAlive() == true) && (version.minor == 1)) {
+    if ((http1.keepAlive() == true) && (http1.getVersion()->minor == 1)) {
         runtest.pass ("HTTP::extractMethod(HTTP/1.1)");
     } else {
         runtest.fail ("HTTP::extractMethod(HTTP/1.1)");
@@ -356,9 +355,8 @@
 
     Network::byte_t *field2 = (Network::byte_t *)"GET /index.html HTTP/1.0";
     HTTP http2;
-    version = http2.getVersion();
     http2.extractMethod(field2);
-    if ((http2.keepAlive() == false) && (http2.getVersion().minor == 0)) {
+    if ((http2.keepAlive() == false) && (http2.getVersion()->minor == 0)) {
         runtest.pass ("HTTP::extractMethod(HTTP/1.0)");
     } else {
         runtest.fail ("HTTP::extractMethod(HTTP/1.0)");
@@ -536,7 +534,7 @@
     ptr1 += "Content-Type: application/x-amf\r\n";
     ptr1 += "\r\n";
     ptr1 += "foobar";
-    ptr1.resize();
+    ptr1.resize();              // shrink the buffer to be the exact size of 
the data
     
     amf::Buffer ptr2;
     ptr2 += "POST /echo/gateway HTTP/1.1\r\n";
@@ -552,7 +550,7 @@
     ptr2 += "Content-Type: application/x-amf\r\n";
     ptr2 += "\r\n";
     ptr2 += "foobar";
-    ptr2.resize();
+    ptr2.resize();              // shrink the buffer to be the exact size of 
the data
 
 #if 0
 2...........echo../2............ Hello.world!


reply via email to

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