clean small additional ifdef reduction

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2014-04-03 10:11:04 +08:00
parent aad2eac48e
commit b49a995a8d
4 changed files with 3 additions and 23 deletions

View file

@ -217,17 +217,8 @@ libwebsocket_create_context(struct lws_context_creation_info *info)
#ifndef LWS_NO_EXTENSIONS
context->extensions = info->extensions;
#endif
context->last_timeout_check_s = 0;
context->user_space = info->user;
#ifdef LWS_OPENSSL_SUPPORT
context->use_ssl = 0;
context->allow_non_ssl_on_ssl_port = 0;
context->ssl_ctx = NULL;
context->ssl_client_ctx = NULL;
openssl_websocket_private_data_index = 0;
#endif
strcpy(context->canonical_hostname, "unknown");
#ifndef LWS_NO_SERVER
@ -269,11 +260,10 @@ libwebsocket_create_context(struct lws_context_creation_info *info)
#endif
}
if (context->http_proxy_address[0]) {
if (context->http_proxy_address[0])
lwsl_notice(" Proxy %s:%u\n",
context->http_proxy_address,
context->http_proxy_port);
}
#ifndef LWS_NO_SERVER
if (info->port != CONTEXT_PORT_NO_LISTEN) {

View file

@ -231,15 +231,6 @@ handle_truncated_send:
return n;
}
#ifdef LWS_NO_EXTENSIONS
int
lws_issue_raw_ext_access(struct libwebsocket *wsi,
unsigned char *buf, size_t len)
{
return lws_issue_raw(wsi, buf, len);
}
#endif
/**
* libwebsocket_write() - Apply protocol then write data to client
* @wsi: Websocket instance (available from user callback)

View file

@ -668,6 +668,7 @@ lws_ext_callback_for_each_extension_type(
#define lws_any_extension_handled(_a, _b, _c, _d, _e) (0)
#define lws_ext_callback_for_each_active(_a, _b, _c, _d) (0)
#define lws_ext_callback_for_each_extension_type(_a, _b, _c, _d, _e) (0)
#define lws_issue_raw_ext_access lws_issue_raw
#endif
LWS_EXTERN int
@ -762,6 +763,7 @@ LWS_EXTERN int openssl_websocket_private_data_index;
LWS_EXTERN int lws_handshake_server(struct libwebsocket_context *context,
struct libwebsocket *wsi, unsigned char **buf, size_t len);
#else
#define lws_server_socket_service(_a, _b, _c) (0)
#define _libwebsocket_rx_flow_control(_a) (0)
#define lws_handshake_server(_a, _b, _c, _d) (0)
#endif

View file

@ -335,15 +335,12 @@ libwebsocket_service_fd(struct libwebsocket_context *context,
/* okay, what we came here to do... */
switch (wsi->mode) {
#ifndef LWS_NO_SERVER
case LWS_CONNMODE_HTTP_SERVING:
case LWS_CONNMODE_HTTP_SERVING_ACCEPTED:
case LWS_CONNMODE_SERVER_LISTENER:
case LWS_CONNMODE_SSL_ACK_PENDING:
n = lws_server_socket_service(context, wsi, pollfd);
goto handled;
#endif
case LWS_CONNMODE_WS_SERVING:
case LWS_CONNMODE_WS_CLIENT: