]>
Commit | Line | Data |
---|---|---|
82427167 | 1 | cvs -f log -N -r1.551.2.9 http.cc |
2 | ||
3 | RCS file: /home/kde/kdelibs/kioslave/http/http.cc,v | |
4 | Working file: http.cc | |
5 | head: 1.565 | |
6 | branch: | |
7 | locks: strict | |
8 | access list: | |
9 | keyword substitution: kv | |
10 | total revisions: 632; selected revisions: 1 | |
11 | description: | |
12 | ---------------------------- | |
13 | revision 1.551.2.9 | |
14 | date: 2003/03/17 14:20:31; author: waba; state: Exp; lines: +112 -112 | |
15 | CCMAIL: 55571-done@bugs.kde.org | |
16 | Fix Bug 55571: https authentication through proxy fails | |
17 | ||
18 | (This patch basically reverts r1.546 and r1.544) | |
19 | m_bNeedTunnel was incorrectly used to check whether we were busy connecting | |
20 | to a proxy or sending the actual request. Moved some code around so that it | |
21 | only gets executed when sending the actual request so that it isn't necassery | |
22 | any more to abuse m_bNeedTunnel for this. | |
23 | ||
24 | The resetting of m_bNeedTunnel caused bug 55571, it isn't necassery to reset | |
25 | it, the resetting was a poor attempt to let m_bNeedTunnel serve as a status | |
26 | indicator for something it wasn't intended to indicate. | |
27 | ============================================================================= | |
28 | cvs -f diff -kk -bp -u -r1.551.2.8 -r1.551.2.9 http.cc | |
29 | Index: http.cc | |
30 | =================================================================== | |
31 | RCS file: /home/kde/kdelibs/kioslave/http/http.cc,v | |
32 | retrieving revision 1.551.2.8 | |
33 | retrieving revision 1.551.2.9 | |
34 | diff -b -p -u -r1.551.2.8 -r1.551.2.9 | |
35 | --- kdelibs/kioslave/http/http.cc~ 14 Feb 2003 19:50:53 -0000 1.551.2.8 | |
36 | +++ kdelibs/kioslave/http/http.cc 17 Mar 2003 14:20:31 -0000 1.551.2.9 | |
37 | @@ -438,7 +438,6 @@ bool HTTPProtocol::retrieveHeader( bool | |
38 | kdDebug(7113) << "(" << m_pid << ") Unset tunneling flag!" << endl; | |
39 | setEnableSSLTunnel( false ); | |
40 | m_bIsTunneled = true; | |
41 | - m_bNeedTunnel = false; | |
42 | // Reset the CONNECT response code... | |
43 | m_responseCode = m_prevResponseCode; | |
44 | continue; | |
45 | @@ -1936,7 +1935,42 @@ bool HTTPProtocol::httpOpen() | |
46 | // Check the validity of the current connection, if one exists. | |
47 | httpCheckConnection(); | |
48 | ||
49 | - // Determine if this is a POST or GET method | |
50 | + | |
51 | + if ( !m_bIsTunneled && m_bNeedTunnel ) | |
52 | + { | |
53 | + setEnableSSLTunnel( true ); | |
54 | + // We send a HTTP 1.0 header since some proxies refuse HTTP 1.1 and we don't | |
55 | + // need any HTTP 1.1 capabilities for CONNECT - Waba | |
56 | + header = QString("CONNECT %1:%2 HTTP/1.0" | |
57 | + "\r\n").arg( m_request.hostname).arg(m_request.port); | |
58 | + | |
59 | + // Identify who you are to the proxy server! | |
60 | + if (!m_request.userAgent.isEmpty()) | |
61 | + header += "User-Agent: " + m_request.userAgent + "\r\n"; | |
62 | + | |
63 | + /* Add hostname information */ | |
64 | + header += "Host: "; | |
65 | + if (m_state.hostname.find(':') != -1) | |
66 | + { | |
67 | + // This is an IPv6 (not hostname) | |
68 | + header += '['; | |
69 | + header += m_state.hostname; | |
70 | + header += ']'; | |
71 | + } | |
72 | + else | |
73 | + { | |
74 | + header += m_state.hostname; | |
75 | + } | |
76 | + | |
77 | + if (m_state.port != m_iDefaultPort) | |
78 | + header += QString(":%1").arg(m_state.port); | |
79 | + header += "\r\n"; | |
80 | + | |
81 | + header += proxyAuthenticationHeader(); | |
82 | + } | |
83 | + else | |
84 | + { | |
85 | + // Determine the kind of method we are handling... | |
86 | switch (m_request.method) | |
87 | { | |
88 | case HTTP_GET: | |
89 | @@ -1944,12 +1978,12 @@ bool HTTPProtocol::httpOpen() | |
90 | break; | |
91 | case HTTP_PUT: | |
92 | header = "PUT "; | |
93 | - moreData = !m_bNeedTunnel; | |
94 | + moreData = true; | |
95 | m_request.bCachedWrite = false; // Do not put any result in the cache | |
96 | break; | |
97 | case HTTP_POST: | |
98 | header = "POST "; | |
99 | - moreData = !m_bNeedTunnel; | |
100 | + moreData = true; | |
101 | m_request.bCachedWrite = false; // Do not put any result in the cache | |
102 | break; | |
103 | case HTTP_HEAD: | |
104 | @@ -2033,40 +2067,6 @@ bool HTTPProtocol::httpOpen() | |
105 | return false; | |
106 | } | |
107 | ||
108 | - if ( !m_bIsTunneled && m_bNeedTunnel ) | |
109 | - { | |
110 | - setEnableSSLTunnel( true ); | |
111 | - // We send a HTTP 1.0 header since some proxies refuse HTTP 1.1 and we don't | |
112 | - // need any HTTP 1.1 capabilities for CONNECT - Waba | |
113 | - header = QString("CONNECT %1:%2 HTTP/1.0" | |
114 | - "\r\n").arg( m_request.hostname).arg(m_request.port); | |
115 | - | |
116 | - // Identify who you are to the proxy server! | |
117 | - if (!m_request.userAgent.isEmpty()) | |
118 | - header += "User-Agent: " + m_request.userAgent + "\r\n"; | |
119 | - | |
120 | - /* Add hostname information */ | |
121 | - header += "Host: "; | |
122 | - if (m_state.hostname.find(':') != -1) | |
123 | - { | |
124 | - // This is an IPv6 (not hostname) | |
125 | - header += '['; | |
126 | - header += m_state.hostname; | |
127 | - header += ']'; | |
128 | - } | |
129 | - else | |
130 | - { | |
131 | - header += m_state.hostname; | |
132 | - } | |
133 | - | |
134 | - if (m_state.port != m_iDefaultPort) | |
135 | - header += QString(":%1").arg(m_state.port); | |
136 | - header += "\r\n"; | |
137 | - | |
138 | - header += proxyAuthenticationHeader(); | |
139 | - } | |
140 | - else | |
141 | - { | |
142 | // format the URI | |
143 | if (m_state.doProxy && !m_bIsTunneled) | |
144 | { | |
145 | @@ -2271,7 +2271,6 @@ bool HTTPProtocol::httpOpen() | |
146 | // Do we need to authorize to the proxy server ? | |
147 | if ( m_state.doProxy && !m_bIsTunneled ) | |
148 | header += proxyAuthenticationHeader(); | |
149 | - } | |
150 | ||
151 | if ( m_protocol == "webdav" || m_protocol == "webdavs" ) | |
152 | { | |
153 | @@ -2289,6 +2288,7 @@ bool HTTPProtocol::httpOpen() | |
154 | // add extra header elements for WebDAV | |
155 | if ( !davHeader.isNull() ) | |
156 | header += davHeader; | |
157 | + } | |
158 | } | |
159 | ||
160 | kdDebug(7103) << "(" << m_pid << ") ============ Sending Header:" << endl; |