diff options
author | krion <krion@FreeBSD.org> | 2004-07-17 11:09:20 +0000 |
---|---|---|
committer | krion <krion@FreeBSD.org> | 2004-07-17 11:09:20 +0000 |
commit | c9665b1c0b57ead6476e895469d9a271b097bdfd (patch) | |
tree | 5e22145eaa1aefec5b412ef6e887f4051dfed290 /net | |
parent | 290789bc7a0a3fddc78fc0285fe423a2e58e83c3 (diff) | |
download | FreeBSD-ports-c9665b1c0b57ead6476e895469d9a271b097bdfd.zip FreeBSD-ports-c9665b1c0b57ead6476e895469d9a271b097bdfd.tar.gz |
Fix build with gcc-3.4
Reported by: cluster via kris
Diffstat (limited to 'net')
-rw-r--r-- | net/bfilter/files/patch-main_bfilter.cpp | 14 | ||||
-rw-r--r-- | net/bfilter/files/patch-main_htmlprocessor.cpp | 57 | ||||
-rw-r--r-- | net/bfilter/files/patch-main_htmlprocessor.h | 22 | ||||
-rw-r--r-- | net/bfilter/files/patch-main_network.cpp | 23 | ||||
-rw-r--r-- | net/bfilter/files/patch-main_network.h | 23 | ||||
-rw-r--r-- | net/bfilter/files/patch-main_serverresponsestream.cpp | 22 | ||||
-rw-r--r-- | net/bfilter/files/patch-main_uri.cpp | 51 |
7 files changed, 212 insertions, 0 deletions
diff --git a/net/bfilter/files/patch-main_bfilter.cpp b/net/bfilter/files/patch-main_bfilter.cpp new file mode 100644 index 0000000..7725a5c --- /dev/null +++ b/net/bfilter/files/patch-main_bfilter.cpp @@ -0,0 +1,14 @@ + +$FreeBSD$ + +--- main/bfilter.cpp.orig Sat Jul 17 12:25:27 2004 ++++ main/bfilter.cpp Sat Jul 17 12:25:51 2004 +@@ -118,7 +118,7 @@ + int idle_timer = 0; + uint8_t recv_buf[8192]; + enum { IOV_ELEMENTS = 4 }; +- Network::iovec iov[IOV_ELEMENTS]; ++ Network::IoVec iov[IOV_ELEMENTS]; + + while (true) { + FD_ZERO(&rfds); diff --git a/net/bfilter/files/patch-main_htmlprocessor.cpp b/net/bfilter/files/patch-main_htmlprocessor.cpp new file mode 100644 index 0000000..af35faf --- /dev/null +++ b/net/bfilter/files/patch-main_htmlprocessor.cpp @@ -0,0 +1,57 @@ + +$FreeBSD$ + +--- main/htmlprocessor.cpp.orig Sat Jul 17 12:59:48 2004 ++++ main/htmlprocessor.cpp Sat Jul 17 13:00:53 2004 +@@ -61,6 +61,7 @@ + m_mapTags(parent.m_mapTags), + m_imgTagsUsingMap(parent.m_imgTagsUsingMap), + m_baseURL(parent.m_baseURL), ++ m_userAgent(parent.m_userAgent), + m_scriptsRule(parent.m_scriptsRule), + m_jsengineRule(parent.m_jsengineRule), + m_targetBlankRule(parent.m_targetBlankRule), +@@ -84,6 +85,12 @@ + } + + void ++HtmlProcessor::setUserAgent(const std::string& ua) ++{ ++ m_userAgent = ua; ++} ++ ++void + HtmlProcessor::consumeEOF() + { + HtmlLexer::consumeEOF(); +@@ -113,6 +120,7 @@ + std::string().swap(m_onload); + std::string().swap(m_onunload); + //m_baseURL = URI(""); ++ //m_userAgent = ""; + //m_scriptsRule = 0; + //m_jsengineRule = 0; + //m_targetBlankRule = 0; +@@ -821,7 +829,7 @@ + "too many redirects ("+StringUtils::fromNumber(i)+")"); + } + HttpRequest request("GET", url); +- request.headers().setHeader(HttpHeader("User-Agent", "Mozilla/5.0 (Windows; U; Win98; en-US) Netscape6/6.0")); ++ request.headers().setHeader(HttpHeader("User-Agent", m_userAgent)); + request.headers().setHeader(HttpHeader("Referrer", m_baseURL.toString())); + request.headers().setHeader(HttpHeader("Accept", "*" "/" "*")); + HttpResponse response = fetcher.request(request); +@@ -1173,11 +1181,13 @@ + if (node->hasAttribute("onmouseover")) { + if (checkCodeForPopups(node->getAttribute("onmouseover"))) { + node->setRawAttribute("onmouseover", "/* popup detected by BFilter */"); ++ modified = true; + } + } + if (node->hasAttribute("onmouseout")) { + if (checkCodeForPopups(node->getAttribute("onmouseout"))) { + node->setRawAttribute("onmouseout", "/* popup detected by BFilter */"); ++ modified = true; + } + } + return modified; diff --git a/net/bfilter/files/patch-main_htmlprocessor.h b/net/bfilter/files/patch-main_htmlprocessor.h new file mode 100644 index 0000000..0c3a41b --- /dev/null +++ b/net/bfilter/files/patch-main_htmlprocessor.h @@ -0,0 +1,22 @@ + +$FreeBSD$ + +--- main/htmlprocessor.h.orig Sat Jul 17 13:00:47 2004 ++++ main/htmlprocessor.h Sat Jul 17 13:00:53 2004 +@@ -49,6 +49,8 @@ + + void setBaseURL(const URI& url); + ++ void setUserAgent(const std::string& ua); ++ + using HtmlLexer::consumeDataChunk; + + void consumeEOF(); +@@ -305,6 +307,7 @@ + std::string m_curAttrName; + std::string m_closingTagName; + URI m_baseURL; ++ std::string m_userAgent; + int m_scriptsRule; + int m_jsengineRule; + int m_targetBlankRule; diff --git a/net/bfilter/files/patch-main_network.cpp b/net/bfilter/files/patch-main_network.cpp new file mode 100644 index 0000000..5a737d2 --- /dev/null +++ b/net/bfilter/files/patch-main_network.cpp @@ -0,0 +1,23 @@ + +$FreeBSD$ + +--- main/network.cpp.orig Sat Jul 17 12:32:36 2004 ++++ main/network.cpp Sat Jul 17 12:33:21 2004 +@@ -284,7 +284,7 @@ + } + + int +-Network::writev(int sock, const iovec* iov, int cnt) ++Network::writev(int sock, const IoVec* iov, int cnt) + { + #ifdef WIN32 + DWORD sent; +@@ -298,7 +298,7 @@ + return sent; + #else + int sent; +- SYSCALL(sent = ::writev(sock, iov, cnt)); ++ SYSCALL(sent = writev(sock, iov, cnt)); + return sent; + #endif + } diff --git a/net/bfilter/files/patch-main_network.h b/net/bfilter/files/patch-main_network.h new file mode 100644 index 0000000..20ed728 --- /dev/null +++ b/net/bfilter/files/patch-main_network.h @@ -0,0 +1,23 @@ + +$FreeBSD$ + +--- main/network.h.orig Sat Jul 17 12:33:38 2004 ++++ main/network.h Sat Jul 17 12:34:22 2004 +@@ -55,7 +55,7 @@ + #else + typedef int Socket; + static const Socket INVALID_SOCK = -1; +- typedef ::iovec iovec; ++ typedef iovec IoVec; + #endif + typedef std::list<in_addr> addr_list_type; + static addr_list_type resolve(const char *host, NetworkError *err=0); +@@ -64,7 +64,7 @@ + static Socket tcpConnect(const char *host, unsigned port, NetworkError* err=0); + static bool tcpSendData(Socket sock, const std::string& data, NetworkError* err=0); + static void sockSetNodelay(Socket sock, bool state); +- static int writev(int sock, const iovec* iov, int cnt); ++ static int writev(int sock, const IoVec* iov, int cnt); + static void closeSocket(Socket sock); + static void disconnectAndCloseSocket(Socket sock, int timeout); + static bool isValidSocket(Socket sock); diff --git a/net/bfilter/files/patch-main_serverresponsestream.cpp b/net/bfilter/files/patch-main_serverresponsestream.cpp new file mode 100644 index 0000000..595eb7f --- /dev/null +++ b/net/bfilter/files/patch-main_serverresponsestream.cpp @@ -0,0 +1,22 @@ + +$FreeBSD$ + +--- main/serverresponsestream.cpp.orig Sat Jul 17 12:34:53 2004 ++++ main/serverresponsestream.cpp Sat Jul 17 12:37:13 2004 +@@ -291,9 +291,14 @@ + AbstractResponseFilter* + ServerResponseStream::tryHtmlFilter(HttpResponseMetadata* metadata) + { +- m_pOwner->htmlProcessor()->setBaseURL(m_ptrActiveRequest->getOrigMetadata().requestLine().getURI()); ++ m_pOwner->htmlProcessor()->setBaseURL( ++ m_ptrActiveRequest->getOrigMetadata().requestLine().getURI() ++ ); ++ m_pOwner->htmlProcessor()->setUserAgent( ++ m_ptrActiveRequest->getOrigMetadata().headers().getHeader("User-Agent").getValue() ); + return HtmlResponseFilter::create( +- m_ptrFilterChain->getNextFilterProvider(), metadata, m_pOwner->htmlProcessor()); ++ m_ptrFilterChain->getNextFilterProvider(), metadata, m_pOwner->htmlProcessor() ++ ); + } + + AbstractResponseFilter* diff --git a/net/bfilter/files/patch-main_uri.cpp b/net/bfilter/files/patch-main_uri.cpp new file mode 100644 index 0000000..3bb525e --- /dev/null +++ b/net/bfilter/files/patch-main_uri.cpp @@ -0,0 +1,51 @@ + +$FreeBSD$ + +--- main/uri.cpp.orig Sat Jul 17 12:40:25 2004 ++++ main/uri.cpp Sat Jul 17 12:41:06 2004 +@@ -122,29 +122,29 @@ + m_is_relative_path = false; + std::string::size_type pos = base.m_raw_path.rfind('/'); + if (pos == std::string::npos) { +- m_raw_path = relative.m_raw_path; ++ //m_raw_path = ""; + } else { + m_raw_path = base.m_raw_path.substr(0, pos+1); + // pos+1 is for including the trailing slash +- std::string rel_path = relative.m_raw_path; +- while (true) { +- if (rel_path.substr(0, 2) == "./") { +- rel_path.erase(0, 2); +- } else if (rel_path.substr(0, 3) == "../") { +- rel_path.erase(0, 3); +- std::string::size_type pos1 = m_raw_path.rfind('/', m_raw_path.length()-2); +- // length()-2 is needed to skip the trailing slash +- if (pos1 == std::string::npos) { +- m_raw_path.erase(); +- } else { +- m_raw_path.erase(pos1+1); +- } ++ } ++ std::string rel_path = relative.m_raw_path; ++ while (true) { ++ if (rel_path.substr(0, 2) == "./") { ++ rel_path.erase(0, 2); ++ } else if (rel_path.substr(0, 3) == "../") { ++ rel_path.erase(0, 3); ++ std::string::size_type pos1 = m_raw_path.rfind('/', m_raw_path.length()-2); ++ // length()-2 is needed to skip the trailing slash ++ if (pos1 == std::string::npos) { ++ m_raw_path.erase(); + } else { +- break; ++ m_raw_path.erase(pos1+1); + } ++ } else { ++ break; + } +- m_raw_path += rel_path; + } ++ m_raw_path += rel_path; + } + m_has_query = relative.m_has_query; + m_raw_query = relative.m_raw_query; |