Skip to content
Tcl Source Code Artifact [52b1b4e2cd]
Login

Artifact [52b1b4e2cd]

Artifact 52b1b4e2cdcf143894ea89b4be02f6acc621fda8:

Ticket change [52b1b4e2cd] - New ticket [218047ffffffffff|218047ffff] <i>Reading data from socket on Windows appends extra &#39;0&#39; value</i>. by nobody on 2000-10-26 00:52:33.
D 2000-10-26T00:52:33
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s1398\sBug\nVersion:\s8.0.4\nSubmitDate:\s'1999-03-02'\nLastModified:\s'2000-04-24'\nSeverity:\sSER\nStatus:\sClosed\nSubmitter:\spat\nChangedBy:\shobbs\nOS:\sWindows\sNT\nOSVersion:\s4.0,\sservice\spack\s3\nMachine:\sX86\nFixedDate:\s'2000-10-25'\nClosedDate:\s'2000-04-24'\n\n\nName:\nFred\sRoeber\n\nExtensions:\nDP\n\nCustomShell:\npatch\sfrom\sBug\sID\s893\n\nReproducibleScript:\nThe\scode\swe\sare\susing\sto\sreceive\sdata\sover\sa\sTCP\ssocket\sfollows.\n\n#\sset\sup\sa\ssocket\sto\shandle\supload\srequests\s(will\scall\stscan_socket)\nif\s{[catch\s{socket\s-server\stscan_socket\s$tscan_port}\stscan_server_id]}\s{\n\s\s\s\s#\scommand\sfailed\sso\ssignal\sreceive\sdisabled\n\s\s\s\stscan_display\s"Error\s-\scouldn't\sconnect\ssocket:\s$tscan_server_id"\n}\n\nproc\stscan_socket\s{chan_id\sip_addr\sport}\s{\n\s\s\s\sglobal\stscan_file_id\n\n\s\s\s\sif\s{[catch\s{open\s"dummy"\s"w"}\stscan_file_id]}\s{\n\s\s\s\s\s\s\s\s#\sproblem\sopening\sfile\n\s\s\s\s\s\s\s\stscan_display\s"Error\s-\scouldn't\sopen\sfile:\s$tscan_file_id"\n\s\s\s\s\s\s\s\sclose\s$chan_id\n\s\s\s\s\s\s\s\sreturn\n\s\s\s\s}\n\s\s\s\sfconfigure\s$tscan_file_id\s-translation\sbinary\s-blocking\sno\n\n\s\s\s\s#\sset\sup\sto\sreceive\sthe\supload\sdata\n\s\s\s\sfconfigure\s$chan_id\s-translation\sbinary\s-blocking\sno\n\s\s\s\sfileevent\s$chan_id\sreadable\s"tscan_socket_read\s$chan_id\s$tscan_file_id"\n}\n\nproc\stscan_socket_read\s{chan_id\sfile_id}\s{\n\s\s\s\sif\s{[catch\s{read\s$chan_id}\sdata]}\s{\n\s\s\s\s\s\s\s\stscan_display\s"problem\sreading\sTimeScan\sdata\sfrom\ssocket"\n\s\s\s\s}\selseif\s{[eof\s$chan_id]}\s{\n\s\s\s\s\s\s\s\stscan_display\s"Done"\n\s\s\s\s}\selseif\s{[catch\s{puts\s-nonewline\s$file_id\s$data}\sfile_err]}\s{\n\s\s\s\s\s\s\s\stscan_display\s"Error\swriting\sTimeScan\sdata\sto\sfile:\s$file_err"\n\s\s\s\s}\selse\s{\n\s\s\s\s\s\s\s\s#\severything\sworked\sso\swe\sare\sdone.\sDo\sa\sdisplay\supdate\sso\sthat\sprogram\n\s\s\s\s\s\s\s\s#\sisn't\sunresponsive\n\s\s\s\s\s\s\s\supdate\n\s\s\s\s\s\s\s\sreturn\n\s\s\s\s}\n\n\s\s\s\s#\swe\shad\ssome\sproblem\sso\sshut\sdown\schannel\n\s\s\s\scatch\s{close\s$chan_id}\n\s\s\s\scatch\s{close\s$file_id}\n}\n\n\n\n\nObservedBehavior:\nThis\scode\sabove\sworks\sfine\sunder\sSolaris.\sUnder\swindows,\swe\sreceive\san\nextra\s'0'\sbyte\s(not\s'\\0')\sfrom\sthe\ssocket\sconnection\sthat\sgets\swritten\sto\sthe\noutput\sfile.\sIf\sthe\ssystem\ssending\sthe\sdata\sjust\sopens\sa\scloses\sa\sTCP\nconnection,\swe\sget\sa\s0\sbyte\sfile\son\sSolaris\sbut\sa\s1\sbyte\sfile\sunder\nWindows/NT\s4.0.\n\n\n\n\n\n\nDesiredBehavior:\nI\sexpect\sSolaris\sand\swindows\sto\sproduce\sthe\ssame\sresultswith\sthe\scode\sabove.\n\n\n\n\n\nAs\sa\snote\sof\sreference,\sI\sfound\sthe\spatch\sfor\sbug\sID\s893\son\syour\ssite.\sI\ninstalled\sit\sas\sit\swas\srequired\sto\shave\sit\sinstalled\sto\sget\sasynchronous\nsockets\sto\sbe\sproperly\sopened\sunder\sWindows.\n\n--\nI'm\snot\sable\sto\sreproduce\sthis\swith\s8.2.3\son\sNTsp4.\s\n--\s04/19/2000\shobbs\nResponse\sfrom\suser:\n\nHello,\sI\shad\sfound\sout\sthe\ssource\sof\sthis\sproblem\safter\ssubmitting\sthe\nreport.\sThe\sissue\swas\sthat\sthe\ssending\sapplication\swas\ssending\sup\san\nOOB\s(out\sof\sband)\smessage\swith\sa\s'0'\sin\sit\sbefore\sclosing\sthe\ssocket.\nThe\sintent\swas\sthe\s"wake\sup"\sthe\shost\sso\sit\scould\sclose\sthe\ssocket\nquickly.\sWindows\sdoesn't\ssupport\sOOB\smessages\son\ssockets\sso\sadded\sthe\n'0'\sto\sthe\soutput\sstream.\sI\sjust\schalked\sthis\sup\sas\sone\sof\sthose\sUnix\nvs\sWindows\sTCP/IP\sstack\sdifferences.\sThanks\sfor\sthe\sresponse.\s\sFred\n\n\s\s\s|\s\s\s\s\s\sFred\sJ\sRoeber,\s\sBBN\sSystems\s&\sTechnologies\s\s\s\s\s\s|\n\s\n--\s04/24/2000\shobbs
J foundin obsolete:\s8.0.4
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 63.\s(unused)
J title Reading\sdata\sfrom\ssocket\son\sWindows\sappends\sextra\s'0'\svalue
J type Bug
K 218047ffffffffffffffffffffffffffffffffff
U nobody
Z 07f76f201dcd36b81082bfbb110a902d