Changeset 167
- Timestamp:
- 07/04/08 14:36:58 (5 months ago)
- Location:
- Mulberry/branches/v4.1d1/Sources_Common/Mail/URLs
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
Mulberry/branches/v4.1d1/Sources_Common/Mail/URLs/CURL.cp
r86 r167 209 209 // Look for server 210 210 const char* p = ::strchr(temp.c_str(), '/'); 211 cdstring host; 211 212 if (p == NULL) 212 mServer = temp; 213 { 214 host = temp; 215 } 213 216 else 214 217 { … … 216 219 if (punt_size != 0) 217 220 { 218 mServer.assign(temp, 0, punt_size);221 host.assign(temp, 0, punt_size); 219 222 temp.erase(0, punt_size); 220 223 } … … 224 227 mPath.DecodeURL(); 225 228 } 229 230 // Now decode user:password@server 231 p = ::strchr(host.c_str(), '@'); 232 cdstring userpswd; 233 if (p == NULL) 234 { 235 mServer = host; 236 } 237 else 238 { 239 punt_size = p - host.c_str(); 240 if (punt_size != 0) 241 { 242 userpswd.assign(host, 0, punt_size); 243 host.erase(0, punt_size+1); 244 } 245 mServer = host; 246 247 p = ::strchr(userpswd.c_str(), ':'); 248 if (p == NULL) 249 { 250 mUser = userpswd; 251 } 252 else 253 { 254 punt_size = p - userpswd.c_str(); 255 if (punt_size != 0) 256 { 257 mUser.assign(userpswd, 0, punt_size); 258 userpswd.erase(0, punt_size+1); 259 } 260 261 mPassword = userpswd; 262 } 263 } 226 264 break; 227 265 } … … 251 289 { 252 290 result += mScheme; 291 switch(mSchemeType) 292 { 293 case eHTTP: 294 case eHTTPS: 295 case eWebcal: 296 { 297 if (!mUser.empty()) 298 { 299 result += mUser; 300 if (!mPassword.empty()) 301 { 302 result += ":"; 303 result += mPassword; 304 } 305 result += "@"; 306 } 307 } 308 default:; 309 } 253 310 result += mServer; 254 311 } … … 276 333 // Compare each component 277 334 if (mScheme.compare(comp.mScheme, true) != 0) 335 return false; 336 337 if (mUser.compare(comp.mUser, true) != 0) 338 return false; 339 340 if (mPassword.compare(comp.mPassword, true) != 0) 278 341 return false; 279 342 -
Mulberry/branches/v4.1d1/Sources_Common/Mail/URLs/CURL.h
r19 r167 109 109 } 110 110 111 const cdstring& User() const 112 { 113 return mUser; 114 } 115 116 const cdstring& Password() const 117 { 118 return mPassword; 119 } 120 111 121 const cdstring& Server() const 112 122 { … … 132 142 EScheme mSchemeType; 133 143 cdstring mScheme; 144 cdstring mUser; 145 cdstring mPassword; 134 146 cdstring mServer; 135 147 cdstring mPath;