Hex Artifact Content

Artifact e4ea6703950f087eaf56d52a81a83f5bf5a9647f:


0000: 32 30 30 30 2d 30 36 2d 30 35 20 20 53 63 6f 74  2000-06-05  Scot
0010: 74 20 53 74 61 6e 74 6f 6e 20 20 3c 73 74 61 6e  t Stanton  <stan
0020: 74 6f 6e 40 61 6a 75 62 61 73 6f 6c 75 74 69 6f  ton@ajubasolutio
0030: 6e 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 49  ns.com>...* tlsI
0040: 6e 74 2e 68 3a 20 0a 09 2a 20 74 6c 73 2e 63 3a  nt.h: ..* tls.c:
0050: 20 43 6c 65 61 6e 65 64 20 75 70 20 64 65 63 6c   Cleaned up decl
0060: 61 72 61 74 69 6f 6e 73 20 6f 66 20 54 6c 73 5f  arations of Tls_
0070: 43 6c 65 61 6e 20 74 6f 20 61 76 6f 69 64 20 65  Clean to avoid e
0080: 72 72 6f 72 73 20 6f 6e 0a 09 57 69 6e 64 6f 77  rrors on..Window
0090: 73 20 28 6c 69 6e 74 29 2e 0a 0a 32 30 30 30 2d  s (lint)...2000-
00a0: 30 36 2d 30 35 20 20 42 72 65 6e 74 20 57 65 6c  06-05  Brent Wel
00b0: 63 68 20 3c 77 65 6c 63 68 40 61 6a 75 62 61 73  ch <welch@ajubas
00c0: 6f 6c 75 74 69 6f 6e 73 2e 63 6f 6d 3e 0a 0a 09  olutions.com>...
00d0: 2a 20 74 6c 73 2e 63 2c 20 74 6c 73 49 4f 2e 63  * tls.c, tlsIO.c
00e0: 3a 20 20 53 70 6c 69 74 20 54 6c 73 5f 46 72 65  :  Split Tls_Fre
00f0: 65 20 69 6e 74 6f 20 54 6c 73 5f 43 6c 65 61 6e  e into Tls_Clean
0100: 2c 20 77 68 69 63 68 20 64 6f 65 73 0a 09 74 68  , which does..th
0110: 65 20 53 53 4c 20 63 6c 65 61 6e 75 70 2c 20 61  e SSL cleanup, a
0120: 6e 64 20 74 68 65 20 54 63 6c 5f 46 72 65 65 20  nd the Tcl_Free 
0130: 63 61 6c 6c 2e 20 20 49 74 20 69 73 20 69 6d 70  call.  It is imp
0140: 6f 72 74 61 6e 74 20 74 6f 20 73 68 75 74 64 6f  ortant to shutdo
0150: 77 6e 0a 09 74 68 65 20 53 53 4c 20 73 74 61 74  wn..the SSL stat
0160: 65 20 22 73 79 6e 63 68 72 6f 6e 6f 75 73 6c 79  e "synchronously
0170: 22 20 64 75 72 69 6e 67 20 61 20 73 74 61 63 6b  " during a stack
0180: 65 64 20 66 6c 75 73 68 2e 0a 0a 32 30 30 30 2d  ed flush...2000-
0190: 30 36 2d 30 31 20 20 53 63 6f 74 74 20 53 74 61  06-01  Scott Sta
01a0: 6e 74 6f 6e 20 20 3c 73 74 61 6e 74 6f 6e 40 61  nton  <stanton@a
01b0: 6a 75 62 61 73 6f 6c 75 74 69 6f 6e 73 2e 63 6f  jubasolutions.co
01c0: 6d 3e 0a 0a 09 2a 20 74 6c 73 49 4f 2e 63 3a 20  m>...* tlsIO.c: 
01d0: 52 65 73 74 6f 72 65 64 20 63 61 6c 6c 20 74 6f  Restored call to
01e0: 20 54 63 6c 5f 4e 6f 74 69 66 79 43 68 61 6e 6e   Tcl_NotifyChann
01f0: 65 6c 20 66 72 6f 6d 20 43 68 61 6e 6e 65 6c 48  el from ChannelH
0200: 61 6e 64 6c 65 72 0a 09 74 6f 20 65 6e 73 75 72  andler..to ensur
0210: 65 20 74 68 61 74 20 65 76 65 6e 74 73 20 70 72  e that events pr
0220: 6f 70 61 67 61 74 65 20 66 72 6f 6d 20 74 68 65  opagate from the
0230: 20 6c 6f 77 65 72 20 64 72 69 76 65 72 2e 20 20   lower driver.  
0240: 54 68 69 73 20 6d 61 79 0a 09 72 65 73 75 6c 74  This may..result
0250: 20 69 6e 20 61 6e 20 69 6e 66 69 6e 69 74 65 20   in an infinite 
0260: 6c 6f 6f 70 20 69 6e 20 73 6f 6d 65 20 63 61 73  loop in some cas
0270: 65 73 2c 20 73 6f 20 74 68 69 73 20 69 73 20 6e  es, so this is n
0280: 6f 74 20 61 20 74 6f 74 61 6c 0a 09 66 69 78 2e  ot a total..fix.
0290: 20 20 54 68 69 73 20 6d 61 79 20 62 65 20 73 75    This may be su
02a0: 66 66 69 63 69 65 6e 74 20 66 6f 72 20 6e 6f 77  fficient for now
02b0: 2c 20 68 6f 77 65 76 65 72 2e 20 5b 42 75 67 3a  , however. [Bug:
02c0: 20 35 36 32 33 5d 0a 0a 32 30 30 30 2d 30 36 2d   5623]..2000-06-
02d0: 30 31 20 20 53 63 6f 74 74 20 53 74 61 6e 74 6f  01  Scott Stanto
02e0: 6e 20 20 3c 73 74 61 6e 74 6f 6e 40 73 63 72 69  n  <stanton@scri
02f0: 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74  ptics.com>...* t
0300: 6c 73 49 4f 2e 63 3a 20 52 65 73 74 6f 72 65 20  lsIO.c: Restore 
0310: 74 68 65 20 70 72 65 76 69 6f 75 73 20 76 65 72  the previous ver
0320: 73 69 6f 6e 2e 20 20 46 69 78 65 64 20 74 68 65  sion.  Fixed the
0330: 20 43 6c 6f 73 65 50 72 6f 63 20 73 6f 0a 09 69   CloseProc so..i
0340: 74 20 75 6e 72 65 67 69 73 74 65 72 73 20 74 68  t unregisters th
0350: 65 20 63 68 61 6e 6e 65 6c 20 68 61 6e 64 6c 65  e channel handle
0360: 72 20 6f 6e 20 74 68 65 20 73 75 70 65 72 63 65  r on the superce
0370: 64 65 64 20 63 68 61 6e 6e 65 6c 0a 09 69 6e 73  ded channel..ins
0380: 74 65 61 64 20 6f 66 20 74 68 65 20 75 70 70 65  tead of the uppe
0390: 72 20 63 68 61 6e 6e 65 6c 2e 20 41 6c 73 6f 20  r channel. Also 
03a0: 72 65 6d 6f 76 65 64 20 74 68 65 20 63 61 6c 6c  removed the call
03b0: 20 74 6f 0a 09 54 63 6c 5f 4e 6f 74 69 66 79 43   to..Tcl_NotifyC
03c0: 68 61 6e 6e 65 6c 20 69 6e 20 74 68 65 20 43 68  hannel in the Ch
03d0: 61 6e 6e 65 6c 48 61 6e 64 6c 65 72 20 62 65 63  annelHandler bec
03e0: 61 75 73 65 20 74 68 69 73 20 77 69 6c 6c 20 72  ause this will r
03f0: 65 73 75 6c 74 0a 09 69 6e 20 61 6e 20 69 6e 66  esult..in an inf
0400: 69 6e 69 74 65 20 6c 6f 6f 70 20 69 66 20 64 61  inite loop if da
0410: 74 61 20 69 73 20 65 76 65 72 20 62 75 66 66 65  ta is ever buffe
0420: 72 65 64 20 69 6e 20 74 68 65 20 42 49 4f 0a 09  red in the BIO..
0430: 73 74 72 75 63 74 75 72 65 2e 20 5b 42 75 67 3a  structure. [Bug:
0440: 20 35 36 32 33 5d 0a 0a 32 30 30 30 2d 30 35 2d   5623]..2000-05-
0450: 33 31 20 20 42 72 65 6e 74 20 57 65 6c 63 68 20  31  Brent Welch 
0460: 3c 77 65 6c 63 68 40 73 63 72 69 70 74 69 63 73  <welch@scriptics
0470: 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 2e 63 3a  .com>...* tls.c:
0480: 20 43 68 61 6e 67 65 20 74 68 65 20 43 68 61 6e   Change the Chan
0490: 6e 65 6c 48 61 6e 64 6c 65 72 20 74 6f 20 62 65  nelHandler to be
04a0: 20 72 65 67 69 73 74 65 72 65 64 20 6f 6e 20 74   registered on t
04b0: 68 65 20 6d 61 69 6e 0a 09 63 68 61 6e 6e 65 6c  he main..channel
04c0: 20 61 73 20 6f 70 70 73 65 64 20 74 6f 20 74 68   as oppsed to th
04d0: 65 20 22 70 61 72 65 6e 74 22 2c 20 6f 72 20 73  e "parent", or s
04e0: 75 70 65 72 63 65 65 64 65 64 2c 20 63 68 61 6e  uperceeded, chan
04f0: 6e 65 6c 2e 20 20 54 68 69 73 0a 09 69 73 20 62  nel.  This..is b
0500: 65 63 61 75 73 65 20 74 68 65 20 73 6f 63 6b 65  ecause the socke
0510: 74 20 64 72 69 76 65 72 20 6e 6f 74 69 66 69 65  t driver notifie
0520: 73 20 74 68 65 20 6d 61 69 6e 20 63 68 61 6e 6e  s the main chann
0530: 65 6c 2c 20 61 6e 64 20 74 68 65 72 65 0a 09 61  el, and there..a
0540: 72 65 20 74 69 6d 65 73 20 77 69 74 68 20 74 68  re times with th
0550: 65 20 6d 61 69 6e 20 63 68 61 6e 6e 65 6c 20 67  e main channel g
0560: 65 74 73 20 63 6c 6f 73 65 64 2c 20 62 75 74 20  ets closed, but 
0570: 74 68 65 20 73 75 70 65 72 63 65 64 65 64 0a 09  the superceded..
0580: 6f 6e 65 20 69 73 20 6e 6f 74 20 79 65 74 20 63  one is not yet c
0590: 6c 6f 73 65 64 2e 20 20 49 66 20 74 68 65 20 63  losed.  If the c
05a0: 68 61 6e 6e 65 6c 20 68 61 6e 64 6c 65 72 20 67  hannel handler g
05b0: 65 74 73 20 74 72 69 67 67 65 72 65 64 20 69 6e  ets triggered in
05c0: 0a 09 74 68 69 73 20 68 61 6c 66 2d 6f 70 65 6e  ..this half-open
05d0: 20 73 74 61 74 65 20 69 74 20 69 73 20 61 73 73   state it is ass
05e0: 6f 63 69 61 74 65 64 20 77 69 74 68 20 74 68 65  ociated with the
05f0: 20 73 75 70 65 72 63 65 65 64 65 64 0a 09 63 68   superceeded..ch
0600: 61 6e 6e 65 64 6c 2c 20 62 75 74 20 75 73 65 73  annedl, but uses
0610: 20 69 74 73 20 70 72 69 76 61 74 65 20 70 6f 69   its private poi
0620: 6e 74 65 72 20 74 6f 20 74 68 65 20 6d 61 69 6e  nter to the main
0630: 20 63 68 61 6e 6e 65 6c 2c 20 77 68 69 63 68 0a   channel, which.
0640: 09 69 73 20 6d 6f 73 74 6c 79 20 64 65 73 74 72  .is mostly destr
0650: 6f 79 65 64 2e 20 20 45 6c 69 6d 69 6e 61 74 65  oyed.  Eliminate
0660: 64 20 74 68 65 20 72 65 64 75 6e 64 61 6e 74 20  d the redundant 
0670: 63 61 6c 6c 20 74 6f 0a 09 54 63 6c 5f 4e 6f 74  call to..Tcl_Not
0680: 69 66 79 43 68 61 6e 6e 65 6c 20 66 72 6f 6d 20  ifyChannel from 
0690: 54 6c 73 57 61 74 63 68 50 72 6f 63 2e 20 5b 42  TlsWatchProc. [B
06a0: 75 67 3a 20 35 36 32 33 5d 0a                    ug: 5623].