wsi->state = WSI_STATE_ESTABLISHED;
wsi->mode = LWS_CONNMODE_WS_CLIENT;
- fprintf(stderr, "handshake OK for protocol %s\n", wsi->protocol->name);
+ debug("handshake OK for protocol %s\n", wsi->protocol->name);
/* call him back to inform him he is up */
protocols[context->count_protocols].callback;
context->count_protocols++) {
- fprintf(stderr, " Protocol: %s\n",
- protocols[context->count_protocols].name);
+ debug(" Protocol: %s\n", protocols[context->count_protocols].name);
protocols[context->count_protocols].owning_server = context;
protocols[context->count_protocols].protocol_index =
if (port)
m = LWS_EXT_CALLBACK_SERVER_CONTEXT_CONSTRUCT;
while (extensions->callback) {
- fprintf(stderr, " Extension: %s\n", extensions->name);
+ debug(" Extension: %s\n", extensions->name);
extensions->callback(context, extensions,
NULL, m, NULL, NULL, 0);
extensions++;
* fine he has told us he is closing too, let's
* finish our close
*/
- fprintf(stderr, "seen client close ack\n");
+ debug("seen client close ack\n");
return -1;
}
debug("server sees client close packet\n");
debug("seen server's close ack\n");
return -1;
}
- fprintf(stderr, "client sees server close packet "
- "len = %d\n", wsi->rx_user_buffer_head);
+ debug("client sees server close packet len = %d\n", wsi->rx_user_buffer_head);
/* parrot the close packet payload back */
n = libwebsocket_write(wsi, (unsigned char *)
&wsi->rx_user_buffer[LWS_SEND_BUFFER_PRE_PADDING],
wsi->rx_user_buffer_head, LWS_WRITE_CLOSE);
- fprintf(stderr, "client writing close "
- "ack returned %d\n", n);
+ debug("client writing close ack returned %d\n", n);
wsi->state = WSI_STATE_RETURNED_CLOSE_ALREADY;
/* close the connection */
return -1;