dish/src/dish.cxx
//-----------------------------------------------------------------------------------
// This static function will read HTTP request headers and will return data block 
// size or 0 if not available.
//-----------------------------------------------------------------------------------
This static function will read HTTP request headers and will return data block
size or 0 if not available.
This static function will read HTTP request headers and will return data block size or 0 if not available .
static int ReadHeaders(int socket) {
    int data_length = 0;
    char buf[1024];
    for(;;) {
        if(read_line(socket,buf,1024)==0) break;
        if(strlen(buf)==0) break;
        if(cmp(GetKey(buf),"CONTENT-LENGTH")) {
            char* value = GetValue(buf);
            data_length = atoi(value);
        }
    }
    return data_length;
}
static int ReadHeaders ( int socket ) { int data_length = 0 ; char buf [ 1024 ] ; for ( ; ; ) { if ( read_line ( socket , buf , 1024 ) == 0 ) break ; if ( strlen ( buf ) == 0 ) break ; if ( cmp ( GetKey ( buf ) , " " ) ) { char * value = GetValue ( buf ) ; data_length = atoi ( value ) ; } } return data_length ; }
This static function will read HTTP request headers and will return data block
size or 0 if not available.
This static function will read HTTP request headers and will return data block size or 0 if not available .