dish/src/dish.cxx
//------------------------------------------------------------------------------------------
// This static helper function will read a key value from the HTTP MIME-header line
//------------------------------------------------------------------------------------------
This static helper function will read a key value from the HTTP MIME-header line
This static helper function will read a key value from the HTTP MIME - header line
static char* GetValue(char* str) {
    static char value[1024];
    int j=0;
    int in_value = 0;
    for(int i = 0; i<1023; i++) {
        if(str[i]==0)   {
            while(j>0 && value[j-1]==' ') j--;
            value[j]=0;
            return value;
        }
        if(str[i]==':') {
            in_value = 1;
            i++;
            while(i<1023 && str[i]==' ' && str[i]!=0) i++;
        }
        if(in_value == 1)   value[j++]=str[i];
    }
    while(j>0 && value[j-1]==' ') j--;
    value[j]=0;
    return value;
}
static char * GetValue ( char * str ) { static char value [ 1024 ] ; int j = 0 ; int in_value = 0 ; for ( int i = 0 ; i < 1023 ; i ++ ) { if ( str [ i ] == 0 ) { while ( j > 0 && value [ j - 1 ] == ' ' ) j -- ; value [ j ] = 0 ; return value ; } if ( str [ i ] == ' ' ) { in_value = 1 ; i ++ ; while ( i < 1023 && str [ i ] == ' ' && str [ i ] != 0 ) i ++ ; } if ( in_value == 1 ) value [ j ++ ] = str [ i ] ; } while ( j > 0 && value [ j - 1 ] == ' ' ) j -- ; value [ j ] = 0 ; return value ; }
This static helper function will read a key value from the HTTP MIME-header line
This static helper function will read a key value from the HTTP MIME - header line