Skip to content

Instantly share code, notes, and snippets.

@leedm777
Created July 5, 2013 20:24
Show Gist options
  • Save leedm777/5937009 to your computer and use it in GitHub Desktop.
Save leedm777/5937009 to your computer and use it in GitHub Desktop.
Index: include/asterisk/http_websocket.h
===================================================================
--- include/asterisk/http_websocket.h (revision 393739)
+++ include/asterisk/http_websocket.h (working copy)
@@ -22,6 +22,8 @@
#include "asterisk/http.h"
#include "asterisk/optional_api.h"
+#include <errno.h>
+
/*!
* \file http_websocket.h
* \brief Support for WebSocket connections within the Asterisk HTTP server.
@@ -230,6 +232,6 @@
* \retval 0 on success
* \retval -1 on failure
*/
-AST_OPTIONAL_API(int, ast_websocket_set_nonblock, (struct ast_websocket *session), {return -1;});
+AST_OPTIONAL_API(int, ast_websocket_set_nonblock, (struct ast_websocket *session), {ast_log(LOG_ERROR, "Optional API foolishness"); errno = ENOSYS; return -1;});
#endif
Index: res/res_http_websocket.c
===================================================================
--- res/res_http_websocket.c (revision 393739)
+++ res/res_http_websocket.c (working copy)
@@ -305,6 +305,8 @@
int flags;
if ((flags = fcntl(session->fd, F_GETFL)) == -1) {
+ ast_log(LOG_ERROR, "Error getting flags: %s\n",
+ strerror(errno));
return -1;
}
@@ -311,6 +313,8 @@
flags |= O_NONBLOCK;
if ((flags = fcntl(session->fd, F_SETFL, flags)) == -1) {
+ ast_log(LOG_ERROR, "Error setting flags: %s\n",
+ strerror(errno));
return -1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment