[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/rtmp r9929: Merge warning and build fixes
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/rtmp r9929: Merge warning and build fixes from trunk. |
Date: |
Mon, 29 Dec 2008 17:05:34 +0100 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 9929
committer: Benjamin Wolsey <address@hidden>
branch nick: rtmp
timestamp: Mon 2008-12-29 17:05:34 +0100
message:
Merge warning and build fixes from trunk.
modified:
libnet/http.cpp
=== modified file 'libnet/http.cpp'
--- a/libnet/http.cpp 2008-12-25 22:27:51 +0000
+++ b/libnet/http.cpp 2008-12-29 16:05:34 +0000
@@ -52,8 +52,12 @@
#include "diskstream.h"
#include "cache.h"
+// Not POSIX, so best not rely on it if possible.
+#ifndef PATH_MAX
+# define PATH_MAX 1024
+#endif
+
#if defined(_WIN32) || defined(WIN32)
-# define PATH_MAX 255
# define __PRETTY_FUNCTION__ __FUNCDNAME__
# include <winsock2.h>
# include <direct.h>
@@ -350,10 +354,11 @@
// cerr << "FIXME 2: " << hexify(content->reference(),
content->allocated(), true) << endl;
vector<boost::shared_ptr<amf::Element> > headers =
parseEchoRequest(*content);
- boost::shared_ptr<amf::Element> &el0 = headers[0];
- boost::shared_ptr<amf::Element> &el1 = headers[1];
- boost::shared_ptr<amf::Element> &el3 = headers[3];
- if (headers.size() >= 4) {
+ //boost::shared_ptr<amf::Element> &el0 = headers[0];
+ //boost::shared_ptr<amf::Element> &el1 = headers[1];
+ //boost::shared_ptr<amf::Element> &el3 = headers[3];
+
+ if (headers.size() >= 4) {
if (headers[3]) {
amf::Buffer &reply = formatEchoResponse(headers[1]->getName(),
*headers[3]);
// cerr << "FIXME 3: " << hexify(reply.reference(), reply.allocated(),
true) << endl;
@@ -1151,7 +1156,7 @@
{
// GNASH_REPORT_FUNCTION;
- boost::uint8_t *tmpptr = data;
+ //boost::uint8_t *tmpptr = data;
// FIXME: temporary hacks while debugging
amf::Buffer fixme("00 00 00 00 00 01");
@@ -1325,19 +1330,14 @@
cmd = HTTP::HTTP_DELETE;
}
- // For valid requests, the second argument, delimited by spaces is the
filespec
- // of the file being requested or transmitted.
+ // For valid requests, the second argument, delimited by spaces
+ // is the filespec of the file being requested or transmitted.
if (cmd != HTTP::HTTP_NONE) {
boost::uint8_t *start = std::find(data, data+7, ' ') + 1;
boost::uint8_t *end = std::find(start + 2, data+PATH_MAX, ' ');
- // FIXME: there has got to be a way to copy into a string that actually
works.
- char path[(end-start) + 1];
- memset(path, 0, (end-start) + 1);
- std::copy(start, end, path);
- _filespec = path;
-// _filespec.reserve((end - start));
-// std::fill(_filespec.begin(), _filespec.end(), 0);
-// std::copy(start, end, _filespec.begin());
+
+ // This is fine as long as end is within the buffer.
+ _filespec = std::string(start, end);
}
return cmd;
@@ -1425,7 +1425,9 @@
} else {
_que.push(buf);
}
- if (ret == buf->size()) {
+
+ // ret must be more than 0 here
+ if (static_cast<size_t>(ret) == buf->size()) {
continue;
}
} else {
@@ -1472,7 +1474,6 @@
// GNASH_REPORT_FUNCTION;
// struct thread_params thread_data;
string url, filespec, parameters;
- string::size_type pos;
HTTP *www = new HTTP;
bool result = false;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/rtmp r9929: Merge warning and build fixes from trunk.,
Benjamin Wolsey <=