src/client_ws.c
/** initialize a websocket client and return 0 on success */
initialize a websocket client and return 0 on success
initialize a websocket client and return 0 on success
int c_ws_init(client_st *cp)
{
    LOG_DEBUG("c_ws_init sd %d", cp->sd);
    client_ws_st *ws;
    ws = malloc(sizeof(client_ws_st));
    if (ws == NULL) {
        return 1;
    }
    memset(ws, 0, sizeof(client_ws_st));
    http_parser_init(&ws->http_parser, HTTP_REQUEST);
    ws->http_parser.data = cp;
    ws_parser_init(&ws->ws_parser);
    cp->ws = ws;
    return 0;
}
int c_ws_init ( client_st * cp ) { LOG_DEBUG ( " " , cp -> sd ) ; client_ws_st * ws ; ws = malloc ( sizeof ( client_ws_st ) ) ; if ( ws == NULL ) { return 1 ; } memset ( ws , 0 , sizeof ( client_ws_st ) ) ; http_parser_init ( & ws -> http_parser , HTTP_REQUEST ) ; ws -> http_parser . data = cp ; ws_parser_init ( & ws -> ws_parser ) ; cp -> ws = ws ; return 0 ; }
initialize a websocket client and return 0 on success
initialize a websocket client and return 0 on success