Граф коммитов

250 Коммитов

Автор SHA1 Сообщение Дата
tbogard%aol.net c8c8eea4c0 XPCOM Cleanup: Fixed Aggregation macros in nsAgg.h to do aggregation correctly. Fixed usages and implementation of aggregation using these macros through out the tree. 1999-08-19 05:36:30 +00:00
leaf%mozilla.org 59839a7409 backing out dougt 1999-08-19 02:35:39 +00:00
dougt%netscape.com f18b0e74f6 Adding thread proxy support to Net Module Notification.
General cleanup
1999-08-18 09:32:26 +00:00
gagan%netscape.com cb66e1d8ad backslashes in ..\.. cases fixed. Thanks bratell@lysator.liu.se 1999-08-13 05:20:45 +00:00
warren%netscape.com 8439e8f8ec Fix for bug 7682: StringBundle can't load URLs from imap thread. 1999-08-13 00:43:48 +00:00
gagan%netscape.com 67455042ca Fixed bunch of M9 bugs for Necko. 1999-08-12 09:59:24 +00:00
valeski%netscape.com 7f056f0c0d added user agent language setter routine 1999-08-10 18:33:27 +00:00
rpotts%netscape.com c441f1624b Implement nsIRequest::Cancel() for the SocketTransport. 1999-08-09 07:05:15 +00:00
morse%netscape.com 05534f19dd cleaned up dialogs 1999-08-06 00:29:10 +00:00
rpotts%netscape.com c99f3b9d7a bug #10739. Reworking header APIs... I've removed nsIHeader.h. 1999-08-05 08:28:49 +00:00
mscott%netscape.com fc725eefbf bulletproof some NS_RELEASE's with NS_IF_RELEASE. 1999-08-04 21:23:26 +00:00
valeski%netscape.com 67e54f0298 nsNetModRegEntry.cpp - fixed mem leak. nsStdURL.cpp - fixed port parsing bug 1999-08-04 21:20:48 +00:00
warren%netscape.com 72c37924c2 Removed hack to export to netwerk/dist (used before landing necko). 1999-08-03 00:38:25 +00:00
warren%netscape.com aaa89f95e0 Removed nsCOMPtr breakage. 1999-07-31 07:30:49 +00:00
warren%netscape.com 10e252654f Added GetLoadGroup/SetLoadGroup to nsIChannel so that redirects can discover the group. 1999-07-31 06:53:12 +00:00
warren%netscape.com 417a407ee5 Lots of cool logging code. 1999-07-31 06:28:31 +00:00
gagan%netscape.com c18005e5cd Fix MLK. Freeing up previous versions of mPath/mScheme 1999-07-31 00:15:49 +00:00
warren%netscape.com bba02d9418 Added NS_ERROR_UNKNOWN_PROTOCOL, and changed dns error to NS_ERROR_UNKNOWN_HOST. 1999-07-30 04:17:23 +00:00
valeski%netscape.com c97fba8802 crahser fix 10843 - bad host name was crashing the socket transport in error state 1999-07-30 02:36:52 +00:00
bruce%cybersight.com 86093c8161 Build fix for aCC on HP-UX. Approved by leaf. 1999-07-29 04:21:42 +00:00
mscott%netscape.com a514d6dfd1 fix build breakage by including config.mak 1999-07-29 02:47:16 +00:00
mscott%netscape.com ef2578dab6 Fix build breakage...include config.mak 1999-07-29 02:35:45 +00:00
rpotts%netscape.com 0749fbf78c Close the socket if an error occurred... 1999-07-28 11:08:18 +00:00
rpotts%netscape.com 3147e21651 Changed OnStopRequest(...) to always file - regardless of the mStatus. This insures that the consumer will *always* receive an OnStopRequest(...) notification. 1999-07-28 11:07:39 +00:00
warren%netscape.com 5c61055a2b Fixed mismatched delete problem (purify). 1999-07-28 04:05:10 +00:00
gagan%netscape.com 089b1a8da9 More URL parsing updates for not so common cases. 1999-07-28 02:13:07 +00:00
gagan%netscape.com 8a17f9d60b Fixed the URL parsing for http://foo:80 1999-07-27 21:28:05 +00:00
valeski%netscape.com 3b47bd5edf fixing mem leak 1999-07-27 21:12:50 +00:00
rpotts%netscape.com 516aa68268 Added a temporary new define called USE_POLLABLE_EVENT which windows and unix both define... On the Mac, rather than using NSPR pollable events, a small timeout is set for PR_Poll(...) and new entry processing occurs after a timeout :-( 1999-07-27 09:21:07 +00:00
warren%netscape.com cf64533de5 Fixed tab-width 1999-07-27 08:46:27 +00:00
warren%netscape.com 5cdf76ac2e Added logging. 1999-07-27 08:45:35 +00:00
warren%netscape.com 27519b34c4 Fixed NewURI to not pass base URI when spec is absolute. 1999-07-27 08:45:20 +00:00
gagan%netscape.com 55879e3f5c -Fixed parsing to handle the mscott cases of-
mailbox://foo:25/user@netscape.com
	pop3://foo:110?check
-Fixed missing directory situations. (thanks Andreas)
-Removed the temporary hack for converting from ToNewCString to nsCRT::free'able
type. This removes the FMM errors on Bruce's log. No more mismatched freeing.


? diffs
Index: nsStdURL.cpp
===================================================================
RCS file: /cvsroot/mozilla/netwerk/base/src/nsStdURL.cpp,v
retrieving revision 1.5
diff -r1.5 nsStdURL.cpp
147,150c147
<     {
< 		//TODO
<         return NS_ERROR_FAILURE; // this should really be NS_ERROR_URL_PARSING
<     }
---
>         return NS_ERROR_MALFORMED_URI;
154c151
<     static const char delimiters[] = "/:@"; //this order is optimized.
---
>     static const char delimiters[] = "/:@?"; //this order is optimized.
157,493c154
<     if (brk)
<     {
<         switch (*brk)
<         {
<         case '/' :
<             // If the URL starts with a slash then everything is a path
<             if (brk == mSpec)
<             {
< 				ExtractString(mSpec, &mPath, 0, len);
<                 return NS_OK;
<             }
<             else // The first part is host, so its host/path
<             {
<                 ExtractString(mSpec, &mHost, 0, (brk - mSpec));
<                 ExtractString(mSpec, &mPath, (brk - mSpec), (len - (brk - mSpec)));
<                 return NS_OK;
<             }
<             break;
<         case ':' :
<             if (*(brk+1) == '/')
<             {
<                 ExtractString(mSpec, &mScheme, 0, (brk - mSpec));
<
<                 if (*(brk+2) == '/') // e.g. http://
<                 // If the first colon is followed by // then its definitely a spec
<                 {
<                     lastbrk = brk+3;
<                     brk = PL_strpbrk(lastbrk, delimiters);
<                     if (brk)
<                     {
<                         switch (*brk)
<                         {
<                             case '/' : // standard case- http://host/path
<                                 ExtractString(mSpec, &mHost,
< 								    (lastbrk - mSpec), (brk - lastbrk));
<                                 ExtractString(mSpec, &mPath,
< 								    (brk - mSpec), (len - (brk - mSpec)));
<                                 return NS_OK;
<                                 break;
<                             case ':' :
<                                 {
<                                     // It could be http://user:pass@host/path
< 								    // or http://host:port/path
<                                     // For the first case, there has to be an
< 								    // @ after this colon, so...
<                                     char* atSign = PL_strchr(brk, '@');
<                                     if (atSign)
<                                     {
<                                         ExtractString(mSpec, &mPreHost,
< 										    (lastbrk - mSpec), (atSign - lastbrk));
<                                         brk = PL_strpbrk(atSign+1, "/:");
<                                         if (brk) // http://user:pass@host:port/path or http://user:pass@host/path
<                                         {
<                                             ExtractString(mSpec, &mHost,
< 											    (atSign+1 - mSpec),
< 											    (brk - (atSign+1)));
<                                             if (*brk == '/')
<                                             {
<                                                 ExtractString(mSpec, &mPath,
< 												    (brk - mSpec),
< 												    len - (brk - mSpec));
<                                                 return NS_OK;
<                                             }
<                                             else // we have a port since (brk == ':')
<                                             {
<                                                 lastbrk = brk+1;
<                                                 brk = PL_strchr(lastbrk, '/');
<                                                 if (brk) // http://user:pass@host:port/path
<                                                 {
<                                                     mPort = ExtractPortFrom(mSpec, (lastbrk - mSpec), (brk-lastbrk));
<                                                     ExtractString(mSpec, &mPath, (brk-mSpec), len - (brk-mSpec));
<                                                     return NS_OK;
<                                                 }
<                                                 else // http://user:pass@host:port
<                                                 {
<                                                     mPort = ExtractPortFrom(mSpec, (lastbrk - mSpec), len - (lastbrk - mSpec));
<                                                     return NS_OK;
<                                                 }
<                                             }
<
<                                         }
<                                         else // its just http://user:pass@host
<                                         {
<                                             ExtractString(mSpec, &mHost,
< 											    (atSign+1 - mSpec),
< 											    len - (atSign+1 - mSpec));
<                                             return NS_OK;
<                                         }
<                                     }
<                                     else // definitely the port option, i.e. http://host:port/path
<                                     {
<                                         ExtractString(mSpec, &mHost,
< 										    (lastbrk-mSpec),
< 										    (brk-lastbrk));
<                                         lastbrk = brk+1;
<                                         brk = PL_strchr(lastbrk, '/');
<                                         if (brk)    // http://host:port/path
<                                         {
<                                             mPort = ExtractPortFrom(mSpec, (lastbrk-mSpec),(brk-lastbrk));
<                                             ExtractString(mSpec, &mPath,
< 											    (brk-mSpec),
< 											    len - (brk-mSpec));
<                                             return NS_OK;
<                                         }
<                                         else        // http://host:port
<                                         {
<                                             mPort = ExtractPortFrom(mSpec, (lastbrk-mSpec),len - (lastbrk-mSpec));
<                                             return NS_OK;
<                                         }
<                                     }
<                                 }
<                                 break;
<                             case '@' :
<                                 // http://user@host...
<                                 {
<                                     ExtractString(mSpec, &mPreHost,
< 									    (lastbrk-mSpec), (brk-lastbrk));
<                                     lastbrk = brk+1;
<                                     brk = PL_strpbrk(lastbrk, ":/");
<                                     if (brk)
<                                     {
<                                         ExtractString(mSpec, &mHost,
< 										    (lastbrk-mSpec), (brk - lastbrk));
<                                         if (*brk == ':') // http://user@host:port...
<                                         {
<                                             lastbrk = brk+1;
<                                             brk = PL_strchr(lastbrk, '/');
<                                             if (brk)    // http://user@host:port/path
<                                             {
<                                                 mPort = ExtractPortFrom(mSpec, (lastbrk-mSpec),(brk-lastbrk));
<                                                 ExtractString(mSpec, &mPath,
< 												    (brk-mSpec),
< 												    len - (brk-mSpec));
<                                                 return NS_OK;
<                                             }
<                                             else        // http://user@host:port
<                                             {
<                                                 mPort = ExtractPortFrom(mSpec, (lastbrk-mSpec),len - (lastbrk-mSpec));
<                                                 return NS_OK;
<                                             }
<
<                                         }
<                                         else // (*brk == '/') so no port just path i.e. http://user@host/path
<                                         {
<                                             ExtractString(mSpec, &mPath,
< 											    (brk - mSpec),
< 											    len - (brk - mSpec));
<                                             return NS_OK;
<                                         }
<                                     }
<                                     else // its just http://user@host
<                                     {
<                                         ExtractString(mSpec, &mHost,
< 										    (lastbrk+1 - mSpec), len - (lastbrk+1 - mSpec));
<                                         return NS_OK;
<                                     }
<
<                                 }
<                                 break;
<                             default: NS_POSTCONDITION(0, "This just can't be!");
<                                 break;
<                         }
<
<                     }
<                     else // everything else is a host, as in http://host
<                     {
<                         ExtractString(mSpec, &mHost,
< 						    (lastbrk - mSpec),
< 						    len - (lastbrk - mSpec));
<                         return NS_OK;
<                     }
<
<                 }
<                 else // This is a no // path alone case like file:/path, there is never a prehost/host in this case.
<                 {
<                     ExtractString(mSpec, &mPath, (brk-mSpec+1), len - (brk-mSpec+1));
<                     return NS_OK;
<                 }
<             }
<             else // scheme:host or host:port...
<             {
<                 lastbrk = brk+1;
<
<                 if ((*lastbrk >= '0') && (*lastbrk <= '9')) //host:port...
<                 {
<                     ExtractString(mSpec, &mHost, 0, (brk - mSpec));
<                     brk = PL_strpbrk(lastbrk, delimiters);
<                     if (brk)
<                     {
<                         switch (*brk)
<                         {
<                             case '/' : // The path, so its host:port/path
<                                 mPort = ExtractPortFrom(mSpec, lastbrk-mSpec, brk-lastbrk);
<                                 ExtractString(mSpec, &mPath, brk- mSpec, len - (brk-mSpec));
<                                 return NS_OK;
<                                 break;
<                             case ':' :
<                                 return NS_ERROR_FAILURE;//TODO NS_ERROR_URL_PARSING;
<                                 break;
<                             case '@' :
<                                 // This is a special case of user:pass@host... so
<                                 // Cleanout our earliar knowledge of host
<                                 ExtractString(mSpec, &mHost, -1, -1);
<
<                                 ExtractString(mSpec, &mPreHost, 0, (brk-mSpec));
<                                 lastbrk = brk+1;
<                                 brk = PL_strpbrk(lastbrk, ":/");
<                                 if (brk)
<                                 {
<                                     ExtractString(mSpec, &mHost,
< 									    (lastbrk-mSpec), (brk-lastbrk));
<                                     if (*brk == ':') // user:pass@host:port...
<                                     {
<                                         lastbrk = brk+1;
<                                         brk = PL_strchr(lastbrk, '/');
<                                         if (brk)    // user:pass@host:port/path
<                                         {
<                                             mPort = ExtractPortFrom(mSpec, (lastbrk-mSpec),(brk-lastbrk));
<                                             ExtractString(mSpec, &mPath,
< 											    (brk-mSpec), len - (brk-mSpec));
<                                             return NS_OK;
<                                         }
<                                         else        // user:pass@host:port
<                                         {
<                                             mPort = ExtractPortFrom(mSpec, (lastbrk-mSpec),len - (lastbrk-mSpec));
<                                             return NS_OK;
<                                         }
<                                     }
<                                     else // (*brk == '/') so user:pass@host/path
<                                     {
<                                         ExtractString(mSpec, &mPath, (brk - mSpec), len - (brk - mSpec));
<                                         return NS_OK;
<                                     }
<                                 }
<                                 else // its user:pass@host so everthing else is just the host
<                                 {
<                                     ExtractString(mSpec, &mHost,
< 									    (lastbrk-mSpec), len - (lastbrk-mSpec));
<                                     return NS_OK;
<                                 }
<
<                                 break;
<                             default: NS_POSTCONDITION(0, "This just can't be!");
<                                 break;
<                         }
<                     }
<                     else // Everything else is just the port
<                     {
<                         mPort = ExtractPortFrom(mSpec, lastbrk-mSpec, len - (lastbrk-mSpec));
<                         return NS_OK;
<                     }
<                 }
<                 else // scheme:host...
<                 {
<                     ExtractString(mSpec, &mScheme, 0, (brk - mSpec));
<                     brk = PL_strpbrk(lastbrk, delimiters);
<                     if (brk)
<                     {
<                         switch (*brk)
<                         {
<                             case '/' : // The path, so its scheme:host/path
<                                 ExtractString(mSpec, &mHost, (lastbrk-mSpec), (brk-lastbrk));
<                                 ExtractString(mSpec, &mPath, (brk - mSpec), len - (brk - mSpec));
<                                 return NS_OK;
<                                 break;
<                             case '@' : // scheme:user@host...
<                                 ExtractString(mSpec, &mPreHost, (lastbrk-mSpec), (brk-lastbrk));
<                                 // TODO more here...
<                                 break;
<                             case ':' : // scheme:user:pass@host... or scheme:host:port...
<                                 /* TODO
<                                 if you find @ in the remaining string then // scheme:user:pass@host...
<                                 {
<
<
<                                 }
<                                 else // scheme:host:port
<                                 {
<                                     ExtractString(mSpec, &mHost, (lastbrk-mSpec), (brk-lastbrk));
<
<                                 }
<                                 */
<                                 break;
<                             default: NS_POSTCONDITION(0, "This just can't be!");
<                                 break;
<                         }
<                     }
<                     else // its just scheme:host
<                     {
<                         ExtractString(mSpec, &mHost, (lastbrk-mSpec), len - (lastbrk-mSpec));
<                         return NS_OK;
<                     }
<                 }
<             }
<             break;
<         case '@' :
<             //Everything before the @ is the prehost stuff
<             ExtractString(mSpec, &mPreHost, 0, brk-mSpec);
<             lastbrk = brk+1;
<             brk = PL_strpbrk(lastbrk, ":/");
<             if (brk)
<             {
<                 ExtractString(mSpec, &mHost, (lastbrk-mSpec), (brk-lastbrk));
<                 if (*brk == ':') // user@host:port...
<                 {
<                     lastbrk = brk+1;
<                     brk = PL_strchr(lastbrk, '/');
<                     if (brk)    // user@host:port/path
<                     {
<                         mPort = ExtractPortFrom(mSpec, (lastbrk-mSpec),(brk-lastbrk));
<                         ExtractString(mSpec, &mPath, (brk-mSpec), len - (brk-mSpec));
<                         return NS_OK;
<                     }
<                     else        // user@host:port
<                     {
<                         mPort = ExtractPortFrom(mSpec, (lastbrk-mSpec),len - (lastbrk-mSpec));
<                         return NS_OK;
<                     }
<                 }
<                 else // (*brk == '/') so user@host/path
<                 {
<                     ExtractString(mSpec, &mPath, (brk - mSpec), len - (brk - mSpec));
<                     return NS_OK;
<                 }
<             }
<             else // its user@host so everything else is just the host
<             {
<                 ExtractString(mSpec, &mHost, (lastbrk-mSpec), (len - (lastbrk-mSpec)));
<                 return NS_OK;
<             }
<             break;
<         default:
<             NS_ASSERTION(0, "This just can't be!");
<             break;
<         }
<     }
<     else // everything is a host
---
>     if (!brk) // everything is a host
495a157
> 		return NS_OK;
496a159,501
> 	switch (*brk)
> 	{
> 	case '/' :
> 	case '?' :
> 		// If the URL starts with a slash then everything is a path
> 		if (brk == mSpec)
> 		{
> 			ExtractString(mSpec, &mPath, 0, len);
> 			return NS_OK;
> 		}
> 		else // The first part is host, so its host/path
> 		{
> 			ExtractString(mSpec, &mHost, 0, (brk - mSpec));
> 			ExtractString(mSpec, &mPath, (brk - mSpec), (len - (brk - mSpec)));
> 			return NS_OK;
> 		}
> 		break;
> 	case ':' :
> 		if (*(brk+1) == '/')
> 		{
> 			ExtractString(mSpec, &mScheme, 0, (brk - mSpec));
>
> 			if (*(brk+2) == '/') // e.g. http://
> 			// If the first colon is followed by // then its definitely a spec
> 			{
> 				lastbrk = brk+3;
> 				brk = PL_strpbrk(lastbrk, delimiters);
> 				if (!brk) // everything else is a host, as in http://host
> 				{
> 					ExtractString(mSpec, &mHost,
> 						(lastbrk - mSpec),
> 						len - (lastbrk - mSpec));
> 					return NS_OK;
> 				}
> 				switch (*brk)
> 				{
> 					case '/' : // standard case- http://host/path
> 					case '?' : // missing path cases
> 						ExtractString(mSpec, &mHost,
> 							(lastbrk - mSpec), (brk - lastbrk));
> 						ExtractString(mSpec, &mPath,
> 							(brk - mSpec), (len - (brk - mSpec)));
> 						return NS_OK;
> 						break;
> 					case ':' : // http://user:... or http://host:...
> 					{
> // It could be http://user:pass@host/path
> // or http://host:port/path we find that by checking further...
> char* nextbrk = PL_strpbrk(brk+1, delimiters);
> if (!nextbrk) // http://host:port
> {
> 	ExtractString(mSpec, &mHost,
> 		(lastbrk-mSpec), (brk-lastbrk));
> 	mPort = ExtractPortFrom(mSpec,
> 		(lastbrk-mSpec), len - (lastbrk-mSpec));
> 	return NS_OK;
> }
> switch (*nextbrk)
> {
> 	case '/': // http://host:port/path
> 	case '?': // http://host:port?path
> 		ExtractString(mSpec, &mHost,
> 			(lastbrk-mSpec), (brk-lastbrk));
> 		mPort = ExtractPortFrom(mSpec, (brk-mSpec+1),(nextbrk-brk-1));
> 		ExtractString(mSpec, &mPath,
> 				(nextbrk-mSpec), len - (nextbrk-mSpec));
> 		return NS_OK;
> 		break;
> 	case '@': // http://user:pass@host...
> 		ExtractString(mSpec, &mPreHost,
> 			(lastbrk - mSpec), (nextbrk - lastbrk));
> 		brk = PL_strpbrk(nextbrk+1, delimiters);
> 		if (!brk) // its just http://user:pass@host
> 		{
> 			ExtractString(mSpec, &mHost,
> 				(nextbrk+1 - mSpec),
> 				len - (nextbrk+1 - mSpec));
> 			return NS_OK;
> 		}
>
> 		ExtractString(mSpec, &mHost,
> 			(nextbrk+1 - mSpec), brk - (nextbrk+1));
>
> 		switch (*brk)
> 		{
> 		case '/': // http://user:pass@host/path
> 		case '?':
> 			ExtractString(mSpec, &mPath,
> 				(nextbrk+1 - mSpec),
> 				len - (nextbrk+1 - mSpec));
> 			return NS_OK;
> 			break;
> 		case ':': // http://user:pass@host:port...
> 			lastbrk = brk;
> 			brk = PL_strpbrk(lastbrk+1, "/?");
> 			if (brk)    // http://user:pass@host:port/path
> 			{
> 				mPort = ExtractPortFrom(mSpec, (lastbrk-mSpec),(brk-lastbrk));
> 				ExtractString(mSpec, &mPath, (brk-mSpec), len - (brk-mSpec));
> 				return NS_OK;
> 			}
> 			else        // http://user:pass@host:port
> 			{
> 				mPort = ExtractPortFrom(mSpec, (lastbrk-mSpec),
> 					len - (lastbrk-mSpec));
> 				return NS_OK;
> 			}
> 			break;
> 		default: NS_POSTCONDITION(0, "This just can't be!");
> 			break;
> 		}
> 		break;
> 	case ':': // three colons!
> 		return NS_ERROR_MALFORMED_URI;
> 		break;
> 	default: NS_POSTCONDITION(0, "This just can't be!");
> 		break;
> }
> 						}
> 						break;
> 					case '@' : // http://user@host...
> 						{
> 							ExtractString(mSpec, &mPreHost,
> 								(lastbrk-mSpec), (brk-lastbrk));
> 							lastbrk = brk+1;
> 							brk = PL_strpbrk(lastbrk, delimiters);
> 							if (!brk) // its just http://user@host
> 							{
> 								ExtractString(mSpec, &mHost,
> 									(lastbrk+1 - mSpec),
> 									len - (lastbrk+1 - mSpec));
> 								return NS_OK;
> 							}
> 							ExtractString(mSpec, &mHost,
> 								(lastbrk-mSpec), (brk - lastbrk));
> 							switch (*brk)
> 							{
> 								case ':' : // http://user@host:port...
> 									lastbrk = brk+1;
> 									brk = PL_strpbrk(lastbrk, "/?");
> 									if (brk)    // http://user@host:port/path
> 									{
> 										mPort = ExtractPortFrom(mSpec,
> 											(lastbrk-mSpec),(brk-lastbrk));
> 										ExtractString(mSpec, &mPath,
> 											(brk-mSpec),
> 											len - (brk-mSpec));
> 										return NS_OK;
> 									}
> 									else        // http://user@host:port
> 									{
> 										mPort = ExtractPortFrom(mSpec,
> 											(lastbrk-mSpec),
> 											len - (lastbrk-mSpec));
> 										return NS_OK;
> 									}
> 									break;
> 								case '/' : // http://user@host/path
> 								case '?' : // http://user@host?path
> 									ExtractString(mSpec, &mPath,
> 										(brk - mSpec),
> 										len - (brk - mSpec));
> 									return NS_OK;
> 									break;
> 								case '@' :
> 									return NS_ERROR_MALFORMED_URI;
> 								default : NS_POSTCONDITION(0,
> 									"This just can't be!");
> 									break;
> 							}
> 						}
> 						break;
> 					default: NS_POSTCONDITION(0, "This just can't be!");
> 						break;
> 				}
> 			}
> 			else // This is a no // path alone case like file:/path,
> 				// there is never a prehost/host in this case.
> 			{
> 				ExtractString(mSpec, &mPath, (brk-mSpec+1),
> 					len - (brk-mSpec+1));
> 				return NS_OK;
> 			}
> 		}
> 		else // scheme:host or host:port...
> 		{
> 			lastbrk = brk+1;
>
> 			if ((*lastbrk >= '0') && (*lastbrk <= '9')) //host:port...
> 			{
> 				ExtractString(mSpec, &mHost, 0, (brk - mSpec));
> 				brk = PL_strpbrk(lastbrk, delimiters);
> 				if (!brk) // Everything else is just the port
> 				{
> 					mPort = ExtractPortFrom(mSpec, lastbrk-mSpec,
> 						len - (lastbrk-mSpec));
> 					return NS_OK;
> 				}
> 				switch (*brk)
> 				{
> 					case '/' : // The path, so its host:port/path
> 					case '?' : // The path, so its host:port?path
> 						mPort = ExtractPortFrom(mSpec, lastbrk-mSpec,
> 							brk-lastbrk);
> 						ExtractString(mSpec, &mPath, brk- mSpec,
> 							len - (brk-mSpec));
> 						return NS_OK;
> 						break;
> 					case ':' :
> 						return NS_ERROR_MALFORMED_URI;
> 						break;
> 					case '@' :
> 						// This is a special case of user:pass@host... so
> 						// Cleanout our earliar knowledge of host
> 						ExtractString(mSpec, &mHost, -1, -1);
>
> 						ExtractString(mSpec, &mPreHost, 0, (brk-mSpec));
> 						lastbrk = brk+1;
> 						brk = PL_strpbrk(lastbrk, ":/");
> 					// its user:pass@host so everthing else is just the host
> 						if (!brk)
> 						{
> 							ExtractString(mSpec, &mHost,
> 								(lastbrk-mSpec), len - (lastbrk-mSpec));
> 							return NS_OK;
> 						}
> 						ExtractString(mSpec, &mHost,
> 							(lastbrk-mSpec), (brk-lastbrk));
> 						if (*brk == ':') // user:pass@host:port...
> 						{
> 							lastbrk = brk+1;
> 							brk = PL_strpbrk(lastbrk, "/?");
> 							if (brk)    // user:pass@host:port/path
> 							{
> 								mPort = ExtractPortFrom(mSpec,
> 									(lastbrk-mSpec),(brk-lastbrk));
> 								ExtractString(mSpec, &mPath,
> 									(brk-mSpec), len - (brk-mSpec));
> 								return NS_OK;
> 							}
> 							else        // user:pass@host:port
> 							{
> 								mPort = ExtractPortFrom(mSpec,
> 									(lastbrk-mSpec),len - (lastbrk-mSpec));
> 								return NS_OK;
> 							}
> 						}
> 						else // (*brk == '/') so user:pass@host/path
> 						{
> 							ExtractString(mSpec, &mPath, (brk - mSpec),
> 								len - (brk - mSpec));
> 							return NS_OK;
> 						}
> 						break;
> 					default: NS_POSTCONDITION(0, "This just can't be!");
> 						break;
> 				}
> 			}
> 			else // scheme:host...
> 			{
> 				ExtractString(mSpec, &mScheme, 0, (brk - mSpec));
> 				brk = PL_strpbrk(lastbrk, delimiters);
> 				if (!brk) // its just scheme:host
> 				{
> 					ExtractString(mSpec, &mHost, (lastbrk-mSpec),
> 						len - (lastbrk-mSpec));
> 					return NS_OK;
> 				}
> 				switch (*brk)
> 				{
> 					case '/' : // The path, so its scheme:host/path
> 					case '?' : // The path, so its scheme:host?path
> 						ExtractString(mSpec, &mHost, (lastbrk-mSpec),
> 							(brk-lastbrk));
> 						ExtractString(mSpec, &mPath, (brk - mSpec),
> 							len - (brk - mSpec));
> 						return NS_OK;
> 						break;
> 					case '@' : // scheme:user@host...
> 						ExtractString(mSpec, &mPreHost, (lastbrk-mSpec),
> 							(brk-lastbrk));
> 						// TODO more here...
> 						break;
> 					case ':' : // scheme:user:pass@host...or scheme:host:port...
> 						/* TODO
> 						if you find @ in the remaining string
> 						then // scheme:user:pass@host...
> 						{
>
>
> 						}
> 						else // scheme:host:port
> 						{
> 							ExtractString(mSpec, &mHost, (lastbrk-mSpec),
> 								(brk-lastbrk));
> 						}
> 						*/
> 						break;
> 					default: NS_POSTCONDITION(0, "This just can't be!");
> 						break;
> 				}
> 			}
> 		}
> 		break;
> 	case '@' :
> 		//Everything before the @ is the prehost stuff
> 		ExtractString(mSpec, &mPreHost, 0, brk-mSpec);
> 		lastbrk = brk+1;
> 		brk = PL_strpbrk(lastbrk, ":/");
> 		if (!brk) // its user@host so everything else is just the host
> 		{
> 			ExtractString(mSpec, &mHost, (lastbrk-mSpec),
> 				(len - (lastbrk-mSpec)));
> 			return NS_OK;
> 		}
> 		ExtractString(mSpec, &mHost, (lastbrk-mSpec), (brk-lastbrk));
> 		if (*brk == ':') // user@host:port...
> 		{
> 			lastbrk = brk+1;
> 			brk = PL_strpbrk(lastbrk, "/?");
> 			if (brk)    // user@host:port/path
> 			{
> 				mPort = ExtractPortFrom(mSpec, (lastbrk-mSpec),(brk-lastbrk));
> 				ExtractString(mSpec, &mPath, (brk-mSpec), len - (brk-mSpec));
> 				return NS_OK;
> 			}
> 			else        // user@host:port
> 			{
> 				mPort = ExtractPortFrom(mSpec, (lastbrk-mSpec),
> 					len - (lastbrk-mSpec));
> 				return NS_OK;
> 			}
> 		}
> 		else // (*brk == '/') so user@host/path
> 		{
> 			ExtractString(mSpec, &mPath, (brk - mSpec), len - (brk - mSpec));
> 			return NS_OK;
> 		}
> 		break;
> 	default:
> 		NS_ASSERTION(0, "This just can't be!");
> 		break;
> 	}
578,580c583
<     {
<         return NS_ERROR_OUT_OF_MEMORY;
<     }
---
>         return returnValue; // ERROR!
620,626c623
< 	// TODO- Fix this. Hack to create tmp only becuz nsString can't
< 	// give us a PR_Malloc (nsCRT/nsAllocator) string
< 	char* tmp = dir.ToNewCString();
< 	if (!tmp)
< 		return NS_ERROR_OUT_OF_MEMORY;
<     mDirectory = nsCRT::strdup(tmp);
< 	delete[] tmp;
---
>     mDirectory = dir.ToNewCString();
677d673
<     nsresult status = NS_ERROR_FAILURE;
782,783c778,782
<     NS_ASSERTION(file, "This can't be! ParsePath called without a /Path");
<     if (!file) return NS_OK;
---
>     if (!file)
> 	{
> 		// Treat the whole mPath as file -- this could still have ?, # etc.
> 		file = mPath;
> 	}
788a788,790
> 	else
> 		DupString(&mDirectory, "/");
>
795,819c797
<     if (brk)
<     {
<         ExtractString(file, &mFileName, 1 /* skip the leading / */, (brk-file-1));
<         //Keep pulling out other pieces...
<         while (brk)
<         {
<             char* lastbrk = brk;
<             brk = PL_strpbrk(lastbrk+1, delimiters);
<             switch (*lastbrk)
<             {
<                 case ';' : /*
<                            ExtractString(lastbrk, &mParam, 1, (brk ? (brk-lastbrk-1) : (len - (lastbrk-file) -1)));
<                            */
<                     break;
<                 case '?' : ExtractString(lastbrk, &mQuery, 1, (brk ? (brk-lastbrk-1) : (len - (lastbrk-file) -1)));
<                     break;
<                 case '#' : ExtractString(lastbrk, &mRef, 1, (brk ? (brk-lastbrk-1) : (len - (lastbrk-file) -1)));
<                     break;
<                 default:
<                     NS_ASSERTION(0, "This just can't be!");
<                     break;
<             }
<         }
<     }
<     else // Everything in the file is just the filename
---
>     if (!brk) // Everything in the file is just the filename
822a801,821
> 	ExtractString(file, &mFileName, 1 /* skip the leading / */, (brk-file-1));
> 	//Keep pulling out other pieces...
> 	while (brk)
> 	{
> 		char* lastbrk = brk;
> 		brk = PL_strpbrk(lastbrk+1, delimiters);
> 		switch (*lastbrk)
> 		{
> 			case ';' : /*
> 					   ExtractString(lastbrk, &mParam, 1, (brk ? (brk-lastbrk-1) : (len - (lastbrk-file) -1)));
> 					   */
> 				break;
> 			case '?' : ExtractString(lastbrk, &mQuery, 1, (brk ? (brk-lastbrk-1) : (len - (lastbrk-file) -1)));
> 				break;
> 			case '#' : ExtractString(lastbrk, &mRef, 1, (brk ? (brk-lastbrk-1) : (len - (lastbrk-file) -1)));
> 				break;
> 			default:
> 				NS_ASSERTION(0, "This just can't be!");
> 				break;
> 		}
> 	}
912,915c911
< 	// TODO fix when nsString changes
< 	char* tempDirFile = temp.ToNewCString();
< 	*o_DirFile = nsCRT::strdup(tempDirFile);
< 	delete[] tempDirFile;
---
> 	*o_DirFile = temp.ToNewCString();
1999-07-27 07:40:38 +00:00
gagan%netscape.com 00df4e6ed7 Necko only. Added a missing trailing newline. 1999-07-26 22:44:22 +00:00
ducarroz%netscape.com b8911a5e87 First Checked In. 1999-07-24 20:50:35 +00:00
gordon%netscape.com 670c22014f File Removed. 1999-07-23 19:39:04 +00:00
valeski%netscape.com e8723c09e8 necko only - added temporary user agent string creation code 1999-07-23 16:35:53 +00:00
valeski%netscape.com 1c6f1bb68a necko only - fixed some miss-matched memory deallocations, and pulled an extraneous addref/release combo 1999-07-23 16:35:13 +00:00
mscott%netscape.com d55d3c558c export nsIStreamConverter2.idl 1999-07-23 05:50:32 +00:00
mscott%netscape.com 5fdc858a17 generate header file for nsIStreamConverter2.idl 1999-07-23 05:49:07 +00:00
mscott%netscape.com c3e2512a51 this used to be mailnews\mime\public\nsIStreamConverter.idl but it needs to be moved out of mailnews as it is generic
and not specific to mailnews. The final resting place for this file will be netwerk\streamcnvts\public but that
directory isn't buildable yet so I'm moving it here for safe keeping. The name (the 2 part) is lame but it conflicted
with a file Jud is addding to streamconv (nsIStreamConverter). Don't worry..eventually the two interfaces
are going to be merged into one.
1999-07-23 05:48:27 +00:00
gagan%netscape.com 8bb993616b Replaced nsStandardUrl with nsStdURL. 1999-07-22 21:19:15 +00:00
gagan%netscape.com 4a65c95965 Changes for the standard URL parsing. Added SetRelativePath. Cleaned up the deletions (all thru nsCRT now) Added functionality for Query and Ref portions of the Path. Added DirFile function to nsIURL to allow just Directory and the Filename. Misc. cleanups as well. 1999-07-22 21:14:51 +00:00
valeski%netscape.com 829cfe29f6 added notification progids 1999-07-20 21:54:40 +00:00
warren%netscape.com b42c5297ac Fixed query/ref problem. 1999-07-20 08:46:35 +00:00
warren%netscape.com 7bcb94a320 Changed around load group insertion/removal to happen on mozilla thread. 1999-07-20 08:46:33 +00:00
warren%netscape.com f64274c766 Backed out Gagan's nsStdURL changes. 1999-07-17 01:32:48 +00:00
jdunn%netscape.com 4928643ce2 include nsILoadGroup.h before it is referenced by nsCOMPtr 1999-07-16 22:20:24 +00:00
jdunn%netscape.com e2cc3dc8aa declare nsINetModRegEntry public (it is assumed private if not specified) 1999-07-16 22:19:38 +00:00
warren%netscape.com c5684bf4d7 Big changes for Necko load groups. Things are much happier now. Now images work (on pages, but not in chrome). 1999-07-16 11:14:36 +00:00