Artifact
0ab910bf33670e5ab2496e07f2cc7a797c0795bc:
Ticket change
[0ab910bf33]
- New ticket
[219273ffffffffff|219273ffff] <i>socket -async combined with fileevent is broken on the Mac</i>.
by
nobody on
2000-10-26 05:09:43.
D 2000-10-26T05:09:43
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s1663\sBug\nVersion:\s8.0.5\nSubmitDate:\s'1999-03-30'\nLastModified:\s'2000-04-14'\nSeverity:\sCRIT\nStatus:\sUnAssn\nSubmitter:\spat\nChangedBy:\shobbs\nRelatedBugIDs:\s1776\nOS:\sMacintosh\nOSVersion:\s8.0\s(PPC)\nMachine:\sPower\sPC\nFixedDate:\s'2000-10-25'\nClosedDate:\s'2000-10-25'\n\n\nName:\nmo\n\nReproducibleScript:\n\s\s\s\sset\sserver\sftp.netscape.com\n\s\s\s\sset\sport\s\s\s12345\n\s\s\s\s\n\s\s\s\sif\s{[catch\s{\n\s\s\s\s\s\sset\ssock\s[socket\s-async\s$server\s$port]\n\s\s\s\s}\serr]}\s{\n\s\s\s\s\s\sputs\s"socket\s-async\sconnect\serror\s1\s\\"$err\\""\n\s\s\s\s}\n\s\s\s\s\n\s\s\s\s#\sdefine\sfile\sevent\scallback\n\s\s\s\s\n\s\s\s\sproc\sfirstWritable\s{\ssock\s}\s{\n\s\s\s\s\s\s#\sremove\swritable\sfileevent\shandler\n\s\s\s\s\s\sfileevent\s$sock\swritable\s{}\n\s\s\s\s\s\s\n\s\s\s\s\s\s#find\sout\sif\sthe\sconnection\sworked\sby\stesting\sthe\s-peername\n\s\s\s\s\n\s\s\s\s\s\sif\s[catch\s{fconfigure\s$sock\s-peername}\speerinfo]\s{\n\s\s\s\s\s\s\s\sclose\s$sock\n\s\s\s\s\s\s\s\sputs\s"socket\s-async\sconnect\serror\s2\s\\"$peerinfo\\""\n\s\s\s\s\s\s}\selse\s{\n\s\s\s\s\s\s\s\sputs\s"socket\s-async\sconnect\sworked"\n\s\s\s\s\s\s}\n\s\s\s\s}\n\s\s\s\s\n\s\s\s\s\n\s\s\s\s\n\s\s\s\s#\sset\sup\sfile\sevent\son\sthe\ssocket\sso\swe\sknow\n\s\s\s\s#\swhen\sit\sconnects\s(or\sfails\sto\sconnect)\n\s\s\s\s\n\s\s\s\sfileevent\s$sock\swritable\s"firstWritable\s$sock"\n\s\s\s\s\n\s\s\s\s\n\n\n\nObservedBehavior:\n\s\s\s\sWhen\sthis\scode\sis\srun\sunder\sMacOS\swith\sTcl\s8.0.5\sit\swill\sfail\n\s\s\s\sto\srun\sthe\sfileevent\scallback\sin\sthe\scase\swhere\sthe\shost\n\s\s\s\sis\sunreachable.\sThis\ssame\scode\sworks\sperfectly\sunder\sUnix.\n\s\s\s\s\n\s\s\s\sWhile\sthis\sis\sbad,\sit\sgets\seven\sworse\sif\syou\n\s\s\s\sinvoke\sthe\sfconfigure\scommand\slike\sthis:\n\s\s\s\s\n\s\s\s\sfconfigure\s$sock\n\s\s\s\s\n\s\s\s\sDoing\sthis\swill\skill\swish\scompletely\n\s\s\s\swith\san\serror\sdialog\sthat\ssays\n\s\s\s\s"error\sclosing\sasync\sconnect\ssocket"\n\s\s\s\s\n\s\s\s\sThis\sis\sno\sway\sto\srecover\sfrom\sthis!\n\s\s\s\s\n\n\n\nDesiredBehavior:\n\s\s\s\sI\sneed\sto\sbe\sable\sto\stest\sto\ssee\sif\sthe\sasync\ssocket\n\s\s\s\sconnect\sworked\susing\sthe\swritable\sfileevent.\sThere\sis\n\s\s\s\ssimply\sno\sother\sway\sto\scheck\sthe\sstatus\sof\sthe\ssocket\n\s\s\s\swithout\sdoing\sa\sread\son\sthe\ssocket\sand\sdoing\sa\sread\n\s\s\s\son\sthe\ssocket\sis\snot\san\soption\sbecause\sthe\sprogram\n\s\s\s\scan\snot\sblock\sTk\sevents\sduring\sa\snetwork\soperation.\n\s\s\s\s\n\n\n\n\n\n\s\s\s\sIt\slooks\slike\sthe\sproblem\sis\slocated\shere.\sI\sam\snot\ssure\swhat\sthe\sfix\n\n\s\s\s\sis\sbut\sa\spanic\sin\sthis\scase\sdoes\snot\sseem\slike\sthe\scorrect\saction.\n\n\s\s\s\s\n\n\s\s\s\stcl8.0.5/mac/tclMacSock.c:734\n\n\s\s\s\s\n\n\s\s\s\s\s\s\s\s/*\n\n\s\s\s\s\s\s\s\s\s*\sIf\sthis\ssocket\sis\sin\sthe\smidddle\son\sasync\sconnect\swe\scan\sjust\n\n\s\s\s\s\s\s\s\s\s*\sabort\sthe\sconnect\sand\srelease\sthe\sstream\sright\snow.\n\n\s\s\s\s\s\s\s\s\s*/\n\n\s\s\s\s\n\n\s\s\s\s\s\s\s\sif\s(statePtr->flags\s&\sTCP_ASYNC_CONNECT)\s{\n\n\s\s\s\s\s\s\s\s\s\s\s\sInitMacTCPParamBlock(&closePB,\sTCPClose);\n\n\s\s\s\s\s\s\s\s\s\s\s\sclosePB.tcpStream\s=\stcpStream;\n\n\s\s\s\s\s\s\s\s\s\s\s\sclosePB.ioCompletion\s=\sNULL;\n\n\s\s\s\s\s\s\s\s\s\s\s\serr\s=\sPBControlSync((ParmBlkPtr)\s&closePB);\n\n\s\s\s\s\s\s\s\s\s\s\s\sif\s(err\s!=\snoErr)\s{\n\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\spanic("error\sclosing\sasync\sconnect\ssocket");\n\n\s\s\s\s\s\s\s\s\s\s\s\s}\n\n\s\s\s\s\s\s\s\s\s\s\s\sstatePtr->flags\s|=\sTCP_RELEASE;\n\n\s\s\s\s\n\n\s\s\s\s\n\n
J foundin final:\s8.0.5
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 63.\s(unused)
J title socket\s-async\scombined\swith\sfileevent\sis\sbroken\son\sthe\sMac
J type Bug
K 219273ffffffffffffffffffffffffffffffffff
U nobody
Z bd7c09903351ca82c9031e2d2949f925