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

735 Коммитов

Автор SHA1 Сообщение Дата
leaf%mozilla.org e7d4319fdd backing out dougt 1999-08-19 02:35:39 +00:00
dougt%netscape.com 0b7cc4c86e Updating to use new NetMod Notification. 1999-08-18 09:33:27 +00:00
dougt%netscape.com 431a9eef50 Adding thread proxy support to Net Module Notification.
General cleanup
1999-08-18 09:32:26 +00:00
ramiro%netscape.com ee33c47ded Link in secfree dynamically only where needed. 1999-08-17 15:46:57 +00:00
gordon%netscape.com be0cd1d2e5 This is just a NECKO test app. Updating to work on Mac. 1999-08-13 22:18:34 +00:00
gagan%netscape.com 63d548333f backslashes in ..\.. cases fixed. Thanks bratell@lysator.liu.se 1999-08-13 05:20:45 +00:00
warren%netscape.com d944d70a84 Fix for bug 7682: StringBundle can't load URLs from imap thread. 1999-08-13 00:43:48 +00:00
gagan%netscape.com 1581724dae Fixed bunch of M9 bugs for Necko. 1999-08-12 09:59:24 +00:00
briano%netscape.com 955529a7f3 Unix native compilers don't like it when files don't end with a newline. 1999-08-12 01:58:19 +00:00
valeski%netscape.com 0091d03cb8 added pipe2 stuff back in after patrick got the pipe2 stuff linking in w/ mac 1999-08-12 01:01:55 +00:00
valeski%netscape.com a652772b48 removed nsPipe2 api usage 1999-08-11 23:58:35 +00:00
valeski%netscape.com 4c6ccdee2b added files: mozilla/netwerk/protocol/ftp/public/nsIFTPContext.idl 1999-08-11 22:27:12 +00:00
valeski%netscape.com 87e42a03b1 adding next rev of ftp protocol 1999-08-11 22:26:32 +00:00
rpotts%netscape.com a806fec196 Bug #11410. Changed NS_ASSERTION to checkc the *correct* variable. Someday I'll grow a brain and become really dangerous... 1999-08-11 21:15:49 +00:00
warren%netscape.com 9ac2ca82f2 Fixed problem for large files (or small buffers). Added logging. 1999-08-11 08:17:35 +00:00
gagan%netscape.com 4207799f58 Temporarily fixing the assert which I think is ok, but would let rpotts confirm it. 1999-08-11 04:28:32 +00:00
valeski%netscape.com 551c3fdc95 added user agent language setter routine 1999-08-10 18:33:27 +00:00
mccabe%netscape.com 2a403483de Changes to the xpidl compiler -
Error if an interface is declared [scriptable], but contains methods that can't be scripted because they refer to native-declared types, unless the method is declared [noscript].

This change is intended to make it easier to determine when an interface is not scriptable, and to make it easier to see what changes need to be made to make it scriptable.

