Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
7059abb4
Commit
7059abb4
authored
13 years ago
by
Xiaohong Bao
Browse files
Options
Downloads
Plain Diff
Merge
parents
5caea1bc
ccb86a2a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/llmessage/llcurl.cpp
+8
-1
8 additions, 1 deletion
indra/llmessage/llcurl.cpp
indra/newview/lltexturefetch.cpp
+10
-2
10 additions, 2 deletions
indra/newview/lltexturefetch.cpp
with
18 additions
and
3 deletions
indra/llmessage/llcurl.cpp
+
8
−
1
View file @
7059abb4
...
@@ -1075,6 +1075,8 @@ void LLCurlRequest::get(const std::string& url, LLCurl::ResponderPtr responder)
...
@@ -1075,6 +1075,8 @@ void LLCurlRequest::get(const std::string& url, LLCurl::ResponderPtr responder)
getByteRange
(
url
,
headers_t
(),
0
,
-
1
,
responder
);
getByteRange
(
url
,
headers_t
(),
0
,
-
1
,
responder
);
}
}
// Note: (length==0) is interpreted as "the rest of the file", i.e. the whole file if (offset==0) or
// the remainder of the file if not.
bool
LLCurlRequest
::
getByteRange
(
const
std
::
string
&
url
,
bool
LLCurlRequest
::
getByteRange
(
const
std
::
string
&
url
,
const
headers_t
&
headers
,
const
headers_t
&
headers
,
S32
offset
,
S32
length
,
S32
offset
,
S32
length
,
...
@@ -1092,6 +1094,11 @@ bool LLCurlRequest::getByteRange(const std::string& url,
...
@@ -1092,6 +1094,11 @@ bool LLCurlRequest::getByteRange(const std::string& url,
std
::
string
range
=
llformat
(
"Range: bytes=%d-%d"
,
offset
,
offset
+
length
-
1
);
std
::
string
range
=
llformat
(
"Range: bytes=%d-%d"
,
offset
,
offset
+
length
-
1
);
easy
->
slist_append
(
range
.
c_str
());
easy
->
slist_append
(
range
.
c_str
());
}
}
else
if
(
offset
>
0
)
{
std
::
string
range
=
llformat
(
"Range: bytes=%d-"
,
offset
);
easy
->
slist_append
(
range
.
c_str
());
}
easy
->
setHeaders
();
easy
->
setHeaders
();
bool
res
=
addEasy
(
easy
);
bool
res
=
addEasy
(
easy
);
return
res
;
return
res
;
...
...
This diff is collapsed.
Click to expand it.
indra/newview/lltexturefetch.cpp
+
10
−
2
View file @
7059abb4
...
@@ -1222,6 +1222,12 @@ bool LLTextureFetchWorker::doWork(S32 param)
...
@@ -1222,6 +1222,12 @@ bool LLTextureFetchWorker::doWork(S32 param)
// Will call callbackHttpGet when curl request completes
// Will call callbackHttpGet when curl request completes
std
::
vector
<
std
::
string
>
headers
;
std
::
vector
<
std
::
string
>
headers
;
headers
.
push_back
(
"Accept: image/x-j2c"
);
headers
.
push_back
(
"Accept: image/x-j2c"
);
// If we try to fetch the whole file, we set the size to 0 so that we generate the correct curl range request
// Note: it looks a bit hacky but we need to limit this (size==0) to mean "whole file" to HTTP only as it messes up UDP fetching
if
((
offset
+
mRequestedSize
)
==
MAX_IMAGE_DATA_SIZE
)
{
mRequestedSize
=
0
;
}
res
=
mFetcher
->
mCurlGetRequest
->
getByteRange
(
mUrl
,
headers
,
offset
,
mRequestedSize
,
res
=
mFetcher
->
mCurlGetRequest
->
getByteRange
(
mUrl
,
headers
,
offset
,
mRequestedSize
,
new
HTTPGetResponder
(
mFetcher
,
mID
,
LLTimer
::
getTotalTime
(),
mRequestedSize
,
offset
,
true
));
new
HTTPGetResponder
(
mFetcher
,
mID
,
LLTimer
::
getTotalTime
(),
mRequestedSize
,
offset
,
true
));
}
}
...
@@ -1708,7 +1714,7 @@ S32 LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels,
...
@@ -1708,7 +1714,7 @@ S32 LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels,
mBuffer
=
(
U8
*
)
ALLOCATE_MEM
(
LLImageBase
::
getPrivatePool
(),
data_size
);
mBuffer
=
(
U8
*
)
ALLOCATE_MEM
(
LLImageBase
::
getPrivatePool
(),
data_size
);
buffer
->
readAfter
(
channels
.
in
(),
NULL
,
mBuffer
,
data_size
);
buffer
->
readAfter
(
channels
.
in
(),
NULL
,
mBuffer
,
data_size
);
mBufferSize
+=
data_size
;
mBufferSize
+=
data_size
;
if
(
data_size
<
mRequestedSize
&&
mRequestedDiscard
==
0
)
if
(
mRequestedSize
==
0
)
{
{
mHaveAllData
=
TRUE
;
mHaveAllData
=
TRUE
;
}
}
...
@@ -1949,6 +1955,8 @@ bool LLTextureFetch::createRequest(const std::string& url, const LLUUID& id, con
...
@@ -1949,6 +1955,8 @@ bool LLTextureFetch::createRequest(const std::string& url, const LLUUID& id, con
}
}
else
else
{
{
// If the requester knows nothing about the file, we fetch the smallest
// amount of data at the lowest resolution (highest discard level) possible.
desired_size
=
TEXTURE_CACHE_ENTRY_SIZE
;
desired_size
=
TEXTURE_CACHE_ENTRY_SIZE
;
desired_discard
=
MAX_DISCARD_LEVEL
;
desired_discard
=
MAX_DISCARD_LEVEL
;
}
}
...
@@ -3746,7 +3754,7 @@ void LLTextureFetchDebugger::scanRefetchList()
...
@@ -3746,7 +3754,7 @@ void LLTextureFetchDebugger::scanRefetchList()
if
(
iter
->
second
.
empty
())
if
(
iter
->
second
.
empty
())
{
{
gTextureList
.
setDebugFetching
(
iter
->
first
,
-
1
);
gTextureList
.
setDebugFetching
(
iter
->
first
,
-
1
);
iter
=
mRefetchList
.
erase
(
iter
);
mRefetchList
.
erase
(
iter
++
);
// This is the correct method to "erase and move on" in an std::map
}
}
else
else
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment