Cache the app_server port lazily so we don't have to look it up every time.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35681 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rene Gollent 2010-02-28 22:55:43 +00:00
parent 2ee4113182
commit 099f9551c7
2 changed files with 7 additions and 3 deletions

View File

@ -45,6 +45,7 @@ class LinkSender {
status_t FlushCompleted(size_t newBufferSize);
port_id fPort;
port_id fAppServerPort;
char *fBuffer;
size_t fBufferSize;

View File

@ -39,6 +39,7 @@ namespace BPrivate {
LinkSender::LinkSender(port_id port)
:
fPort(port),
fAppServerPort(-1),
fBuffer(NULL),
fBufferSize(0),
@ -167,9 +168,11 @@ LinkSender::Attach(const void *passedData, size_t passedSize)
port_id port = -1;
if (be_app == NULL)
port = fPort;
else
port = get_app_server_port();
else {
if (fAppServerPort < 0)
fAppServerPort = get_app_server_port();
port = fAppServerPort;
}
port_info info;
status_t result = get_port_info(port, &info);
if (result != B_OK)