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
95a9c125
Commit
95a9c125
authored
10 years ago
by
Merov Linden
Browse files
Options
Downloads
Plain Diff
Pull merge from lindenlab/viewer-directdelivery
parents
989250ab
659be5d3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/newview/llmarketplacefunctions.cpp
+22
-18
22 additions, 18 deletions
indra/newview/llmarketplacefunctions.cpp
with
22 additions
and
18 deletions
indra/newview/llmarketplacefunctions.cpp
+
22
−
18
View file @
95a9c125
...
...
@@ -103,17 +103,21 @@ LLSD getMarketplaceStringSubstitutions()
///////////////////////////////////////////////////////////////////////////////
// SLM Responders
void
log_SLM_warning
(
const
std
::
string
&
request
,
U32
status
,
const
std
::
string
&
reason
,
const
std
::
string
&
code
,
const
std
::
string
&
description
)
{
LL_WARNS
(
"SLM"
)
<<
"SLM API : Responder to "
<<
request
<<
". status : "
<<
status
<<
", reason : "
<<
reason
<<
", code : "
<<
code
<<
", description : "
<<
description
<<
LL_ENDL
;
}
void
log_SLM_infos
(
const
std
::
string
&
request
,
U32
status
,
const
std
::
string
&
body
)
{
if
(
gSavedSettings
.
getBOOL
(
"MarketplaceListingsLogging"
))
{
LL_WARN
S
(
"SLM"
)
<<
"SLM API : Responder to "
<<
request
<<
". status : "
<<
status
<<
",
reason : "
<<
reason
<<
", code : "
<<
code
<<
",
description : "
<<
description
<<
LL_ENDL
;
LL_INFO
S
(
"SLM"
)
<<
"SLM API : Responder to "
<<
request
<<
". status : "
<<
status
<<
",
body or
description : "
<<
body
<<
LL_ENDL
;
}
}
void
log_SLM_
warning
(
const
std
::
string
&
request
,
const
std
::
string
&
url
,
const
std
::
string
&
data
)
void
log_SLM_
infos
(
const
std
::
string
&
request
,
const
std
::
string
&
url
,
const
std
::
string
&
body
)
{
if
(
gSavedSettings
.
getBOOL
(
"MarketplaceListingsLogging"
))
{
LL_
WARN
S
(
"SLM"
)
<<
"SLM API : Sending "
<<
request
<<
". url : "
<<
url
<<
",
data
: "
<<
data
<<
LL_ENDL
;
LL_
INFO
S
(
"SLM"
)
<<
"SLM API : Sending "
<<
request
<<
". url : "
<<
url
<<
",
body
: "
<<
body
<<
LL_ENDL
;
}
}
...
...
@@ -134,12 +138,12 @@ class LLSLMGetMerchantResponder : public LLHTTPClient::Responder
{
if
(
isGoodStatus
(
status
)
||
sBypassMerchant
)
{
log_SLM_
warning
(
"Get /merchant"
,
status
,
reason
,
""
,
"User is a merchant"
);
log_SLM_
infos
(
"Get /merchant"
,
status
,
"User is a merchant"
);
LLMarketplaceData
::
instance
().
setSLMStatus
(
MarketplaceStatusCodes
::
MARKET_PLACE_MERCHANT
);
}
else
if
(
status
==
SLMErrorCodes
::
SLM_NOT_FOUND
)
{
log_SLM_
warning
(
"Get /merchant"
,
status
,
reason
,
""
,
"User is not a merchant"
);
log_SLM_
infos
(
"Get /merchant"
,
status
,
"User is not a merchant"
);
LLMarketplaceData
::
instance
().
setSLMStatus
(
MarketplaceStatusCodes
::
MARKET_PLACE_NOT_MERCHANT
);
}
else
...
...
@@ -181,7 +185,7 @@ class LLSLMGetListingsResponder : public LLHTTPClient::Responder
return
;
}
log_SLM_
warning
(
"Get /listings"
,
status
,
reason
,
""
,
body
);
log_SLM_
infos
(
"Get /listings"
,
status
,
body
);
// Extract the info from the Json string
Json
::
ValueIterator
it
=
root
[
"listings"
].
begin
();
...
...
@@ -240,7 +244,7 @@ class LLSLMCreateListingsResponder : public LLHTTPClient::Responder
return
;
}
log_SLM_
warning
(
"Post /listings"
,
status
,
reason
,
""
,
body
);
log_SLM_
infos
(
"Post /listings"
,
status
,
body
);
// Extract the info from the Json string
Json
::
ValueIterator
it
=
root
[
"listings"
].
begin
();
...
...
@@ -295,7 +299,7 @@ class LLSLMGetListingResponder : public LLHTTPClient::Responder
return
;
}
log_SLM_
warning
(
"Get /listing"
,
status
,
reason
,
""
,
body
);
log_SLM_
infos
(
"Get /listing"
,
status
,
body
);
// Extract the info from the Json string
Json
::
ValueIterator
it
=
root
[
"listings"
].
begin
();
...
...
@@ -355,7 +359,7 @@ class LLSLMUpdateListingsResponder : public LLHTTPClient::Responder
return
;
}
log_SLM_
warning
(
"Put /listing"
,
status
,
reason
,
""
,
body
);
log_SLM_
infos
(
"Put /listing"
,
status
,
body
);
// Extract the info from the Json string
Json
::
ValueIterator
it
=
root
[
"listings"
].
begin
();
...
...
@@ -417,7 +421,7 @@ class LLSLMAssociateListingsResponder : public LLHTTPClient::Responder
return
;
}
log_SLM_
warning
(
"Put /associate_inventory"
,
status
,
reason
,
""
,
body
);
log_SLM_
infos
(
"Put /associate_inventory"
,
status
,
body
);
// Extract the info from the Json string
Json
::
ValueIterator
it
=
root
[
"listings"
].
begin
();
...
...
@@ -484,7 +488,7 @@ class LLSLMDeleteListingsResponder : public LLHTTPClient::Responder
return
;
}
log_SLM_
warning
(
"Delete /listing"
,
status
,
reason
,
""
,
body
);
log_SLM_
infos
(
"Delete /listing"
,
status
,
body
);
// Extract the info from the Json string
Json
::
ValueIterator
it
=
root
[
"listings"
].
begin
();
...
...
@@ -1046,7 +1050,7 @@ void LLMarketplaceData::initializeSLM(const status_updated_signal_t::slot_type&
mStatusUpdatedSignal
->
connect
(
cb
);
std
::
string
url
=
getSLMConnectURL
(
"/merchant"
);
log_SLM_
warning
(
"LLHTTPClient::get"
,
url
,
""
);
log_SLM_
infos
(
"LLHTTPClient::get"
,
url
,
""
);
LLHTTPClient
::
get
(
url
,
new
LLSLMGetMerchantResponder
(),
LLSD
());
}
...
...
@@ -1054,7 +1058,7 @@ void LLMarketplaceData::initializeSLM(const status_updated_signal_t::slot_type&
void
LLMarketplaceData
::
getSLMListings
()
{
std
::
string
url
=
getSLMConnectURL
(
"/listings"
);
log_SLM_
warning
(
"LLHTTPClient::get"
,
url
,
""
);
log_SLM_
infos
(
"LLHTTPClient::get"
,
url
,
""
);
LLHTTPClient
::
get
(
url
,
new
LLSLMGetListingsResponder
(),
LLSD
());
}
...
...
@@ -1066,7 +1070,7 @@ void LLMarketplaceData::getSLMListing(S32 listing_id)
// Send request
std
::
string
url
=
getSLMConnectURL
(
"/listing/"
)
+
llformat
(
"%d"
,
listing_id
);
log_SLM_
warning
(
"LLHTTPClient::get"
,
url
,
""
);
log_SLM_
infos
(
"LLHTTPClient::get"
,
url
,
""
);
LLHTTPClient
::
get
(
url
,
new
LLSLMGetListingResponder
(),
headers
);
}
...
...
@@ -1093,7 +1097,7 @@ void LLMarketplaceData::createSLMListing(const LLUUID& folder_id)
// Send request
std
::
string
url
=
getSLMConnectURL
(
"/listings"
);
log_SLM_
warning
(
"LLHTTPClient::postRaw"
,
url
,
json_str
);
log_SLM_
infos
(
"LLHTTPClient::postRaw"
,
url
,
json_str
);
LLHTTPClient
::
postRaw
(
url
,
data
,
size
,
new
LLSLMCreateListingsResponder
(),
headers
);
}
...
...
@@ -1121,7 +1125,7 @@ void LLMarketplaceData::updateSLMListing(const LLUUID& folder_id, S32 listing_id
// Send request
std
::
string
url
=
getSLMConnectURL
(
"/listing/"
)
+
llformat
(
"%d"
,
listing_id
);
log_SLM_
warning
(
"LLHTTPClient::putRaw"
,
url
,
json_str
);
log_SLM_
infos
(
"LLHTTPClient::putRaw"
,
url
,
json_str
);
LLHTTPClient
::
putRaw
(
url
,
data
,
size
,
new
LLSLMUpdateListingsResponder
(),
headers
);
}
...
...
@@ -1148,7 +1152,7 @@ void LLMarketplaceData::associateSLMListing(const LLUUID& folder_id, S32 listing
// Send request
std
::
string
url
=
getSLMConnectURL
(
"/associate_inventory/"
)
+
llformat
(
"%d"
,
listing_id
);
log_SLM_
warning
(
"LLHTTPClient::putRaw"
,
url
,
json_str
);
log_SLM_
infos
(
"LLHTTPClient::putRaw"
,
url
,
json_str
);
LLHTTPClient
::
putRaw
(
url
,
data
,
size
,
new
LLSLMAssociateListingsResponder
(),
headers
);
}
...
...
@@ -1160,7 +1164,7 @@ void LLMarketplaceData::deleteSLMListing(S32 listing_id)
// Send request
std
::
string
url
=
getSLMConnectURL
(
"/listing/"
)
+
llformat
(
"%d"
,
listing_id
);
log_SLM_
warning
(
"LLHTTPClient::del"
,
url
,
""
);
log_SLM_
infos
(
"LLHTTPClient::del"
,
url
,
""
);
LLHTTPClient
::
del
(
url
,
new
LLSLMDeleteListingsResponder
(),
headers
);
}
...
...
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