Closed
Bug 26294
Opened 25 years ago
Closed 3 years ago
Use of NS_OpenURI(nsIInputStream*,...) creates blocking stream.
Categories
(Core :: Internationalization, defect, P3)
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).
Assignee | ||
Comment 1•25 years ago
|
||
>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.
Assignee | ||
Comment 2•25 years ago
|
||
Resolving the bug since I think this is ok.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → WONTFIX
Reporter | ||
Comment 3•25 years ago
|
||
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)?
Assignee | ||
Comment 4•25 years ago
|
||
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.
Reporter | ||
Comment 5•25 years ago
|
||
so this code opens the .properties URL (the file that has these mappings)?
Assignee | ||
Comment 6•25 years ago
|
||
yes, it opens .properties
Reporter | ||
Comment 7•25 years ago
|
||
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.
Assignee | ||
Updated•24 years ago
|
Target Milestone: M15 → M17
Assignee | ||
Updated•24 years ago
|
Target Milestone: M17 → Future
Comment 10•20 years ago
|
||
I am not a programmer, but no action in 4 years... is NS_OpenURI(nsIInputStream*,...) still causing problems for anyone?
Comment 11•20 years ago
|
||
afaik alecf removed the code referenced in comment 0 in bug 148180
Updated•15 years ago
|
QA Contact: teruko → i18n
Comment 12•3 years ago
|
||
Makoto-san, can you confirm that this bug can be closed?
Flags: needinfo?(m_kato)
Comment 13•3 years ago
|
||
entity converter didn't use NS_OpenURI after bug 148180 and entity converter was gone by bug 1048191.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago → 3 years ago
Flags: needinfo?(m_kato)
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•