updated spec enabled ssl
[profile/ivi/libwebsockets.git] / lib / client.c
index 397d4e5..3da9326 100644 (file)
@@ -101,7 +101,7 @@ int lws_client_socket_service(struct libwebsocket_context *context,
                /* external POLL support via protocol 0 */
                context->protocols[0].callback(context, wsi,
                        LWS_CALLBACK_CLEAR_MODE_POLL_FD,
-                       (void *)(long)wsi->sock, NULL, POLLOUT);
+                       wsi->user_space, (void *)(long)wsi->sock, POLLOUT);
 
                /* we can retry this... just cook the SSL BIO the first time */
 
@@ -179,7 +179,8 @@ int lws_client_socket_service(struct libwebsocket_context *context,
                                 * run into the connection timeout or win
                                 */
 
-                               lwsl_err("SSL connect error %s\n",
+                               lwsl_err("SSL connect error %lu: %s\n", 
+                                       ERR_get_error(),
                                        ERR_error_string(ERR_get_error(),
                                              (char *)context->service_buffer));
                                return 0;
@@ -589,15 +590,14 @@ check_accept:
         */
 
        p = lws_hdr_simple_ptr(wsi, WSI_TOKEN_ACCEPT);
-       if (strcmp(p, wsi->u.hdr.initial_handshake_hash_base64)) {
+       if (strcmp(p, wsi->u.hdr.ah->initial_handshake_hash_base64)) {
                lwsl_warn("lws_client_int_s_hs: accept %s wrong vs %s\n", p,
-                                     wsi->u.hdr.initial_handshake_hash_base64);
+                                 wsi->u.hdr.ah->initial_handshake_hash_base64);
                goto bail2;
        }
 
        /* allocate the per-connection user memory (if any) */
-       if (wsi->protocol->per_session_data_size &&
-                                        !libwebsocket_ensure_user_space(wsi)) {
+       if (libwebsocket_ensure_user_space(wsi)) {
                lwsl_err("Problem allocating wsi user mem\n");
                goto bail2;
        }
@@ -845,8 +845,8 @@ libwebsockets_generate_client_handshake(struct libwebsocket_context *context,
        SHA1((unsigned char *)buf, n, (unsigned char *)hash);
 
        lws_b64_encode_string(hash, 20,
-                       wsi->u.hdr.initial_handshake_hash_base64,
-                            sizeof(wsi->u.hdr.initial_handshake_hash_base64));
+                       wsi->u.hdr.ah->initial_handshake_hash_base64,
+                         sizeof(wsi->u.hdr.ah->initial_handshake_hash_base64));
 
        return p;
 }