Avoiding segfault

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12323 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Mathieu Rene 2009-02-27 15:38:33 +00:00
parent 4957a3ef69
commit a58bdeac21
1 changed files with 3 additions and 3 deletions

View File

@ -381,8 +381,8 @@ ESL_DECLARE(char *)esl_url_decode(char *s)
static void sock_setup(esl_handle_t *handle)
{
#ifdef WIN32
BOOL bOptVal = TRUE;
int bOptLen = sizeof(BOOL);
BOOL bOptVal = TRUE;
int bOptLen = sizeof(BOOL);
setsockopt(handle->sock, IPPROTO_TCP, TCP_NODELAY, (const char *)&bOptVal, bOptLen);
#else
int x = 1;
@ -712,7 +712,7 @@ ESL_DECLARE(esl_status_t) esl_recv_event_timed(esl_handle_t *handle, uint32_t ms
int max, activity;
esl_status_t status = ESL_SUCCESS;
if (!handle->connected) {
if (!handle->connected || !handle || handle->sock == -1) {
return ESL_FAIL;
}