workaround-32bit-size_t.patch
authorAndy Green <andy@warmcat.com>
Thu, 27 Jan 2011 06:45:53 +0000 (06:45 +0000)
committerAndy Green <andy@warmcat.com>
Thu, 27 Jan 2011 06:45:53 +0000 (06:45 +0000)
Signed-off-by: Andy Green <andy@warmcat.com>
lib/parsers.c
libwebsockets.spec

index 8d56221..d023e9b 100644 (file)
@@ -442,22 +442,32 @@ static int libwebsocket_rx_sm(struct libwebsocket *wsi, unsigned char c)
                        /* kill the connection */
                        return -1;
                }
+#if defined __LP64__
                wsi->rx_packet_length = ((size_t)c) << 56;
+#else
+               wsi->rx_packet_length = 0;
+#endif
                wsi->lws_rx_parse_state = LWS_RXPS_04_FRAME_HDR_LEN64_7;
                break;
 
        case LWS_RXPS_04_FRAME_HDR_LEN64_7:
+#if defined __LP64__
                wsi->rx_packet_length |= ((size_t)xor_mask(wsi, c)) << 48;
+#endif
                wsi->lws_rx_parse_state = LWS_RXPS_04_FRAME_HDR_LEN64_6;
                break;
 
        case LWS_RXPS_04_FRAME_HDR_LEN64_6:
+#if defined __LP64__
                wsi->rx_packet_length |= ((size_t)xor_mask(wsi, c)) << 40;
+#endif
                wsi->lws_rx_parse_state = LWS_RXPS_04_FRAME_HDR_LEN64_5;
                break;
 
        case LWS_RXPS_04_FRAME_HDR_LEN64_5:
+#if defined __LP64__
                wsi->rx_packet_length |= ((size_t)xor_mask(wsi, c)) << 32;
+#endif
                wsi->lws_rx_parse_state = LWS_RXPS_04_FRAME_HDR_LEN64_4;
                break;
 
@@ -742,22 +752,32 @@ int libwebsocket_client_rx_sm(struct libwebsocket *wsi, unsigned char c)
                        /* kill the connection */
                        return -1;
                }
+#if defined __LP64__
                wsi->rx_packet_length = ((size_t)c) << 56;
+#else
+               wsi->rx_packet_length =0;
+#endif
                wsi->lws_rx_parse_state = LWS_RXPS_04_FRAME_HDR_LEN64_7;
                break;
 
        case LWS_RXPS_04_FRAME_HDR_LEN64_7:
+#if defined __LP64__
                wsi->rx_packet_length |= ((size_t)c) << 48;
+#endif
                wsi->lws_rx_parse_state = LWS_RXPS_04_FRAME_HDR_LEN64_6;
                break;
 
        case LWS_RXPS_04_FRAME_HDR_LEN64_6:
+#if defined __LP64__
                wsi->rx_packet_length |= ((size_t)c) << 40;
+#endif
                wsi->lws_rx_parse_state = LWS_RXPS_04_FRAME_HDR_LEN64_5;
                break;
 
        case LWS_RXPS_04_FRAME_HDR_LEN64_5:
+#if defined __LP64__
                wsi->rx_packet_length |= ((size_t)c) << 32;
+#endif
                wsi->lws_rx_parse_state = LWS_RXPS_04_FRAME_HDR_LEN64_4;
                break;
 
index de0c003..e2e489e 100644 (file)
@@ -1,6 +1,6 @@
 Name: libwebsockets
 Version: 0.1
-Release: 41.gmaster_91ef816b%{?dist}
+Release: 43.gmaster_b6e6ebee%{?dist}
 Summary: Websocket Server Library
 
 Group: System