As many of the .idl files in the tree defined [scriptable] interfaces that contained non-scriptable methods, I've sprinkled [noscript] throughout.  As the interfaces weren't scriptable anyway, this shouldn't change their visibility to javascript.
1999-08-10 12:18:01 +00:00
rpotts%netscape.com f2ce78ae81 Release the pointers that were passed into AsyncRead(...) when the operation is compelete. This breaks some circular references that prevented WebShells from being deleted... 1999-08-10 04:02:10 +00:00
rpotts%netscape.com 04a3d364ce Implement the nsIRequest interface for nsHTTPChannel. This allows channels that are cancelled from a LoadGroup to *actually* get removed... 1999-08-09 07:07:08 +00:00
rpotts%netscape.com eabc748ec0 Implement nsIRequest::Cancel() for the SocketTransport. 1999-08-09 07:05:15 +00:00
rpotts%netscape.com 449ba12da6 bug #10790. The HTTPChannel is now given to the HTTPResponseListener during construction. Before, it was getting it via a dirty cast in the OnStartRequest notification. Unfortunately, OnStartRequest is only called if the connection is successful. This caused a crash in OnStopRequest if the HTTPChannel was not available :-( 1999-08-06 07:57:44 +00:00
morse%netscape.com e3092f3888 cleaned up dialogs 1999-08-06 00:29:10 +00:00
valeski%netscape.com 9ef221c292 fixing mac build bustage. brade verified the changes in her mac build. I switched from com ptrs to regular pointers as the com pointer abuse wasn't appreciated on the mac 1999-08-05 16:17:22 +00:00
rhp%netscape.com 98bb37cae0 added files: mozilla/netwerk/protocol/http/src/nsHTTPHeaderArray.cpp, mozilla/netwerk/protocol/http/src/nsHTTPAtoms.cpp 1999-08-05 13:23:45 +00:00
rhp%netscape.com f02cb85a5f added files: mozilla/netwerk/protocol/http/public/nsIHTTPHeader.idl 1999-08-05 13:16:39 +00:00
rpotts%netscape.com fd0ec4db70 Fix for build bustage on Linux... 1999-08-05 09:07:29 +00:00
rpotts%netscape.com 37703cf101 Added code to dump all headers in the OnHeadersAvailable() notification. 1999-08-05 08:29:36 +00:00
rpotts%netscape.com 1a4d82c21f bug #10739. Reworking header APIs... I've removed nsIHeader.h. 1999-08-05 08:28:49 +00:00
rpotts%netscape.com 0d546eaffa bug #10739. Reworking header APIs... I've added 2 new CPP files - nsHTTPAtoms.cpp and nsHTTPHeaderArray.cpp. 1999-08-05 08:27:49 +00:00
rpotts%netscape.com 6e6cdb32c5 bug #10739. Reworking header APIs... I've added a new IDL file - nsIHTTPHeader.idl and remove 3 obsolete header files... 1999-08-05 08:26:57 +00:00
mscott%netscape.com d37e51242e bulletproof some NS_RELEASE's with NS_IF_RELEASE. 1999-08-04 21:23:26 +00:00
valeski%netscape.com 8cd7c54894 nsNetModRegEntry.cpp - fixed mem leak. nsStdURL.cpp - fixed port parsing bug 1999-08-04 21:20:48 +00:00
gagan%netscape.com f182cc62db Added a new MANIFEST file for nsHTTP stuff. 1999-08-04 16:12:30 +00:00
gagan%netscape.com 46143f3127 POSTing works now. 1999-08-04 15:07:26 +00:00
briano%netscape.com 3c91849065 Added a newline at the EOF to fix the HP build (and others). 1999-08-04 02:11:03 +00:00
briano%netscape.com 16db76eb51 Yet another case of a new file checked in missing the newline at EOF required by Unix native compilers. 1999-08-04 02:02:15 +00:00
valeski%netscape.com 31e057081c win32 bustage. nspr wasn't being linked into the stream conv dll 1999-08-04 00:50:21 +00:00
valeski%netscape.com 308f65e005 memory deallocation macro problem 1999-08-03 23:44:16 +00:00
valeski%netscape.com 422e84ccad added stream converter to the builds 1999-08-03 22:04:57 +00:00
warren%netscape.com 8d70ef168e Returned error when file not found for OpenInputStream. 1999-08-03 22:00:17 +00:00
briano%netscape.com e2cc541f86 Cleaned it up and got rid of the redundant HP-specific SHARED_LIBRARY_LIBS stuff. 1999-08-03 21:40:56 +00:00
dougt%netscape.com 3c1d894f1c removing hard coded "http" string and using GetScheme() instead.
cleaning up a memory leak
1999-08-03 02:15:30 +00:00
warren%netscape.com 529c0b2b71 Removed hack to export to netwerk/dist (used before landing necko). 1999-08-03 00:38:25 +00:00
valeski%netscape.com 1cdf612052 pulled file extension search code and started using new mime mapping method which does it for us 1999-08-01 16:44:29 +00:00
valeski%netscape.com 99a28ebe09 factored repeated mime type retrieval implementations into mime mapping service methods 1999-08-01 16:42:25 +00:00
warren%netscape.com 7451a9a44d Took out more f*** nsCOMPtrs 1999-07-31 07:51:35 +00:00
warren%netscape.com 5e143d61d4 Removed nsCOMPtr breakage. 1999-07-31 07:30:49 +00:00
warren%netscape.com 07b963204e Added GetLoadGroup/SetLoadGroup to nsIChannel so that redirects can discover the group. 1999-07-31 06:53:12 +00:00
warren%netscape.com 38ba2d2fad Lots of cool logging code. 1999-07-31 06:28:31 +00:00
warren%netscape.com 8c9db416e3 Added shtml 1999-07-31 06:27:03 +00:00
beard%netscape.com 8a020feafa removed special handling of /usr/local/bin/netscape in favor of better solution in resource: URL handler. 1999-07-31 01:04:23 +00:00
gagan%netscape.com 7226dc69b4 Fix MLK. Freeing up previous versions of mPath/mScheme 1999-07-31 00:15:49 +00:00
rpotts%netscape.com 558cdd62be bug #10424 URL redirects. If the server did *not* send an entity along with the 302, necko would not correctly follow the redirect. 1999-07-30 07:13:05 +00:00
rpotts%netscape.com 21e7d3da37 bug #10424 URL redirects. If the server did *not* send an entity along with the 302, necko would not correctly follow the redirect. 1999-07-30 06:39:24 +00:00
warren%netscape.com 57392932f9 Fixed to not put stuff in netwerk/dist anymore. 1999-07-30 06:10:53 +00:00
warren%netscape.com ec14999c47 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 2c443202a5 crahser fix 10843 - bad host name was crashing the socket transport in error state 1999-07-30 02:36:52 +00:00
valeski%netscape.com 8cf1dba87f added dns failure check to output 1999-07-30 02:35:12 +00:00
gagan%netscape.com 7404fbfb83 Fixes the spaces problem also on the Mac! 1999-07-30 01:17:29 +00:00
gagan%netscape.com c6472453b8 Fixed the spaces problem. File path is now unescaped before being handed over to file spec. 1999-07-30 00:55:35 +00:00
sdagley%netscape.com 55649b036c Temp hack for the Mac to address error opening files that aren't properly un-escaped (%20 still in the path instead of spaces for example). We still fail to open the file but now there's an error message to go along with the failure. Note that this will require Macsbug to be installed or a Mac hitting this error will crash. Since we were already telling people that they needed Macsbug installed to run the developmental builds I don't see a problem with this. 1999-07-30 00:37:58 +00:00
briano%netscape.com adb4c20ef7 Fix for platforms whose ld's don't have a --whole-archive equivalent. 1999-07-29 22:47:42 +00:00
valeski%netscape.com f915d4a913 not in default build - added stream conversion test app 1999-07-29 21:18:35 +00:00
valeski%netscape.com b955d14bca not in default builds. fixed mem leaks in stream service 1999-07-29 21:17:33 +00:00
valeski%netscape.com 75449d0dff not in default builds - stream converter leak updates and we're now poping from the Q from the top (FIFO) 1999-07-29 07:09:46 +00:00
sspitzer%netscape.com 0f1188a8ce ignore generated Makefile 1999-07-29 05:00:07 +00:00
bruce%cybersight.com e2e303a78d Build fix for aCC on HP-UX. Approved by leaf. 1999-07-29 04:21:42 +00:00
mscott%netscape.com 94b8521246 fix build breakage...include config.mak 1999-07-29 03:17:36 +00:00
mscott%netscape.com d563520210 fix build by including config.mak 1999-07-29 03:10:23 +00:00
mscott%netscape.com 17edea3140 fix build breakage...include config.mak 1999-07-29 02:49:02 +00:00
mscott%netscape.com c0c1cc8e74 fix build breakage by including config.mak 1999-07-29 02:47:16 +00:00
mscott%netscape.com 203c991819 Fix build breakage...include config.mak 1999-07-29 02:35:45 +00:00
briano%netscape.com 5ca4aa0b87 Trivial elimination of some pointless macros as discussed in bug 8568. Approved by leaf@mozilla.org. 1999-07-29 01:18:12 +00:00
rpotts%netscape.com 02062599f9 Close the socket if an error occurred... 1999-07-28 11:08:18 +00:00
rpotts%netscape.com 3aed16e4b8 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
rpotts%netscape.com 8c60c16be7 Set the max number of open transports to 8. 1999-07-28 09:26:55 +00:00
rpotts%netscape.com 315de829f9 Obsolete file... 1999-07-28 09:25:51 +00:00
rpotts%netscape.com bf7d1235bc Support for a Max number of open transports. 1999-07-28 09:25:31 +00:00
warren%netscape.com c7b57f1e08 Fixed mismatched delete problem (purify). 1999-07-28 04:05:10 +00:00
warren%netscape.com 7b13572242 Fixed UMR / refcounting problem (purify). 1999-07-28 04:02:07 +00:00
gagan%netscape.com ca73a1f56c More URL parsing updates for not so common cases. 1999-07-28 02:13:07 +00:00
valeski%netscape.com 8fe0e5315f free memory mismatch fix 1999-07-27 23:35:01 +00:00
mcafee%netscape.com 9e9afeb293 Minor comment change. 1999-07-27 23:31:48 +00:00
briano%netscape.com 007ea62765 Cleaned it up and changed the name of libreg.{a,so} to libmozreg.{a,so} to fix the conflict reported in bug 8568. 1999-07-27 23:27:44 +00:00
ducarroz%netscape.com 69fb203755 Fix shlb name conflict between netwerk:mime and mailnews:mime. Necko only. 1999-07-27 23:17:49 +00:00
gagan%netscape.com f127b5bcec Fixed the URL parsing for http://foo:80 1999-07-27 21:28:05 +00:00
valeski%netscape.com a176e19e98 fixing mem leak 1999-07-27 21:12:50 +00:00
mcafee%netscape.com 11cfd5f1b9 Adding testserver/Makefile 1999-07-27 20:33:00 +00:00
mcafee%netscape.com 09740c6d93 First checkin 1999-07-27 20:32:08 +00:00
valeski%netscape.com 2964097b08 memory leak fix on ns_makeabsoluteURI calls 1999-07-27 14:42:19 +00:00
rpotts%netscape.com 4c8f571a13 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 cfc523f742 Added assertion for bug I was hitting (spinning). 1999-07-27 08:47:43 +00:00
warren%netscape.com 17c0cb8533 Added missing error check. 1999-07-27 08:47:13 +00:00
warren%netscape.com 0cf03128d0 Fixed tab-width 1999-07-27 08:46:27 +00:00
warren%netscape.com d8715087fe Added logging. 1999-07-27 08:45:35 +00:00
warren%netscape.com 065cd2992d Fixed NewURI to not pass base URI when spec is absolute. 1999-07-27 08:45:20 +00:00
gagan%netscape.com dc9fb63f38 -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
valeski%netscape.com 2316686429 this dir is not in any builds. removed the unwanted AsyncConvertSTream method. now we support one sync conversion method, and one async 1999-07-27 03:25:57 +00:00
hoa.nguyen%intel.com 30774b9c9e Removed backed out change which added dns/daemon to build. Need to test on Windows and Mac build first. 1999-07-27 02:56:36 +00:00