Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 32

Thread: file_to_map needs https handling?

  1. #1
    Senior Member
    Join Date
    Apr 2009
    Posts
    1,750

    Default file_to_map needs https handling?

    In DataFileCache, we have:
    Code:
    	public static BufferedReader getReader( final String filename )
    	{
    		if ( filename.startsWith( "http://" ) )
    		{
    			return DataUtilities.getReader( "", filename );
    		}
    		byte[] data = DataFileCache.getBytes( filename );
    
    		return DataUtilities.getReader( new ByteArrayInputStream( data ) );
    	}
    That looks like mafia knows that http:// files are not local files, but not that https:// files are not local files.

    I added || filename.startsWith( "https://" ) here and in DataUtilities.getReader, and that seems to have done the trick.

  2. #2
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    D.C. suburbs of Virginia, USA
    Posts
    3,800

    Default

    In DataFileCache, we have:
    Code:
    	public static BufferedReader getReader( final String filename )
    	{
    		if ( filename.startsWith( "http://" ) )
    		{
    			return DataUtilities.getReader( "", filename );
    		}
    		byte[] data = DataFileCache.getBytes( filename );
    
    		return DataUtilities.getReader( new ByteArrayInputStream( data ) );
    	}
    That looks like mafia knows that http:// files are not local files, but not that https:// files are not local files.

    I added || filename.startsWith( "https://" ) here and in DataUtilities.getReader, and that seems to have done the trick.
    Originally Posted by xKiv View Post
    r18242. Only lightly tested.
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post
    There are 69 players more powerful than you.
    Originally Posted by Statistics Leaderboards

  3. #3
    Senior Member AlbinoRhino's Avatar
    Join Date
    May 2008
    Posts
    707

    Default

    r18242. Only lightly tested.
    Originally Posted by fronobulax View Post
    Working for me now.

  4. #4
    Senior Member
    Join Date
    Feb 2010
    Posts
    880

    Default

    r18243 - This may be an unintended side-effect of this change. Got the following in the gCLI when I logged in this morning:
    Code:
    (file not found)
    0 prices updated from http://kolmafia.us/scripts/updateprices.php?action=getmap

  5. #5
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    D.C. suburbs of Virginia, USA
    Posts
    3,800

    Default

    r18243 - This may be an unintended side-effect of this change. Got the following in the gCLI when I logged in this morning:
    Code:
    (file not found)
    0 prices updated from http://kolmafia.us/scripts/updateprices.php?action=getmap
    Originally Posted by Magus_Prime View Post
    I saw it too so I will check.
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post
    There are 69 players more powerful than you.
    Originally Posted by Statistics Leaderboards

  6. #6

    Default

    That is strange. (file not found) appears exactly once, in MallPriceDatabase. The URL causing that message is http://kolmafia.us/scripts/updatepri...?action=getmap, which should be completely unaffected by the change.

  7. #7
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    D.C. suburbs of Virginia, USA
    Posts
    3,800

    Default

    Work in progress...

    Ye Olde Debugger says I'm getting a 403 from http://kolmafia.us/scripts/updatepri...?action=getmap which is not true if I hit the URL in a browser. There was a new Java update a couple days ago so I'm going to see whether I can point a finger at that.
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post
    There are 69 players more powerful than you.
    Originally Posted by Statistics Leaderboards

  8. #8
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    D.C. suburbs of Virginia, USA
    Posts
    3,800

    Default

    I did a partial revert. Prices are being updated again. If anyone has a non-versioned (in the mafia sense of versions and data overrides) file accessed via http: and https: I will dig deeper.

    I thought the problem might be that /lib/net/java/dev/spellcast/utilities/DataUtilities.java was trying to create an Http connection with an Https URL but my quick fix broke the price update. My "fix" might not have been correct, however. I don't think the Java update is a factor. I wonder whether data overrides is playing into this.

    But mostly, I need to be elsewhere for a couple hours and did not want to leave the price update broken.
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post
    There are 69 players more powerful than you.
    Originally Posted by Statistics Leaderboards

  9. #9
    Senior Member
    Join Date
    Apr 2009
    Posts
    1,750

    Default

    That's weird, because without that there in DataUtilities, I was getting errors when batbrain tried to update batfactors.txt. Because you can't get a https:// url's content from filesystem.
    Is price updating doing some weird stuff with putting the url on a class loader or override streams?

  10. #10
    Senior Member AlbinoRhino's Avatar
    Join Date
    May 2008
    Posts
    707

    Default

    I am running r18243 (before the revert) as well as the newest Java.

    PHP Code:
    Festival of Jarlsberg tomorrowMoxie bonus today and tomorrow.
    Using     data overridedata/mallprices.txt
    2048 prices updated from     http
    ://kolmafia.us/scripts/updateprices.php?action=getmap 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •