OwnCode/HttpFetcher/http-fetcher-orig/HttpFetcher.cpp
/*
 * Changes the Referer.  Returns 0 on success, -1 on error
 */
Changes the Referer.  Returns 0 on success, -1 on error
Changes the Referer . Returns 0 on success - 1 on error
int http_setReferer(const char *newReferer)
{
    static int freeOldReferer = 0; 
    char *tmp;
    if (newReferer == NULL) {
        if (freeOldReferer) free(referer);
        referer = NULL;
        hideReferer = 1;
    } else {
        tmp = (char *)malloc(strlen(newReferer));
        if (tmp == NULL) {
            errorSource = ERRNO;
            return -1;
        }
        if (freeOldReferer) free(referer);
        referer = tmp;
        strcpy(referer, newReferer);
        freeOldReferer = 1;
        hideReferer = 0;
    }
    return 0;
}
int http_setReferer ( const char * newReferer ) { static int freeOldReferer = 0 ; char * tmp ; if ( newReferer == NULL ) { if ( freeOldReferer ) free ( referer ) ; referer = NULL ; hideReferer = 1 ; } else { tmp = ( char * ) malloc ( strlen ( newReferer ) ) ; if ( tmp == NULL ) { errorSource = ERRNO ; return -1 ; } if ( freeOldReferer ) free ( referer ) ; referer = tmp ; strcpy ( referer , newReferer ) ; freeOldReferer = 1 ; hideReferer = 0 ; } return 0 ; }
Changes the Referer.
Changes the Referer .
/* Indicated previous malloc's */