Modify

Opened 9 years ago

Closed 9 years ago

#12265 closed enhancement (fixed)

[Patch] Use HttpClient for imagery requests

Reported by: simon04 Owned by: team
Priority: normal Milestone: 16.01
Component: Core imagery Version:
Keywords: http Cc: wiktorn

Description

Since #12231 we have a HttpClient which encapsulates HttpURLConnection and is used throughout the code.

JCSCachedTileLoaderJob and TMSCachedTileLoaderJob could also make use of this class. Any concerns or objections?

Attachments (1)

12265.patch (10.5 KB ) - added by simon04 9 years ago.

Download all attachments as: .zip

Change History (7)

by simon04, 9 years ago

Attachment: 12265.patch added

comment:1 by wiktorn, 9 years ago

There is one thing I do not understand - line 333/324 - why have you changed 304 to 302?

Also you've removed 323/322 - logging of requests at INFO level, which was requested in separate ticket.

in reply to:  1 comment:2 by simon04, 9 years ago

Replying to wiktorn:

There is one thing I do not understand - line 333/324 - why have you changed 304 to 302?

By mistake. I first put in some HttpURLConnection constants, but for a shorter diff I went back to a wrong integer numeral …

Also you've removed 323/322 - logging of requests at INFO level, which was requested in separate ticket.

Logging is done in org.openstreetmap.josm.tools.HttpClient#connect(org.openstreetmap.josm.gui.progress.ProgressMonitor)

comment:3 by simon04, 9 years ago

What I wanted to ask: in JCSCachedTileLoaderJob#loadObject, is there a reason not to use JCSCachedTileLoaderJob#getURLConnection for getting and filling the URL connection – see my todo?

comment:4 by Don-vip, 9 years ago

Component: CoreCore imagery
Keywords: http added

in reply to:  3 comment:5 by wiktorn, 9 years ago

Replying to simon04:

What I wanted to ask: in JCSCachedTileLoaderJob#loadObject, is there a reason not to use JCSCachedTileLoaderJob#getURLConnection for getting and filling the URL connection – see my todo?

getURLConnection does the cache setting and pass headers provided by client (such as custom HTTP headers for tiles / WMS). This avoids some code duplication, as we are calling this function in few places, so IMO it's good to leave it. So use getUrlConnection in your TODO place.

comment:6 by simon04, 9 years ago

Resolution: fixed
Status: newclosed

In 9232/josm:

fix #12265 - Use HttpClient for imagery requests

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.