What is the mechanism of reaction of SOCl2 with alcohol?

Is it Sn2th or sn2 or Sni as mentioned in this video
youtube

It is very well explained over here

image