Closed Bug 26294 Opened 25 years ago Closed 3 years ago

Use of NS_OpenURI(nsIInputStream*,...) creates blocking stream.

Categories

(Core :: Internationalization, defect, P3)

x86
Windows NT
defect

Tracking

()

RESOLVED WORKSFORME
Future

People

(Reporter: jud, Assigned: nhottanscp)

Details

(Keywords: intl)

http://lxr.mozilla.org/seamonkey/source/intl/unicharutil/src/nsEntityConverter.c
pp#64 and 
http://lxr.mozilla.org/seamonkey/source/intl/unicharutil/src/nsEntityConverter.c
pp#124 show lines using the netUtil function that wraps an OpenInputStream() 
call. The result is that the user is handed an input stream to read data from. 
The inputStream->Read() call is a blocking call and can/will block the thread 
it's called on. If this steam is guaranteed to be read from a thread other than 
the UI thread, evaluate whether or not the blocking behavior is ok, and if so, 
close this bug. Otherwise, your code need to do an asynchronous load of the URI. 
If you don't want to implement nsIStreamListener, please look at 
nsIStreamLoader.idl which will call a callback function you implement when all 
the data has arrived (it does all the asyncronous work for you).
>If this steam is guaranteed to be read from a thread other than 
> the UI thread
I am not familiar with threading issues so need help. The interface is called 
for a text conversion. For mail, it is used to convert outgoing mail text. For 
ender, it is used to convert text to be saved. The inputSream is used for 
initialization (i.e., not used for every conversion call).
It seems to me the blocking behvaior is ok.
Resolving the bug since I think this is ok.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → WONTFIX
well I'm not sure this blocking behavior is ok. ender uses the UI thread. what 
kinds of data is this called on (andd what size)?
The data is for mapping a character code to an entity something like this.
entity.160= 
The interface read this once and store in a hash table.
The size is usually around 1k to 3k.
so this code opens the .properties URL (the file that has these mappings)?
yes, it opens .properties
so conceivably (actually likely) that properties file could reside on a server 
across the network. In this case this will block the UI hard. I think this 
should be fixed.
reopen
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
accepting, M15
Status: REOPENED → ASSIGNED
Target Milestone: M15
Target Milestone: M15 → M17
Target Milestone: M17 → Future
Keywords: intl
I am not a programmer, but no action in 4 years...
is NS_OpenURI(nsIInputStream*,...) still causing problems for anyone?
afaik alecf removed the code referenced in comment 0 in bug 148180
QA Contact: teruko → i18n

Makoto-san, can you confirm that this bug can be closed?

Flags: needinfo?(m_kato)

entity converter didn't use NS_OpenURI after bug 148180 and entity converter was gone by bug 1048191.

Status: ASSIGNED → RESOLVED
Closed: 25 years ago3 years ago
Flags: needinfo?(m_kato)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.