Artifact
8f015c6d0b7b192c6a7c8eaa6f2ee1d9ba527982:
0000: 32 30 30 30 2d 30 36 2d 30 35 20 20 42 72 65 6e 2000-06-05 Bren
0010: 74 20 57 65 6c 63 68 20 3c 77 65 6c 63 68 40 61 t Welch <welch@a
0020: 6a 75 62 61 73 6f 6c 75 74 69 6f 6e 73 2e 63 6f jubasolutions.co
0030: 6d 3e 0a 0a 09 2a 20 74 6c 73 2e 63 2c 20 74 6c m>...* tls.c, tl
0040: 73 49 4f 2e 63 3a 20 20 53 70 6c 69 74 20 54 6c sIO.c: Split Tl
0050: 73 5f 46 72 65 65 20 69 6e 74 6f 20 54 6c 73 5f s_Free into Tls_
0060: 43 6c 65 61 6e 2c 20 77 68 69 63 68 20 64 6f 65 Clean, which doe
0070: 73 0a 09 74 68 65 20 53 53 4c 20 63 6c 65 61 6e s..the SSL clean
0080: 75 70 2c 20 61 6e 64 20 74 68 65 20 54 63 6c 5f up, and the Tcl_
0090: 46 72 65 65 20 63 61 6c 6c 2e 20 20 49 74 20 69 Free call. It i
00a0: 73 20 69 6d 70 6f 72 74 61 6e 74 20 74 6f 20 73 s important to s
00b0: 68 75 74 64 6f 77 6e 0a 09 74 68 65 20 53 53 4c hutdown..the SSL
00c0: 20 73 74 61 74 65 20 22 73 79 6e 63 68 72 6f 6e state "synchron
00d0: 6f 75 73 6c 79 22 20 64 75 72 69 6e 67 20 61 20 ously" during a
00e0: 73 74 61 63 6b 65 64 20 66 6c 75 73 68 2e 0a 0a stacked flush...
00f0: 32 30 30 30 2d 30 36 2d 30 31 20 20 53 63 6f 74 2000-06-01 Scot
0100: 74 20 53 74 61 6e 74 6f 6e 20 20 3c 73 74 61 6e t Stanton <stan
0110: 74 6f 6e 40 61 6a 75 62 61 73 6f 6c 75 74 69 6f ton@ajubasolutio
0120: 6e 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 49 ns.com>...* tlsI
0130: 4f 2e 63 3a 20 52 65 73 74 6f 72 65 64 20 63 61 O.c: Restored ca
0140: 6c 6c 20 74 6f 20 54 63 6c 5f 4e 6f 74 69 66 79 ll to Tcl_Notify
0150: 43 68 61 6e 6e 65 6c 20 66 72 6f 6d 20 43 68 61 Channel from Cha
0160: 6e 6e 65 6c 48 61 6e 64 6c 65 72 0a 09 74 6f 20 nnelHandler..to
0170: 65 6e 73 75 72 65 20 74 68 61 74 20 65 76 65 6e ensure that even
0180: 74 73 20 70 72 6f 70 61 67 61 74 65 20 66 72 6f ts propagate fro
0190: 6d 20 74 68 65 20 6c 6f 77 65 72 20 64 72 69 76 m the lower driv
01a0: 65 72 2e 20 20 54 68 69 73 20 6d 61 79 0a 09 72 er. This may..r
01b0: 65 73 75 6c 74 20 69 6e 20 61 6e 20 69 6e 66 69 esult in an infi
01c0: 6e 69 74 65 20 6c 6f 6f 70 20 69 6e 20 73 6f 6d nite loop in som
01d0: 65 20 63 61 73 65 73 2c 20 73 6f 20 74 68 69 73 e cases, so this
01e0: 20 69 73 20 6e 6f 74 20 61 20 74 6f 74 61 6c 0a is not a total.
01f0: 09 66 69 78 2e 20 20 54 68 69 73 20 6d 61 79 20 .fix. This may
0200: 62 65 20 73 75 66 66 69 63 69 65 6e 74 20 66 6f be sufficient fo
0210: 72 20 6e 6f 77 2c 20 68 6f 77 65 76 65 72 2e 20 r now, however.
0220: 5b 42 75 67 3a 20 35 36 32 33 5d 0a 0a 32 30 30 [Bug: 5623]..200
0230: 30 2d 30 36 2d 30 31 20 20 53 63 6f 74 74 20 53 0-06-01 Scott S
0240: 74 61 6e 74 6f 6e 20 20 3c 73 74 61 6e 74 6f 6e tanton <stanton
0250: 40 73 63 72 69 70 74 69 63 73 2e 63 6f 6d 3e 0a @scriptics.com>.
0260: 0a 09 2a 20 74 6c 73 49 4f 2e 63 3a 20 52 65 73 ..* tlsIO.c: Res
0270: 74 6f 72 65 20 74 68 65 20 70 72 65 76 69 6f 75 tore the previou
0280: 73 20 76 65 72 73 69 6f 6e 2e 20 20 46 69 78 65 s version. Fixe
0290: 64 20 74 68 65 20 43 6c 6f 73 65 50 72 6f 63 20 d the CloseProc
02a0: 73 6f 0a 09 69 74 20 75 6e 72 65 67 69 73 74 65 so..it unregiste
02b0: 72 73 20 74 68 65 20 63 68 61 6e 6e 65 6c 20 68 rs the channel h
02c0: 61 6e 64 6c 65 72 20 6f 6e 20 74 68 65 20 73 75 andler on the su
02d0: 70 65 72 63 65 64 65 64 20 63 68 61 6e 6e 65 6c perceded channel
02e0: 0a 09 69 6e 73 74 65 61 64 20 6f 66 20 74 68 65 ..instead of the
02f0: 20 75 70 70 65 72 20 63 68 61 6e 6e 65 6c 2e 20 upper channel.
0300: 41 6c 73 6f 20 72 65 6d 6f 76 65 64 20 74 68 65 Also removed the
0310: 20 63 61 6c 6c 20 74 6f 0a 09 54 63 6c 5f 4e 6f call to..Tcl_No
0320: 74 69 66 79 43 68 61 6e 6e 65 6c 20 69 6e 20 74 tifyChannel in t
0330: 68 65 20 43 68 61 6e 6e 65 6c 48 61 6e 64 6c 65 he ChannelHandle
0340: 72 20 62 65 63 61 75 73 65 20 74 68 69 73 20 77 r because this w
0350: 69 6c 6c 20 72 65 73 75 6c 74 0a 09 69 6e 20 61 ill result..in a
0360: 6e 20 69 6e 66 69 6e 69 74 65 20 6c 6f 6f 70 20 n infinite loop
0370: 69 66 20 64 61 74 61 20 69 73 20 65 76 65 72 20 if data is ever
0380: 62 75 66 66 65 72 65 64 20 69 6e 20 74 68 65 20 buffered in the
0390: 42 49 4f 0a 09 73 74 72 75 63 74 75 72 65 2e 20 BIO..structure.
03a0: 5b 42 75 67 3a 20 35 36 32 33 5d 0a 0a 32 30 30 [Bug: 5623]..200
03b0: 30 2d 30 35 2d 33 31 20 20 42 72 65 6e 74 20 57 0-05-31 Brent W
03c0: 65 6c 63 68 20 3c 77 65 6c 63 68 40 73 63 72 69 elch <welch@scri
03d0: 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 ptics.com>...* t
03e0: 6c 73 2e 63 3a 20 43 68 61 6e 67 65 20 74 68 65 ls.c: Change the
03f0: 20 43 68 61 6e 6e 65 6c 48 61 6e 64 6c 65 72 20 ChannelHandler
0400: 74 6f 20 62 65 20 72 65 67 69 73 74 65 72 65 64 to be registered
0410: 20 6f 6e 20 74 68 65 20 6d 61 69 6e 0a 09 63 68 on the main..ch
0420: 61 6e 6e 65 6c 20 61 73 20 6f 70 70 73 65 64 20 annel as oppsed
0430: 74 6f 20 74 68 65 20 22 70 61 72 65 6e 74 22 2c to the "parent",
0440: 20 6f 72 20 73 75 70 65 72 63 65 65 64 65 64 2c or superceeded,
0450: 20 63 68 61 6e 6e 65 6c 2e 20 20 54 68 69 73 0a channel. This.
0460: 09 69 73 20 62 65 63 61 75 73 65 20 74 68 65 20 .is because the
0470: 73 6f 63 6b 65 74 20 64 72 69 76 65 72 20 6e 6f socket driver no
0480: 74 69 66 69 65 73 20 74 68 65 20 6d 61 69 6e 20 tifies the main
0490: 63 68 61 6e 6e 65 6c 2c 20 61 6e 64 20 74 68 65 channel, and the
04a0: 72 65 0a 09 61 72 65 20 74 69 6d 65 73 20 77 69 re..are times wi
04b0: 74 68 20 74 68 65 20 6d 61 69 6e 20 63 68 61 6e th the main chan
04c0: 6e 65 6c 20 67 65 74 73 20 63 6c 6f 73 65 64 2c nel gets closed,
04d0: 20 62 75 74 20 74 68 65 20 73 75 70 65 72 63 65 but the superce
04e0: 64 65 64 0a 09 6f 6e 65 20 69 73 20 6e 6f 74 20 ded..one is not
04f0: 79 65 74 20 63 6c 6f 73 65 64 2e 20 20 49 66 20 yet closed. If
0500: 74 68 65 20 63 68 61 6e 6e 65 6c 20 68 61 6e 64 the channel hand
0510: 6c 65 72 20 67 65 74 73 20 74 72 69 67 67 65 72 ler gets trigger
0520: 65 64 20 69 6e 0a 09 74 68 69 73 20 68 61 6c 66 ed in..this half
0530: 2d 6f 70 65 6e 20 73 74 61 74 65 20 69 74 20 69 -open state it i
0540: 73 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 s associated wit
0550: 68 20 74 68 65 20 73 75 70 65 72 63 65 65 64 65 h the superceede
0560: 64 0a 09 63 68 61 6e 6e 65 64 6c 2c 20 62 75 74 d..channedl, but
0570: 20 75 73 65 73 20 69 74 73 20 70 72 69 76 61 74 uses its privat
0580: 65 20 70 6f 69 6e 74 65 72 20 74 6f 20 74 68 65 e pointer to the
0590: 20 6d 61 69 6e 20 63 68 61 6e 6e 65 6c 2c 20 77 main channel, w
05a0: 68 69 63 68 0a 09 69 73 20 6d 6f 73 74 6c 79 20 hich..is mostly
05b0: 64 65 73 74 72 6f 79 65 64 2e 20 20 45 6c 69 6d destroyed. Elim
05c0: 69 6e 61 74 65 64 20 74 68 65 20 72 65 64 75 6e inated the redun
05d0: 64 61 6e 74 20 63 61 6c 6c 20 74 6f 0a 09 54 63 dant call to..Tc
05e0: 6c 5f 4e 6f 74 69 66 79 43 68 61 6e 6e 65 6c 20 l_NotifyChannel
05f0: 66 72 6f 6d 20 54 6c 73 57 61 74 63 68 50 72 6f from TlsWatchPro
0600: 63 2e 20 5b 42 75 67 3a 20 35 36 32 33 5d 0a c. [Bug: 5623].