Also adds various error checks to make sure we always operate on a valid socket and sets a 5 second timeout on the SSL_write call in ws_close() to avoid waiting forever on something that isn't talking to us. Plus a check before SSL_read when the connection is marked down. There is one stray printf debug message left in this commit that should probably be turned into something more freeswitchish to log it somewhere better.
…R_SYSCALL and avoiding socket i/o if so
Also adds various error checks to make sure we always operate on a valid socket and sets a 5 second timeout on the SSL_write call in ws_close() to avoid waiting forever on something that isn't talking to us. Plus a check before SSL_read when the connection is marked down. There is one stray printf debug message left in this commit that should probably be turned into something more freeswitchish to log it somewhere better.