coverity 181576: remove dead code to keep coverity happy
[platform/upstream/libwebsockets.git] / lib / client.c
index 5a57d18..c523459 100755 (executable)
@@ -42,7 +42,12 @@ lws_handshake_client(struct lws *wsi, unsigned char **buf, size_t len)
                                return 0;
                        }
                        if (wsi->u.ws.rx_draining_ext) {
-                               m = lws_rx_sm(wsi, 0);
+#if !defined(LWS_NO_CLIENT)
+                               if (wsi->mode == LWSCM_WS_CLIENT)
+                                       m = lws_client_rx_sm(wsi, 0);
+                               else
+#endif
+                                       m = lws_rx_sm(wsi, 0);
                                if (m < 0)
                                        return -1;
                                continue;
@@ -568,7 +573,7 @@ lws_http_transaction_completed_client(struct lws *wsi)
 
        /* we don't support chained client connections yet */
        return 1;
-
+#if 0
        /* otherwise set ourselves up ready to go again */
        wsi->state = LWSS_CLIENT_HTTP_ESTABLISHED;
        wsi->mode = LWSCM_HTTP_CLIENT_ACCEPTED;
@@ -583,7 +588,7 @@ lws_http_transaction_completed_client(struct lws *wsi)
         * we can drop the ah, if any
         */
        if (wsi->u.hdr.ah) {
-               wsi->u.hdr.ah->rxpos = wsi->u.hdr.ah->rxlen;
+               lws_header_table_force_to_detachable_state(wsi);
                lws_header_table_detach(wsi, 0);
        }
 
@@ -593,6 +598,7 @@ lws_http_transaction_completed_client(struct lws *wsi)
        lwsl_info("%s: %p: keep-alive await new transaction\n", __func__, wsi);
 
        return 0;
+#endif
 }
 
 LWS_VISIBLE LWS_EXTERN unsigned int
@@ -784,7 +790,7 @@ lws_client_interpret_server_handshake(struct lws *wsi)
 
                if (lws_hdr_total_length(wsi, WSI_TOKEN_HTTP_CONTENT_LENGTH)) {
                        wsi->u.http.content_length =
-                                       atoi(lws_hdr_simple_ptr(wsi,
+                                       atoll(lws_hdr_simple_ptr(wsi,
                                                WSI_TOKEN_HTTP_CONTENT_LENGTH));
                        lwsl_notice("%s: incoming content length %llu\n", __func__,
                                        (unsigned long long)wsi->u.http.content_length);
@@ -1258,7 +1264,7 @@ lws_generate_client_handshake(struct lws *wsi, char *pkt)
                                wsi->user_space, NULL, 0))
                        return NULL;
 
-               wsi->u.hdr.ah->rxpos = wsi->u.hdr.ah->rxlen;
+               lws_header_table_force_to_detachable_state(wsi);
                lws_union_transition(wsi, LWSCM_RAW);
                lws_header_table_detach(wsi, 1);