HttpResponseParser/http_response_parser.h
int http_parse_response_status_line(HttpResponse_t *h,char *request)
{
    char buffer[50] = {0};
    int pos = 0;

    while (request[pos] != '\r')
    {
        buffer[pos] = request[pos];
        pos++;
    }

    buffer[pos] = '\0';

    h->headers->status->status_line = malloc(sizeof(char) * pos+1);

    if (h->headers->status->status_line == NULL)
        return (0);
    
    strcpy(h->headers->status->status_line,buffer);

    if (http_parse_response_status_http_version(h,buffer) != 1)
        return (0);
    
    http_parse_response_status_code(h,buffer);

    if (http_parse_response_status_reason_phrase(h,buffer) != 1)
        return (0);
    
    return (1);
}
////////////////////////////////////////////////////////
// function for parse response status line
///////////////////////////////////////////////////////
function for parse response status line
function for parse response status line
int http_parse_response_status_line(HttpResponse_t *h,char *request)
{
    char buffer[50] = {0};
    int pos = 0;
    while (request[pos] != '\r')
    {
        buffer[pos] = request[pos];
        pos++;
    }
    buffer[pos] = '\0';
    h->headers->status->status_line = malloc(sizeof(char) * pos+1);
    if (h->headers->status->status_line == NULL)
        return (0);
    strcpy(h->headers->status->status_line,buffer);
    if (http_parse_response_status_http_version(h,buffer) != 1)
        return (0);
    http_parse_response_status_code(h,buffer);
    if (http_parse_response_status_reason_phrase(h,buffer) != 1)
        return (0);
    return (1);
}
int http_parse_response_status_line ( HttpResponse_t * h , char * request ) { char buffer [ 50 ] = { 0 } ; int pos = 0 ; while ( request [ pos ] != ' \r ' ) { buffer [ pos ] = request [ pos ] ; pos ++ ; } buffer [ pos ] = ' \0 ' ; h -> headers -> status -> status_line = malloc ( sizeof ( char ) * pos + 1 ) ; if ( h -> headers -> status -> status_line == NULL ) return ( 0 ) ; strcpy ( h -> headers -> status -> status_line , buffer ) ; if ( http_parse_response_status_http_version ( h , buffer ) != 1 ) return ( 0 ) ; http_parse_response_status_code ( h , buffer ) ; if ( http_parse_response_status_reason_phrase ( h , buffer ) != 1 ) return ( 0 ) ; return ( 1 ) ; }
function for parse response status line
function for parse response status line