/* 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 */
* 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;
*/
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;
}
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;
}