http2 fix build when http2 disabled
authorAndy Green <andy.green@linaro.org>
Wed, 8 Oct 2014 04:15:15 +0000 (12:15 +0800)
committerAndy Green <andy.green@linaro.org>
Wed, 8 Oct 2014 04:15:29 +0000 (12:15 +0800)
Signed-off-by: Andy Green <andy.green@linaro.org>
lib/handshake.c
lib/output.c
lib/service.c

index 5903557..f004ad0 100644 (file)
@@ -65,6 +65,7 @@ libwebsocket_read(struct libwebsocket_context *context,
        unsigned char *last_char;
 
        switch (wsi->state) {
+#ifdef LWS_USE_HTTP2
        case WSI_STATE_HTTP2_AWAIT_CLIENT_PREFACE:
        case WSI_STATE_HTTP2_ESTABLISHED_PRE_SETTINGS:
        case WSI_STATE_HTTP2_ESTABLISHED:
@@ -86,6 +87,7 @@ libwebsocket_read(struct libwebsocket_context *context,
                                goto bail;
                }
                break;
+#endif
 http_new:
        case WSI_STATE_HTTP:
                wsi->hdr_parsing_completed = 0;
index ccd02d7..ffe4c3c 100644 (file)
@@ -432,12 +432,14 @@ send_raw:
        case LWS_WRITE_HTTP_HEADERS:
        case LWS_WRITE_PONG:
        case LWS_WRITE_PING:
+#ifdef LWS_USE_HTTP2
                if (wsi->mode == LWS_CONNMODE_HTTP2_SERVING) {
                        n = LWS_HTTP2_FRAME_TYPE_DATA;
                        if (protocol == LWS_WRITE_HTTP_HEADERS)
                                n = LWS_HTTP2_FRAME_TYPE_HEADERS;
                        return lws_http2_frame_write(wsi, n, 0, wsi->u.http2.my_stream_id, len, buf);
                }
+#endif
                return lws_issue_raw(wsi, (unsigned char *)buf - pre,
                                                              len + pre + post);
        default:
index 160bda4..9ab0ea1 100644 (file)
@@ -47,10 +47,10 @@ lws_handle_POLLOUT_event(struct libwebsocket_context *context,
                        lwsl_info("***** %x signalling to close in POLLOUT handler\n", wsi);
                        return -1; /* retry closing now */
                }
-
+#ifdef LWS_USE_HTTP2
        /* protocol packets are next */
        if (wsi->pps) {
-               lwsl_err("servicing pps %d\n", wsi->pps);
+               lwsl_info("servicing pps %d\n", wsi->pps);
                switch (wsi->pps) {
                case LWS_PPS_HTTP2_MY_SETTINGS:
                case LWS_PPS_HTTP2_ACK_SETTINGS:
@@ -64,7 +64,7 @@ lws_handle_POLLOUT_event(struct libwebsocket_context *context,
                
                return 0; /* leave POLLOUT active */
        }
-               
+#endif
        /* pending control packets have next priority */
        
        if (wsi->state == WSI_STATE_ESTABLISHED && wsi->u.ws.ping_payload_len) {