diff --git a/GUSI/MacDistr b/GUSI/MacDistr index 61fdb25..2832c17 100755 Binary files a/GUSI/MacDistr and b/GUSI/MacDistr differ diff --git a/GUSI/README b/GUSI/README index 65cef6d..5428a80 100755 Binary files a/GUSI/README and b/GUSI/README differ diff --git a/GUSI/src/GUSIFileSpec.nw b/GUSI/src/GUSIFileSpec.nw index 64ee0c9..35ece0a 100755 Binary files a/GUSI/src/GUSIFileSpec.nw and b/GUSI/src/GUSIFileSpec.nw differ diff --git a/GUSI/src/GUSIMPW.nw b/GUSI/src/GUSIMPW.nw index b25d7d5..3709f2b 100755 Binary files a/GUSI/src/GUSIMPW.nw and b/GUSI/src/GUSIMPW.nw differ diff --git a/GUSI/src/GUSIOTNetDB.nw b/GUSI/src/GUSIOTNetDB.nw index ccedfa4..5278d59 100755 Binary files a/GUSI/src/GUSIOTNetDB.nw and b/GUSI/src/GUSIOTNetDB.nw differ diff --git a/GUSI/src/GUSIOpenTransport.nw b/GUSI/src/GUSIOpenTransport.nw index 6c11660..594318d 100755 Binary files a/GUSI/src/GUSIOpenTransport.nw and b/GUSI/src/GUSIOpenTransport.nw differ diff --git a/GUSI/src/tangled/GUSIFileSpec.cp b/GUSI/src/tangled/GUSIFileSpec.cp index 9f87a61..fdd2f98 100755 --- a/GUSI/src/tangled/GUSIFileSpec.cp +++ b/GUSI/src/tangled/GUSIFileSpec.cp @@ -215,12 +215,13 @@ GUSIFileSpec::GUSIFileSpec(const char * path, bool useAlias) while (!fError && *++path == ':') --(*this); } else { - fullSpec = true; if (nextPath = strchr(path, ':')) { AddPathComponent(path, nextPath-path, fullSpec); - path = nextPath+1; + fullSpec = true; + path = nextPath+1; } else { AddPathComponent(path, strlen(path), fullSpec); + fullSpec = true; break; } } @@ -288,6 +289,7 @@ GUSIFileSpec & GUSIFileSpec::operator++() fSpec.vRefNum = 0; fSpec.parID = fsRtParID; fSpec.name[0] = 0; + fValidInfo = false; goto punt; } @@ -326,6 +328,7 @@ GUSIFileSpec & GUSIFileSpec::AddPathComponent(const char * name, int length, boo goto punt; memcpy(fSpec.name+1, name, fSpec.name[0] = length); + fValidInfo = false; if (fSpec.parID == fsRtParID) GetVolume(); diff --git a/GUSI/src/tangled/GUSIMPW.cp b/GUSI/src/tangled/GUSIMPW.cp index 8b051ee..8f40058 100755 --- a/GUSI/src/tangled/GUSIMPW.cp +++ b/GUSI/src/tangled/GUSIMPW.cp @@ -346,7 +346,15 @@ GUSISocket * GUSIMPWDevice::open(GUSIFileToken & file, int flags) if (!ConnectToMPWLibrary()) return GUSISetPosixError(ENOEXEC), static_cast(nil); - int fd = MPW_open(file.Path(), TranslateOpenFlags(flags)); + // To ensure that our fancy path handling gets applied to all complex paths, but MPW gets + // to do its magic on [[Dev:]] paths, we normalize paths if they contain more than 1 colon. + // + // = + const char * path = file.Path(); + const char * colon = strchr(path, ':'); + if (colon && strchr(colon, ':')) + path = file.RelativePath(); + int fd = MPW_open(path, TranslateOpenFlags(flags)); if (fd == -1) { return static_cast(nil); diff --git a/GUSI/src/tangled/GUSIOTNetDB.cp b/GUSI/src/tangled/GUSIOTNetDB.cp index 7327786..f7a6a88 100755 --- a/GUSI/src/tangled/GUSIOTNetDB.cp +++ b/GUSI/src/tangled/GUSIOTNetDB.cp @@ -52,12 +52,15 @@ pascal void GUSIOTNetDBNotify( break; } break; - default: - if (code == kOTProviderWillClose || code == kOTProviderIsClosed) { + switch (code) { + case kOTProviderWillClose: + case kOTProviderIsClosed: netdb->fCreationContext = nil; // Close & reopen - } else { + break; + default: result = 0; + break; } break; } diff --git a/GUSI/src/tangled/GUSIOpenTransport.cp b/GUSI/src/tangled/GUSIOpenTransport.cp index 5e1090e..8400e2d 100755 --- a/GUSI/src/tangled/GUSIOpenTransport.cp +++ b/GUSI/src/tangled/GUSIOpenTransport.cp @@ -23,6 +23,7 @@ inline uint32_t CompleteMask(OTEventCode code) pascal void GUSIOTNotify( GUSIOTSocket * sock, OTEventCode code, OTResult result, void *cookie) { + GUSI_MESSAGE1(("GUSIOTNotify %08x %d\n", code, result)); switch (code & 0x7f000000L) { case 0: sock->fNewEvent |= code; @@ -154,8 +155,9 @@ void GUSIOTSocket::close() // violence to disconnect the socket. // // = - fCompletion &= ~(CompleteMask(T_DISCONNECTCOMPLETE)); - GUSIOTTCall * call = new (fEndpoint, 0) GUSIOTTCall; + fCompletion &= ~(CompleteMask(T_DISCONNECTCOMPLETE)); + GUSIOTTCall * call = new (fEndpoint, 0) GUSIOTTCall; + fAsyncError = 0; SetAsyncMacError(OTSndDisconnect(fEndpoint, call)); delete call; AddContext(); @@ -205,7 +207,8 @@ int GUSIOTSocket::BindToAddress(GUSIOTTBind * addr) fSockName = new (fEndpoint) GUSIOTTBind; if (!fSockName) return GUSISetPosixError(ENOMEM); - fCompletion &= ~CompleteMask(T_BINDCOMPLETE); + fCompletion &= ~CompleteMask(T_BINDCOMPLETE); + fAsyncError = 0; SetAsyncMacError(OTBind(fEndpoint, addr, fSockName)); AddContext(); MopupEvents(); @@ -226,6 +229,7 @@ int GUSIOTSocket::BindToAddress(GUSIOTTBind * addr) void GUSIOTSocket::Unbind() { fCompletion &= ~(CompleteMask(T_BINDCOMPLETE) | CompleteMask(T_UNBINDCOMPLETE)); + fAsyncError = 0; SetAsyncMacError(OTUnbind(fEndpoint)); AddContext(); MopupEvents(); @@ -250,6 +254,7 @@ int GUSIOTSocket::getsockname(void * name, socklen_t * namelen) return GUSISetPosixError(ENOMEM); fCompletion &= ~CompleteMask(T_GETPROTADDRCOMPLETE); + fAsyncError = 0; SetAsyncMacError(OTGetProtAddress(fEndpoint, otname, nil)); AddContext(); @@ -325,7 +330,7 @@ bool GUSIOTSocket::pre_select(bool wantRead, bool wantWrite, bool wantExcept) if (wantRead && OTCountDataBytes(fEndpoint, &sz) == kOTNoDataErr) fEvent &= ~(T_DATA|T_EXDATA); - return true; + return GUSISocket::pre_select(wantRead, wantWrite, wantExcept); } // = int GUSIOTSocket::getsockopt(int level, int optname, void *optval, socklen_t * optlen) @@ -605,6 +610,7 @@ int GUSIOTStreamSocket::listen(int queueLength) else queueLength = ((queueLength * 3) >> 1) + 1; fSockName->qlen = queueLength; + fAsyncError = 0; SetAsyncMacError(OTBind(fEndpoint, fSockName, nil)); AddContext(); MopupEvents(); @@ -672,6 +678,7 @@ if (err) { // = GUSIOTStreamSocket * sock = fNextListener; fCompletion &= ~(CompleteMask(T_ACCEPTCOMPLETE)); + fAsyncError = 0; SetAsyncMacError(OTAccept(fEndpoint, sock->fEndpoint, sock->fPeerName)); AddContext(); MopupEvents(); @@ -721,6 +728,7 @@ int GUSIOTStreamSocket::connect(void * address, socklen_t addrlen) MopupEvents(); OTResult res = 0; + GUSI_MESSAGE(("Connecting...\n")); switch (OTGetEndpointState(fEndpoint)) { case T_OUTCON: if (!fBlocking) @@ -857,6 +865,7 @@ bool GUSIOTStreamSocket::select(bool * canRead, bool * canWrite, bool * except) { MopupEvents(); + size_t sz; bool res = false; OTResult state = OTGetEndpointState(fEndpoint); diff --git a/macssh/www/download/ChangeLog b/macssh/www/download/ChangeLog index 9436b94..0604bcf 100755 Binary files a/macssh/www/download/ChangeLog and b/macssh/www/download/ChangeLog differ