Changeset a92c4fff8f7690496c9fa11cf99a7c494012c72f

Show
Ignore:
Timestamp:
21/08/07 21:16:09 (1 year ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1187723769 +0000
git-parent:

[649ddb6f6488e80fd2a14f5c0899474679a00af7]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1187723769 +0000
Message:

- Do not parse CSeq; do not assume it fits in an integer
- Factorize some code

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/stream_out/rtp.c

    r649ddb6 ra92c4ff  
    16271627    const char *psz_session = NULL; 
    16281628    const char *psz_cseq = NULL; 
    1629     int i_cseq = 0; 
    16301629 
    16311630    if( answer == NULL || query == NULL ) 
     
    16381637    answer->i_version= query->i_version; 
    16391638    answer->i_type   = HTTPD_MSG_ANSWER; 
     1639    answer->i_body = 0; 
     1640    answer->p_body = NULL; 
    16401641 
    16411642    switch( query->i_type ) 
     
    16581659            /* for now only multicast so easy */ 
    16591660            answer->i_status = 200; 
    1660             answer->i_body = 0; 
    1661             answer->p_body = NULL; 
    16621661 
    16631662            psz_session = httpd_MsgGet( query, "Session" ); 
     
    16991698            /* for now only multicast so easy again */ 
    17001699            answer->i_status = 200; 
    1701             answer->i_body = 0; 
    1702             answer->p_body = NULL; 
    17031700 
    17041701            psz_session = httpd_MsgGet( query, "Session" ); 
     
    17351732            return VLC_EGENERIC; 
    17361733    } 
     1734 
    17371735    httpd_MsgAdd( answer, "Server", PACKAGE_STRING ); 
    17381736    httpd_MsgAdd( answer, "Content-Length", "%d", answer->i_body ); 
    17391737    psz_cseq = httpd_MsgGet( query, "Cseq" ); 
    1740     if( psz_cseq ) 
    1741         i_cseq = atoi( psz_cseq ); 
    1742     else 
    1743         i_cseq = 0; 
    1744     httpd_MsgAdd( answer, "Cseq", "%d", i_cseq ); 
     1738    httpd_MsgAdd( answer, "Cseq", "%u", psz_cseq ? psz_cseq : "0" ); 
    17451739    httpd_MsgAdd( answer, "Cache-Control", "%s", "no-cache" ); 
    17461740 
     
    17601754    const char *psz_session = NULL; 
    17611755    const char *psz_cseq = NULL; 
    1762     int  i_cseq = 0; 
    17631756 
    17641757 
     
    17741767    answer->i_version= query->i_version; 
    17751768    answer->i_type   = HTTPD_MSG_ANSWER; 
     1769    answer->i_body = 0; 
     1770    answer->p_body = NULL; 
    17761771 
    17771772    switch( query->i_type ) 
     
    17831778            { 
    17841779                answer->i_status = 461; 
    1785                 answer->i_body = 0; 
    1786                 answer->p_body = NULL; 
    17871780                break; 
    17881781            } 
     
    17941787                //fprintf( stderr, "HTTPD_MSG_SETUP: multicast\n" ); 
    17951788                answer->i_status = 200; 
    1796                 answer->i_body = 0; 
    1797                 answer->p_body = NULL; 
    17981789 
    17991790                psz_session = httpd_MsgGet( query, "Session" ); 
     
    18181809                { 
    18191810                    answer->i_status = 500; 
    1820                     answer->i_body = 0; 
    1821                     answer->p_body = NULL; 
    18221811                    break; 
    18231812                } 
     
    18371826                    { 
    18381827                        answer->i_status = 454; 
    1839                         answer->i_body = 0; 
    1840                         answer->p_body = NULL; 
    18411828                        break; 
    18421829                    } 
     
    18591846                             psz_access, psz_url ); 
    18601847                    answer->i_status = 500; 
    1861                     answer->i_body = 0; 
    1862                     answer->p_body = NULL; 
    18631848                    break; 
    18641849                } 
     
    18681853 
    18691854                answer->i_status = 200; 
    1870                 answer->i_body = 0; 
    1871                 answer->p_body = NULL; 
    18721855 
    18731856                httpd_MsgAdd( answer, "Transport", 
     
    18771860            { 
    18781861                answer->i_status = 461; 
    1879                 answer->i_body = 0; 
    1880                 answer->p_body = NULL; 
    18811862            } 
    18821863            break; 
     
    18861867            return VLC_EGENERIC; 
    18871868    } 
     1869 
    18881870    httpd_MsgAdd( answer, "Server", "VLC Server" ); 
    18891871    httpd_MsgAdd( answer, "Content-Length", "%d", answer->i_body ); 
    18901872    psz_cseq = httpd_MsgGet( query, "Cseq" ); 
    1891     if( psz_cseq ) 
    1892         i_cseq = atoi( psz_cseq ); 
    1893     else 
    1894         i_cseq = 0; 
    1895     httpd_MsgAdd( answer, "Cseq", "%d", i_cseq ); 
     1873    httpd_MsgAdd( answer, "Cseq", "%s", psz_cseq ? psz_cseq : "0"); 
    18961874    httpd_MsgAdd( answer, "Cache-Control", "%s", "no-cache" ); 
    18971875 
  • src/network/httpd.c

    r649ddb6 ra92c4ff  
    12971297    msg->i_body_offset = 0; 
    12981298    msg->i_body        = 0; 
    1299     msg->p_body        = 0
     1299    msg->p_body        = NULL
    13001300} 
    13011301