Modify

Opened 5 years ago

Closed 5 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 5 years ago.

Download all attachments as: .zip

Change History (7)

Changed 5 years ago by simon04

Attachment: 12265.patch added

comment:1 Changed 5 years ago by wiktorn

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.

comment:2 in reply to:  1 Changed 5 years ago by simon04

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 Changed 5 years ago by 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?

comment:4 Changed 5 years ago by Don-vip

Component: CoreCore imagery
Keywords: http added

comment:5 in reply to:  3 Changed 5 years ago by wiktorn

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 Changed 5 years ago by simon04

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.