[asterisk-commits] rizzo: branch rizzo/astobj2 r45887 - in
/team/rizzo/astobj2: ./ main/
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Sun Oct 22 10:09:12 MST 2006
Author: rizzo
Date: Sun Oct 22 12:09:11 2006
New Revision: 45887
URL: http://svn.digium.com/view/asterisk?rev=45887&view=rev
Log:
add ssl support on linux using fopencookie()
Modified:
team/rizzo/astobj2/configure.ac
team/rizzo/astobj2/main/http.c
Modified: team/rizzo/astobj2/configure.ac
URL: http://svn.digium.com/view/asterisk/team/rizzo/astobj2/configure.ac?rev=45887&r1=45886&r2=45887&view=diff
==============================================================================
--- team/rizzo/astobj2/configure.ac (original)
+++ team/rizzo/astobj2/configure.ac Sun Oct 22 12:09:11 2006
@@ -252,6 +252,7 @@
AC_CHECK_FUNCS([asprintf atexit bzero dup2 endpwent floor ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday inet_ntoa isascii localtime_r memchr memmove memset mkdir munmap pow putenv re_comp regcomp rint select setenv socket sqrt strcasecmp strcasestr strchr strcspn strdup strerror strncasecmp strndup strnlen strrchr strsep strspn strstr strtol strtoq unsetenv utime vasprintf])
AC_CHECK_FUNCS([funopen])
+AC_CHECK_FUNCS([fopencookie])
AC_MSG_CHECKING(for compiler atomic operations)
AC_LINK_IFELSE(
Modified: team/rizzo/astobj2/main/http.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/astobj2/main/http.c?rev=45887&r1=45886&r2=45887&view=diff
==============================================================================
--- team/rizzo/astobj2/main/http.c (original)
+++ team/rizzo/astobj2/main/http.c Sun Oct 22 12:09:11 2006
@@ -64,7 +64,7 @@
* We declare most of ssl support variables unconditionally,
* because their number is small and this simplifies the code.
*/
-#if defined(HAVE_OPENSSL) && defined(HAVE_FUNOPEN)
+#if defined(HAVE_OPENSSL) && (defined(HAVE_FUNOPEN) || defined(HAVE_FOPENCOOKIE))
#define DO_SSL /* comment in/out if you want to support ssl */
#endif
@@ -463,6 +463,15 @@
SSL_free(cookie);
return 0;
}
+#if !defined(HAVE_FUNOPEN) && defined(HAVE_FOPENCOOKIE)
+cookie_io_functions_t myfunctions = {
+ (cookie_read_function_t*)ssl_read,
+ (cookie_write_function_t*)ssl_write,
+ (cookie_seek_function_t*)NULL,
+ (cookie_close_function_t*)ssl_close
+};
+
+#endif
#endif
static void *ast_httpd_helper_thread(void *data)
@@ -482,7 +491,13 @@
ast_verbose(" error setting up ssl connection");
goto done;
}
+#if defined(HAVE_FUNOPEN)
ser->f = funopen(ser->ssl, ssl_read, ssl_write, NULL, ssl_close);
+#elif defined(HAVE_FOPENCOOKIE)
+ ser->f = fopencookie(ser->ssl, "w+", myfunctions);
+#else
+#error missing funopen/fopencookie support
+#endif
} else
#endif
ser->f = fdopen(ser->fd, "w+");
More information about the asterisk-commits
mailing list