From c8a932fa8a09a925c0cb3a0bc25e90456bb56d68 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 25 Aug 2017 16:43:19 +0300 Subject: MAINT-989 Fixed Avatar Physics Vary Extremely With Different Framerates --- indra/newview/llphysicsmotion.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp index ea10d03264..65b57a2790 100644 --- a/indra/newview/llphysicsmotion.cpp +++ b/indra/newview/llphysicsmotion.cpp @@ -44,7 +44,7 @@ typedef std::map controller_map_t; typedef std::map default_controller_map_t; #define MIN_REQUIRED_PIXEL_AREA_AVATAR_PHYSICS_MOTION 0.f -#define TIME_ITERATION_STEP 0.1f +#define TIME_ITERATION_STEP 0.033f // roughtly 30 fps inline F64 llsgn(const F64 a) { @@ -493,8 +493,8 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) const F32 time_delta = time - mLastTime; - // Don't update too frequently, to avoid precision errors from small time slices. - if (time_delta <= .01) + // Don't update too frequently (below 0.01), to avoid precision errors from small time slices. + if (time_delta <= TIME_ITERATION_STEP) { return FALSE; } @@ -561,7 +561,10 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) F32 time_iteration_step = TIME_ITERATION_STEP; if (time_iteration + TIME_ITERATION_STEP > time_delta) { - time_iteration_step = time_delta-time_iteration; + time_iteration_step = time_delta - time_iteration; + // Leave the rest for next update. + mLastTime = time - time_iteration_step; + break; } // mPositon_local should be in normalized 0,1 range already. Just making sure... @@ -716,7 +719,6 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) mAccelerationJoint_local = acceleration_joint_local; mPosition_local = position_new_local; } - mLastTime = time; mPosition_world = joint->getWorldPosition(); mVelocityJoint_local = velocity_joint_local; -- cgit v1.2.3 From 0b7020c0c57560e8ffd13ea57e378807222e4680 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 15 Sep 2017 16:45:46 +0300 Subject: MAINT-7801 FIXED "Take a snapshot" fails to assign new snapshot for Outfit if default folder for uploads was changed --- indra/newview/lloutfitgallery.cpp | 28 ++++++++++++++++++++++------ indra/newview/lloutfitgallery.h | 2 ++ 2 files changed, 24 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index cca65f2ce1..c38d3ab140 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -72,6 +72,7 @@ LLOutfitGallery::LLOutfitGallery(const LLOutfitGallery::Params& p) mItemsAddedCount(0), mOutfitLinkPending(NULL), mOutfitRenamePending(NULL), + mSnapshotFolderID(NULL), mRowPanelHeight(p.row_panel_height), mVerticalGap(p.vertical_gap), mHorizontalGap(p.horizontal_gap), @@ -1011,8 +1012,8 @@ void LLOutfitGallery::onTextureSelectionChanged(LLInventoryItem* itemp) void LLOutfitGallery::loadPhotos() { //Iterate over inventory - LLUUID textures = gInventory.findCategoryUUIDForType(LLFolderType::FT_TEXTURE); - LLViewerInventoryCategory* textures_category = gInventory.getCategory(textures); + mSnapshotFolderID = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_TEXTURE); + LLViewerInventoryCategory* textures_category = gInventory.getCategory(mSnapshotFolderID); if (!textures_category) return; if (mTexturesObserver == NULL) @@ -1022,12 +1023,26 @@ void LLOutfitGallery::loadPhotos() } // Start observing changes in "Textures" category. - mTexturesObserver->addCategory(textures, - boost::bind(&LLOutfitGallery::refreshTextures, this, textures)); - + mTexturesObserver->addCategory(mSnapshotFolderID, + boost::bind(&LLOutfitGallery::refreshTextures, this, mSnapshotFolderID)); + textures_category->fetch(); } +void LLOutfitGallery::updateSnapshotFolderObserver() +{ + if(mSnapshotFolderID != gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_TEXTURE)) + { + if (gInventory.containsObserver(mTexturesObserver)) + { + gInventory.removeObserver(mTexturesObserver); + } + delete mTexturesObserver; + mTexturesObserver = NULL; + loadPhotos(); + } +} + void LLOutfitGallery::refreshOutfit(const LLUUID& category_id) { LLViewerInventoryCategory* category = gInventory.getCategory(category_id); @@ -1200,7 +1215,7 @@ void LLOutfitGallery::uploadPhoto(LLUUID outfit_id) LLViewerInventoryCategory *outfit_cat = gInventory.getCategory(outfit_id); if (!outfit_cat) return; - + updateSnapshotFolderObserver(); checkRemovePhoto(outfit_id); std::string upload_pending_name = outfit_id.asString(); std::string upload_pending_desc = ""; @@ -1372,6 +1387,7 @@ void LLOutfitGallery::onBeforeOutfitSnapshotSave() if (!selected_outfit_id.isNull()) { checkRemovePhoto(selected_outfit_id); + updateSnapshotFolderObserver(); } } diff --git a/indra/newview/lloutfitgallery.h b/indra/newview/lloutfitgallery.h index b1ca850508..383924a7d6 100644 --- a/indra/newview/lloutfitgallery.h +++ b/indra/newview/lloutfitgallery.h @@ -130,6 +130,7 @@ protected: private: void loadPhotos(); void uploadPhoto(LLUUID outfit_id); + void updateSnapshotFolderObserver(); LLUUID getPhotoAssetId(const LLUUID& outfit_id); LLUUID getDefaultPhoto(); void linkPhotoToOutfit(LLUUID outfit_id, LLUUID photo_id); @@ -168,6 +169,7 @@ private: LLPanel* mLastRowPanel; LLUUID mOutfitLinkPending; LLUUID mOutfitRenamePending; + LLUUID mSnapshotFolderID; LLTextBox* mMessageTextBox; bool mGalleryCreated; int mRowCount; -- cgit v1.2.3 From 18483e902c0c821dc5d0bb8349f83d1a3b34d5a8 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 18 Sep 2017 18:11:04 +0300 Subject: MAINT-7779 Protections against wrong data --- indra/newview/lltexturecache.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index f0c28041d1..87a2c0ae60 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -550,9 +550,11 @@ bool LLTextureCacheRemoteWorker::doWrite() { if ((mOffset != 0) // We currently do not support write offsets || (mDataSize <= 0) // Things will go badly wrong if mDataSize is nul or negative... - || (mImageSize < mDataSize)) + || (mImageSize < mDataSize) + || (mRawDiscardLevel < 0) + || (mRawImage->isBufferInvalid())) // decode failed or malfunctioned, don't write { - LL_WARNS() << "INIT state check failed" << LL_ENDL; + LL_WARNS() << "INIT state check failed for image: " << mID << " Size: " << mImageSize << " DataSize: " << mDataSize << " Discard:" << mRawDiscardLevel << LL_ENDL; mDataSize = -1; // failed done = true; } @@ -577,15 +579,12 @@ bool LLTextureCacheRemoteWorker::doWrite() idx = mCache->setHeaderCacheEntry(mID, entry, mImageSize, mDataSize); // create the new entry. if(idx >= 0) { - // (almost always) write to the fast cache. - if (mRawImage->getDataSize()) + // write to the fast cache. + if(!mCache->writeToFastCache(idx, mRawImage, mRawDiscardLevel)) { - if(!mCache->writeToFastCache(idx, mRawImage, mRawDiscardLevel)) - { - LL_WARNS() << "writeToFastCache failed" << LL_ENDL; - mDataSize = -1; // failed - done = true; - } + LL_WARNS() << "writeToFastCache failed" << LL_ENDL; + mDataSize = -1; // failed + done = true; } } } -- cgit v1.2.3 From 012ba25d45e1c0c09090ee11204ee31eceb4b81f Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 19 Sep 2017 11:15:51 +0300 Subject: MAINT-7811 FIXED The "Use Texture" option appears when it shouldn't be displayed --- indra/newview/llpanelface.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra') diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index a16259886d..f95a83f427 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1623,6 +1623,15 @@ void LLPanelFace::updateShinyControls(bool is_setting_texture, bool mess_with_sh } } } + else + { + if (shiny_texture_ID.isNull() && comboShiny && comboShiny->itemExists(USE_TEXTURE)) + { + comboShiny->remove(SHINY_TEXTURE); + comboShiny->selectFirstItem(); + } + } + LLComboBox* combo_matmedia = getChild("combobox matmedia"); LLRadioGroup* radio_mat_type = getChild("radio_material_type"); -- cgit v1.2.3 From a27466ca07e5568442053e02ac9e76297ee74787 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 21 Sep 2017 12:19:02 +0300 Subject: MAINT-7822 Crash in LLScriptFloaterManager() --- indra/newview/llscriptfloater.cpp | 15 ++++++++++++++- indra/newview/llscriptfloater.h | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp index b2c450aa0c..da912ef3d4 100644 --- a/indra/newview/llscriptfloater.cpp +++ b/indra/newview/llscriptfloater.cpp @@ -349,8 +349,8 @@ void LLScriptFloater::hideToastsIfNeeded() ////////////////////////////////////////////////////////////////////////// LLScriptFloaterManager::LLScriptFloaterManager() + : mDialogLimitationsSlot() { - gSavedSettings.getControl("ScriptDialogLimitations")->getCommitSignal()->connect(boost::bind(&clearScriptNotifications)); } void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) @@ -361,6 +361,19 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) return; } + if (!mDialogLimitationsSlot.connected()) + { + LLPointer cntrl_ptr = gSavedSettings.getControl("ScriptDialogLimitations"); + if (cntrl_ptr.notNull()) + { + mDialogLimitationsSlot = cntrl_ptr->getCommitSignal()->connect(boost::bind(&clearScriptNotifications)); + } + else + { + LL_WARNS() << "Unable to set signal on setting 'ScriptDialogLimitations'" << LL_ENDL; + } + } + // get scripted Object's ID LLUUID object_id = notification_id_to_object_id(notification_id); diff --git a/indra/newview/llscriptfloater.h b/indra/newview/llscriptfloater.h index 0192a8893e..3695b8a3e1 100644 --- a/indra/newview/llscriptfloater.h +++ b/indra/newview/llscriptfloater.h @@ -139,6 +139,7 @@ private: typedef std::map floater_position_map_t; floater_position_map_t mFloaterPositions; + boost::signals2::connection mDialogLimitationsSlot; }; /** -- cgit v1.2.3 From 818a0f7f774655d9fa58d3e1a452439e334aaf56 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Wed, 20 Sep 2017 15:01:36 +0300 Subject: MAINT-7790 Fixed vertical image alignment for buttons --- indra/llui/llbutton.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 8c7df45884..510a2537b9 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -808,11 +808,12 @@ void LLButton::draw() } else { - imagep->draw(0, 0, (enabled ? mImageColor.get() : disabled_color) % alpha ); + S32 y = getLocalRect().getHeight() - imagep->getHeight(); + imagep->draw(0, y, (enabled ? mImageColor.get() : disabled_color) % alpha); if (mCurGlowStrength > 0.01f) { gGL.setSceneBlendType(glow_type); - imagep->drawSolid(0, 0, glow_color % (mCurGlowStrength * alpha)); + imagep->drawSolid(0, y, glow_color % (mCurGlowStrength * alpha)); gGL.setSceneBlendType(LLRender::BT_ALPHA); } } @@ -954,7 +955,8 @@ void LLButton::drawBorder(LLUIImage* imagep, const LLColor4& color, S32 size) } else { - imagep->drawBorder(0, 0, color, size); + S32 y = getLocalRect().getHeight() - imagep->getHeight(); + imagep->drawBorder(0, y, color, size); } } -- cgit v1.2.3 From f4e303c067bbf4fdad2fe8f8c02878bee3b74cb0 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 21 Sep 2017 17:01:45 +0300 Subject: MAINT-1209 Fixed Light does not revert to a simple light when texture is set to none --- indra/newview/llpanelvolume.cpp | 19 ++++++++----------- indra/newview/llpanelvolume.h | 1 - 2 files changed, 8 insertions(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index c9f8683e0e..b1895bfc9b 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -710,22 +710,20 @@ void LLPanelVolume::onLightCancelColor(const LLSD& data) void LLPanelVolume::onLightCancelTexture(const LLSD& data) { LLTextureCtrl* LightTextureCtrl = getChild("light texture control"); - - if (LightTextureCtrl) - { - LightTextureCtrl->setImageAssetID(mLightSavedTexture); - } - LLVOVolume *volobjp = (LLVOVolume *) mObject.get(); - if(volobjp) + + if (volobjp && LightTextureCtrl) { // Cancel the light texture as requested // NORSPEC-292 - // + // + // Texture picker triggers cancel both in case of actual cancel and in case of + // selection of "None" texture. + LLUUID tex_id = LightTextureCtrl->getImageAssetID(); bool is_spotlight = volobjp->isLightSpotlight(); - volobjp->setLightTextureID(mLightSavedTexture); //updates spotlight + volobjp->setLightTextureID(tex_id); //updates spotlight - if (!is_spotlight && mLightSavedTexture.notNull()) + if (!is_spotlight && tex_id.notNull()) { LLVector3 spot_params = volobjp->getSpotLightParams(); getChild("Light FOV")->setValue(spot_params.mV[0]); @@ -769,7 +767,6 @@ void LLPanelVolume::onLightSelectTexture(const LLSD& data) { LLUUID id = LightTextureCtrl->getImageAssetID(); volobjp->setLightTextureID(id); - mLightSavedTexture = id; } } diff --git a/indra/newview/llpanelvolume.h b/indra/newview/llpanelvolume.h index deb6b6f2a6..e3453ae99c 100644 --- a/indra/newview/llpanelvolume.h +++ b/indra/newview/llpanelvolume.h @@ -111,7 +111,6 @@ protected: LLColor4 mLightSavedColor; - LLUUID mLightSavedTexture; LLPointer mObject; LLPointer mRootObject; -- cgit v1.2.3 From a65c18c1d370b34cb41e8130bca2e5e068bac553 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 26 Sep 2017 11:21:02 +0300 Subject: MAINT-7824 FIXED Items inside other notecards with full perms refuse to copy into inventory when being looked at inside an object. --- indra/newview/llpreviewnotecard.cpp | 10 ++++++++++ indra/newview/llpreviewnotecard.h | 1 + indra/newview/llviewertexteditor.h | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 850c3b350d..d4a8bbdf45 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -163,6 +163,16 @@ BOOL LLPreviewNotecard::canClose() } } +/* virtual */ +void LLPreviewNotecard::setObjectID(const LLUUID& object_id) +{ + LLPreview::setObjectID(object_id); + + LLViewerTextEditor* editor = getChild("Notecard Editor"); + editor->setNotecardObjectID(mObjectUUID); + editor->makePristine(); +} + const LLInventoryItem* LLPreviewNotecard::getDragItem() { LLViewerTextEditor* editor = getChild("Notecard Editor"); diff --git a/indra/newview/llpreviewnotecard.h b/indra/newview/llpreviewnotecard.h index 017c4485ba..46a6d0ef50 100644 --- a/indra/newview/llpreviewnotecard.h +++ b/indra/newview/llpreviewnotecard.h @@ -47,6 +47,7 @@ public: virtual ~LLPreviewNotecard(); bool saveItem(); + void setObjectID(const LLUUID& object_id); // llview virtual void draw(); diff --git a/indra/newview/llviewertexteditor.h b/indra/newview/llviewertexteditor.h index 33cfca4f90..44f104dde1 100644 --- a/indra/newview/llviewertexteditor.h +++ b/indra/newview/llviewertexteditor.h @@ -71,7 +71,8 @@ public: mObjectID = object_id; mPreviewID = preview_id; } - + void setNotecardObjectID(const LLUUID& object_id){ mObjectID = object_id;} + void setASCIIEmbeddedText(const std::string& instr); void setEmbeddedText(const std::string& instr); std::string getEmbeddedText(); -- cgit v1.2.3 From 515687cc32a96b8eb3ac78b077351e6d35a88abc Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 26 Sep 2017 11:26:04 +0300 Subject: MAINT-7846 The link in the required update modal should open the download web page in external browser. --- indra/newview/skins/default/xui/en/notifications.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index ee1ff372a7..9af4b299de 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3991,7 +3991,8 @@ http://secondlife.com/download. + type="alertmodal" + force_urls_external="true"> There is a required update for your Second Life Installation. You may download this update from http://www.secondlife.com/downloads -- cgit v1.2.3 From 36c991877f128bfb76e1b6d476d7f49956c0d87f Mon Sep 17 00:00:00 2001 From: daianakproductengine Date: Tue, 26 Sep 2017 18:22:05 +0300 Subject: MAINT-1208 Fixed 'Save as' screenshot dialog doesn't allow to save screenshot without automatically adding number to name of file --- indra/newview/llviewerwindow.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index b052a48424..7b4895b862 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4379,6 +4379,8 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, BOOL force_picke else pick_type = LLFilePicker::FFSAVE_ALL; // ??? + BOOL is_snapshot_name_loc_set = isSnapshotLocSet(); + // Get a base file location if needed. if (force_picker || !isSnapshotLocSet()) { @@ -4427,7 +4429,12 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, BOOL force_picke filepath = sSnapshotDir; filepath += gDirUtilp->getDirDelimiter(); filepath += sSnapshotBaseName; - filepath += llformat("_%.3d",i); + + if (is_snapshot_name_loc_set) + { + filepath += llformat("_%.3d",i); + } + filepath += extension; llstat stat_info; -- cgit v1.2.3 From e6e606df3cbe6373e90c7bd82c419103f8243971 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Thu, 28 Sep 2017 14:32:29 +0300 Subject: MAINT-7666 [CEF] mouse cursor target is offset on login screen for high resolution screens --- indra/newview/llmediactrl.cpp | 88 ++++++++++++++++++++++++------------------- indra/newview/llmediactrl.h | 3 ++ 2 files changed, 53 insertions(+), 38 deletions(-) (limited to 'indra') diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 00043d1e72..803bacc567 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -805,44 +805,8 @@ void LLMediaCtrl::draw() F32 max_u = ( F32 )media_plugin->getWidth() / ( F32 )media_plugin->getTextureWidth(); F32 max_v = ( F32 )media_plugin->getHeight() / ( F32 )media_plugin->getTextureHeight(); - LLRect r = getRect(); - S32 width, height; - S32 x_offset = 0; - S32 y_offset = 0; - - if(mStretchToFill) - { - if(mMaintainAspectRatio) - { - F32 media_aspect = (F32)(media_plugin->getWidth()) / (F32)(media_plugin->getHeight()); - F32 view_aspect = (F32)(r.getWidth()) / (F32)(r.getHeight()); - if(media_aspect > view_aspect) - { - // max width, adjusted height - width = r.getWidth(); - height = llmin(llmax(ll_round(width / media_aspect), 0), r.getHeight()); - } - else - { - // max height, adjusted width - height = r.getHeight(); - width = llmin(llmax(ll_round(height * media_aspect), 0), r.getWidth()); - } - } - else - { - width = r.getWidth(); - height = r.getHeight(); - } - } - else - { - width = llmin(media_plugin->getWidth(), r.getWidth()); - height = llmin(media_plugin->getHeight(), r.getHeight()); - } - - x_offset = (r.getWidth() - width) / 2; - y_offset = (r.getHeight() - height) / 2; + S32 x_offset, y_offset, width, height; + calcOffsetsAndSize(&x_offset, &y_offset, &width, &height); // draw the browser gGL.begin( LLRender::QUADS ); @@ -899,10 +863,58 @@ void LLMediaCtrl::draw() setBackgroundOpaque(background_opaque); } +//////////////////////////////////////////////////////////////////////////////// +// +void LLMediaCtrl::calcOffsetsAndSize(S32 *x_offset, S32 *y_offset, S32 *width, S32 *height) +{ + const LLRect &r = getRect(); + *x_offset = *y_offset = 0; + + if (mStretchToFill) + { + if (mMaintainAspectRatio) + { + F32 media_aspect = (F32)(mMediaSource->getMediaPlugin()->getWidth()) / (F32)(mMediaSource->getMediaPlugin()->getHeight()); + F32 view_aspect = (F32)(r.getWidth()) / (F32)(r.getHeight()); + if (media_aspect > view_aspect) + { + // max width, adjusted height + *width = r.getWidth(); + *height = llmin(llmax(ll_round(*width / media_aspect), 0), r.getHeight()); + } + else + { + // max height, adjusted width + *height = r.getHeight(); + *width = llmin(llmax(ll_round(*height * media_aspect), 0), r.getWidth()); + } + } + else + { + *width = r.getWidth(); + *height = r.getHeight(); + } + } + else + { + *width = llmin(mMediaSource->getMediaPlugin()->getWidth(), r.getWidth()); + *height = llmin(mMediaSource->getMediaPlugin()->getHeight(), r.getHeight()); + } + + *x_offset = (r.getWidth() - *width) / 2; + *y_offset = (r.getHeight() - *height) / 2; +} + //////////////////////////////////////////////////////////////////////////////// // void LLMediaCtrl::convertInputCoords(S32& x, S32& y) { + S32 x_offset, y_offset, width, height; + calcOffsetsAndSize(&x_offset, &y_offset, &width, &height); + + x -= x_offset; + y -= y_offset; + bool coords_opengl = false; if(mMediaSource && mMediaSource->hasMedia()) diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 125a67e23e..11400c8274 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -181,6 +181,9 @@ public: protected: void convertInputCoords(S32& x, S32& y); + private: + void calcOffsetsAndSize(S32 *x_offset, S32 *y_offset, S32 *width, S32 *height); + private: void onVisibilityChanged ( const LLSD& new_visibility ); void onPopup(const LLSD& notification, const LLSD& response); -- cgit v1.2.3 From d8dd2e7899e678781d4865cd52b2c3f1a7699924 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 28 Sep 2017 16:13:44 +0300 Subject: MAINT-7835 Start location is not changed correctly via 'maps.secondlife.com' link in some cases --- indra/newview/llpanellogin.cpp | 9 +++++---- indra/newview/llpanellogin.h | 6 +++++- indra/newview/llstartup.cpp | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index a88c10521c..8881222f2c 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -75,6 +75,7 @@ LLPanelLogin *LLPanelLogin::sInstance = NULL; BOOL LLPanelLogin::sCapslockDidNotification = FALSE; +BOOL LLPanelLogin::sCredentialSet = FALSE; class LLLoginLocationAutoHandler : public LLCommandHandler { @@ -176,6 +177,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, setBackgroundOpaque(TRUE); mPasswordModified = FALSE; + LLPanelLogin::sInstance = this; LLView* login_holder = gViewerWindow->getLoginPanelHolder(); @@ -458,6 +460,7 @@ void LLPanelLogin::setFields(LLPointer credential, LL_WARNS() << "Attempted fillFields with no login view shown" << LL_ENDL; return; } + sCredentialSet = TRUE; LL_INFOS("Credentials") << "Setting login fields to " << *credential << LL_ENDL; LLSD identifier = credential->getIdentifier(); @@ -680,10 +683,8 @@ void LLPanelLogin::onUpdateStartSLURL(const LLSLURL& new_start_slurl) } if ( new_start_slurl.getLocationString().length() ) { - if (location_combo->getCurrentIndex() == -1) - { - location_combo->setLabel(new_start_slurl.getLocationString()); - } + + location_combo->setLabel(new_start_slurl.getLocationString()); sInstance->mLocationLength = new_start_slurl.getLocationString().length(); sInstance->updateLoginButtons(); } diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index 869f2f8d39..82ef048493 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -56,9 +56,11 @@ public: void* callback_data); static void setFields(LLPointer credential, BOOL remember); - + static void getFields(LLPointer& credential, BOOL& remember); + static BOOL isCredentialSet() { return sCredentialSet; } + static BOOL areCredentialFieldsDirty(); static void setLocation(const LLSLURL& slurl); static void autologinToLocation(const LLSLURL& slurl); @@ -115,6 +117,8 @@ private: static LLPanelLogin* sInstance; static BOOL sCapslockDidNotification; bool mFirstLoginThisInstall; + + static BOOL sCredentialSet; unsigned int mUsernameLength; unsigned int mPasswordLength; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 8295ce029b..df1d2a3946 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -766,7 +766,7 @@ bool idle_startup() // Show the login dialog login_show(); // connect dialog is already shown, so fill in the names - if (gUserCredential.notNull()) + if (gUserCredential.notNull() && !LLPanelLogin::isCredentialSet()) { LLPanelLogin::setFields( gUserCredential, gRememberPassword); } -- cgit v1.2.3 From 5844a9372fdd6e009d4eee0702204f4642f17bf8 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 28 Sep 2017 17:10:38 +0300 Subject: SL-775 Texture cache purge improvements --- indra/newview/lltexturecache.cpp | 95 +++++++++++++++++++++++++++++++++++++--- indra/newview/lltexturecache.h | 3 ++ 2 files changed, 93 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 87a2c0ae60..1aa95f996a 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -53,6 +53,7 @@ const F32 TEXTURE_CACHE_PURGE_AMOUNT = .20f; // % amount to reduce the cache by const F32 TEXTURE_CACHE_LRU_SIZE = .10f; // % amount for LRU list (low overhead to regenerate) const S32 TEXTURE_FAST_CACHE_ENTRY_OVERHEAD = sizeof(S32) * 4; //w, h, c, level const S32 TEXTURE_FAST_CACHE_ENTRY_SIZE = 16 * 16 * 4 + TEXTURE_FAST_CACHE_ENTRY_OVERHEAD; +const F32 TEXTURE_LAZY_PURGE_TIME_LIMIT = .01f; // 10ms class LLTextureCacheWorker : public LLWorkerClass { @@ -1634,6 +1635,91 @@ void LLTextureCache::purgeAllTextures(bool purge_directories) LL_INFOS() << "The entire texture cache is cleared." << LL_ENDL ; } +void LLTextureCache::purgeTexturesLazy(F32 time_limit) +{ + if (mReadOnly) + { + return; + } + + if (!mThreaded) + { + // *FIX:Mani - watchdog off. + LLAppViewer::instance()->pauseMainloopTimeout(); + } + + // time_limit doesn't account for lock time + LLMutexLock lock(&mHeaderMutex); + + if (mPurgeEntryList.empty()) + { + // Read the entries list and form list of textures to purge + std::vector entries; + U32 num_entries = openAndReadEntries(entries); + if (!num_entries) + { + return; // nothing to purge + } + + // Use mTexturesSizeMap to collect UUIDs of textures with bodies + typedef std::set > time_idx_set_t; + std::set > time_idx_set; + for (size_map_t::iterator iter1 = mTexturesSizeMap.begin(); + iter1 != mTexturesSizeMap.end(); ++iter1) + { + if (iter1->second > 0) + { + id_map_t::iterator iter2 = mHeaderIDMap.find(iter1->first); + if (iter2 != mHeaderIDMap.end()) + { + S32 idx = iter2->second; + time_idx_set.insert(std::make_pair(entries[idx].mTime, idx)); + } + else + { + LL_ERRS() << "mTexturesSizeMap / mHeaderIDMap corrupted." << LL_ENDL; + } + } + } + + S64 cache_size = mTexturesSizeTotal; + S64 purged_cache_size = (sCacheMaxTexturesSize * (S64)((1.f - TEXTURE_CACHE_PURGE_AMOUNT) * 100)) / 100; + for (time_idx_set_t::iterator iter = time_idx_set.begin(); + iter != time_idx_set.end(); ++iter) + { + S32 idx = iter->second; + if (cache_size >= purged_cache_size) + { + cache_size -= entries[idx].mBodySize; + mPurgeEntryList.push_back(std::pair(idx, entries[idx])); + } + else + { + break; + } + } + LL_DEBUGS() << "Formed Purge list of " << mPurgeEntryList.size() << " entries" << LL_ENDL; + } + else + { + // Remove collected entried + LLTimer timer; + while (!mPurgeEntryList.empty() && timer.getElapsedTimeF32() < time_limit) + { + S32 idx = mPurgeEntryList.back().first; + Entry entry = mPurgeEntryList.back().second; + mPurgeEntryList.pop_back(); + // make sure record is still valid + id_map_t::iterator iter_header = mHeaderIDMap.find(entry.mID); + if (iter_header != mHeaderIDMap.end() && iter_header->second == idx) + { + removeEntry(idx, entry, getTextureFileName(entry.mID)); + writeEntryToHeaderImmediately(idx, entry); + } + } + } +} + void LLTextureCache::purgeTextures(bool validate) { if (mReadOnly) @@ -1887,11 +1973,10 @@ LLTextureCache::handle_t LLTextureCache::writeToCache(const LLUUID& id, U32 prio } if (mDoPurge) { - // NOTE: This may cause an occasional hiccup, - // but it really needs to be done on the control thread - // (i.e. here) - purgeTextures(false); - mDoPurge = FALSE; + // NOTE: Needs to be done on the control thread + // (i.e. here) + purgeTexturesLazy(TEXTURE_LAZY_PURGE_TIME_LIMIT); + mDoPurge = !mPurgeEntryList.empty(); } LLMutexLock lock(&mWorkersMutex); LLTextureCacheWorker* worker = new LLTextureCacheRemoteWorker(this, priority, id, diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h index 95f9afc2bc..23d08d439c 100644 --- a/indra/newview/lltexturecache.h +++ b/indra/newview/lltexturecache.h @@ -155,6 +155,7 @@ private: void readHeaderCache(); void clearCorruptedCache(); void purgeAllTextures(bool purge_directories); + void purgeTexturesLazy(F32 time_limit); void purgeTextures(bool validate); LLAPRFile* openHeaderEntriesFile(bool readonly, S32 offset); void closeHeaderEntriesFile(); @@ -225,6 +226,8 @@ private: typedef std::map idx_entry_map_t; idx_entry_map_t mUpdatedEntryMap; + typedef std::vector> idx_entry_vector_t; + idx_entry_vector_t mPurgeEntryList; // Statics static F32 sHeaderCacheVersion; -- cgit v1.2.3 From f7b4b1fe2a4fde0bcb392f64656a5be53d99adb8 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 29 Sep 2017 16:25:58 +0300 Subject: MAINT-7835 FIXED issue with resetting username after failed attempt to login --- indra/newview/llpanellogin.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 8881222f2c..0bcbdf7e67 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -863,6 +863,7 @@ void LLPanelLogin::onClickConnect(void *) } else { + sCredentialSet = FALSE; LLPointer cred; BOOL remember; getFields(cred, remember); -- cgit v1.2.3 From f33c96421049d0f0a447d9a51d4f29b655a7246a Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 3 Oct 2017 10:51:14 +0300 Subject: MAINT-7862 FIXED Crash in LLGroupMgr::sendGroupTitlesRequest(..) --- indra/newview/llcommandhandler.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llcommandhandler.cpp b/indra/newview/llcommandhandler.cpp index 5ea7efc045..76d965b1f1 100644 --- a/indra/newview/llcommandhandler.cpp +++ b/indra/newview/llcommandhandler.cpp @@ -134,7 +134,11 @@ bool LLCommandHandlerRegistry::dispatch(const std::string& cmd, { break; } - + //skip initial request from external browser before STATE_BROWSER_INIT + if (LLStartUp::getStartupState() == STATE_FIRST) + { + return true; + } cur_time = LLTimer::getElapsedSeconds(); if (cur_time < last_throttle_time + THROTTLE_PERIOD) { -- cgit v1.2.3 From e0265d3754b190d28d5a5a55fc1a1e510d9aef59 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 3 Oct 2017 12:00:11 +0300 Subject: build fix --- indra/newview/lltexturecache.cpp | 3 ++- indra/newview/lltexturecache.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 1aa95f996a..1000377718 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -1713,7 +1713,8 @@ void LLTextureCache::purgeTexturesLazy(F32 time_limit) id_map_t::iterator iter_header = mHeaderIDMap.find(entry.mID); if (iter_header != mHeaderIDMap.end() && iter_header->second == idx) { - removeEntry(idx, entry, getTextureFileName(entry.mID)); + std::string tex_filename = getTextureFileName(entry.mID); + removeEntry(idx, entry, tex_filename); writeEntryToHeaderImmediately(idx, entry); } } diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h index 23d08d439c..bcc27c6598 100644 --- a/indra/newview/lltexturecache.h +++ b/indra/newview/lltexturecache.h @@ -226,7 +226,7 @@ private: typedef std::map idx_entry_map_t; idx_entry_map_t mUpdatedEntryMap; - typedef std::vector> idx_entry_vector_t; + typedef std::vector > idx_entry_vector_t; idx_entry_vector_t mPurgeEntryList; // Statics -- cgit v1.2.3 From 21d8a7f09ce544240a4d70df6e8879996c5059f6 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 3 Oct 2017 15:17:35 +0300 Subject: startup crash fix --- indra/newview/llmediactrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 803bacc567..a8025906c7 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -872,7 +872,7 @@ void LLMediaCtrl::calcOffsetsAndSize(S32 *x_offset, S32 *y_offset, S32 *width, S if (mStretchToFill) { - if (mMaintainAspectRatio) + if (mMaintainAspectRatio && mMediaSource && mMediaSource->getMediaPlugin()) { F32 media_aspect = (F32)(mMediaSource->getMediaPlugin()->getWidth()) / (F32)(mMediaSource->getMediaPlugin()->getHeight()); F32 view_aspect = (F32)(r.getWidth()) / (F32)(r.getHeight()); -- cgit v1.2.3 From 5756d41595f3aa2fb1431d1859ee883c15814ae4 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 2 Oct 2017 20:38:37 +0300 Subject: MAINT-7863 Fixed Log in keeps fetching marketplace folders and items --- indra/newview/llinventorymodel.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index dc75e09ad9..054db2a3ec 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2058,11 +2058,6 @@ bool LLInventoryModel::loadSkeleton( // correct contents the next time the viewer opens the folder. tcat->setVersion(NO_VERSION); } - else if (tcat->getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) - { - // Do not trust stock folders being updated - tcat->setVersion(NO_VERSION); - } else { cached_ids.insert(tcat->getUUID()); -- cgit v1.2.3 From 13565cdf0e98f35d3c2735bbda2ab2bcaf2f1235 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 5 Oct 2017 15:47:02 +0300 Subject: MAINT-7871 Blocked residents can pay 1L$ to Blocker and use pay message to avoid block --- indra/newview/llviewermessage.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 1ce18f5496..4848101750 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5664,7 +5664,8 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg) args["NAME"] = source_slurl; is_name_group = is_source_group; name_id = source_id; - if (!reason.empty()) + + if (!reason.empty() && !LLMuteList::getInstance()->isMuted(source_id)) { message = LLTrans::getString("paid_you_ldollars" + gift_suffix, args); } -- cgit v1.2.3 From 1bf5806f31dc7083564da27942838a3b69e92806 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 6 Oct 2017 16:03:41 +0300 Subject: MAINT-1013 Changing YieldTime should show effects immediately --- indra/newview/llappviewer.cpp | 8 +++----- indra/newview/llappviewer.h | 1 - 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index b7267fbdfe..3f4a111a9a 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -693,7 +693,6 @@ LLAppViewer::LLAppViewer() mSavePerAccountSettings(false), // don't save settings on logout unless login succeeded. mQuitRequested(false), mLogoutRequestSent(false), - mYieldTime(-1), mLastAgentControlFlags(0), mLastAgentForceUpdate(0), mMainloopTimeout(NULL), @@ -1457,10 +1456,11 @@ bool LLAppViewer::frame() LL_RECORD_BLOCK_TIME(FTM_SLEEP); // yield some time to the os based on command line option - if(mYieldTime >= 0) + static LLCachedControl yield_time(gSavedSettings, "YieldTime", -1); + if(yield_time >= 0) { LL_RECORD_BLOCK_TIME(FTM_YIELD); - ms_sleep(mYieldTime); + ms_sleep(yield_time); } // yield cooperatively when not running as foreground window @@ -2751,8 +2751,6 @@ bool LLAppViewer::initConfiguration() } } - mYieldTime = gSavedSettings.getS32("YieldTime"); - // Display splash screen. Must be after above check for previous // crash as this dialog is always frontmost. diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 520ff68a02..52d2bce42b 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -291,7 +291,6 @@ private: bool mQuitRequested; // User wants to quit, may have modified documents open. bool mLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim. - S32 mYieldTime; U32 mLastAgentControlFlags; F32 mLastAgentForceUpdate; struct SettingsFiles* mSettingsLocationList; -- cgit v1.2.3 From 8adad782a071d2855543f006455a9f75fd3e4aec Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 9 Oct 2017 10:47:10 +0300 Subject: MAINT-7611 Chat history does not display in the conversation log for groups that have a leading space in their name --- indra/newview/llconversationlog.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 4e69896b69..9ccf9b98f7 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -196,8 +196,6 @@ LLConversationLog::LLConversationLog() : keep_log_ctrlp->getSignal()->connect(boost::bind(&LLConversationLog::enableLogging, this, _2)); if (log_mode > 0) { - loadFromFile(getFileName()); - enableLogging(log_mode); } } @@ -483,16 +481,15 @@ bool LLConversationLog::saveToFile(const std::string& filename) // examples of two file entries // [1343221177] 0 1 0 John Doe| 7e4ec5be-783f-49f5-71dz-16c58c64c145 4ec62a74-c246-0d25-2af6-846beac2aa55 john.doe| // [1343222639] 2 0 0 Ad-hoc Conference| c3g67c89-c479-4c97-b21d-32869bcfe8rc 68f1c33e-4135-3e3e-a897-8c9b23115c09 Ad-hoc Conference hash597394a0-9982-766d-27b8-c75560213b9a| - fprintf(fp, "[%lld] %d %d %d %s| %s %s %s|\n", (S64)conv_it->getTime().value(), (S32)conv_it->getConversationType(), (S32)0, (S32)conv_it->hasOfflineMessages(), - conv_it->getConversationName().c_str(), + conv_it->getConversationName().c_str(), participant_id.c_str(), conversation_id.c_str(), - conv_it->getHistoryFileName().c_str()); + LLURI::escape(conv_it->getHistoryFileName()).c_str()); } fclose(fp); return true; @@ -511,6 +508,7 @@ bool LLConversationLog::loadFromFile(const std::string& filename) LL_WARNS() << "Couldn't open call log list" << filename << LL_ENDL; return false; } + bool purge_required = false; char buffer[MAX_STRING]; char conv_name_buffer[MAX_STRING]; @@ -546,7 +544,7 @@ bool LLConversationLog::loadFromFile(const std::string& filename) .conversation_name(conv_name_buffer) .participant_id(LLUUID(part_id_buffer)) .session_id(LLUUID(conv_id_buffer)) - .history_filename(history_file_name); + .history_filename(LLURI::unescape(history_file_name)); LLConversation conversation(params); @@ -555,6 +553,7 @@ bool LLConversationLog::loadFromFile(const std::string& filename) // being over 30 days old should be purged from the conversation log text file on login. if (conversation.isOlderThan(CONVERSATION_LIFETIME)) { + purge_required = true; continue; } @@ -562,8 +561,11 @@ bool LLConversationLog::loadFromFile(const std::string& filename) } fclose(fp); - LLFile::remove(filename); - cache(); + if(purge_required) + { + LLFile::remove(filename); + cache(); + } notifyObservers(); return true; -- cgit v1.2.3 From 7d393759bae8028be8e2ca2d9e09b7b90a0d9ed5 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 5 Oct 2017 16:03:49 +0300 Subject: MAINT-7820 Additional crash logging --- indra/llcommon/llcoros.cpp | 45 +++++++++++++++++++++++++++++++++++++++++++++ indra/llcommon/llcoros.h | 3 +++ 2 files changed, 48 insertions(+) (limited to 'indra') diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp index 3ffce4810a..934f04287d 100644 --- a/indra/llcommon/llcoros.cpp +++ b/indra/llcommon/llcoros.cpp @@ -40,6 +40,10 @@ #include "stringize.h" #include "llexception.h" +#if LL_WINDOWS +#include +#endif + namespace { void no_op() {} } // anonymous namespace @@ -272,6 +276,43 @@ void LLCoros::setStackSize(S32 stacksize) mStackSize = stacksize; } +#if LL_WINDOWS + +static const U32 STATUS_MSC_EXCEPTION = 0xE06D7363; // compiler specific + +U32 exception_filter(U32 code, struct _EXCEPTION_POINTERS *exception_infop) +{ + if (code == STATUS_MSC_EXCEPTION) + { + // C++ exception, go on + return EXCEPTION_CONTINUE_SEARCH; + } + else + { + // handle it + return EXCEPTION_EXECUTE_HANDLER; + } +} + +void LLCoros::winlevel(const callable_t& callable) +{ + __try + { + callable(); + } + __except (exception_filter(GetExceptionCode(), GetExceptionInformation())) + { + // convert to C++ styled exception + // Note: it might be better to use _se_set_translator + // if you want exception to inherit full callstack + char integer_string[32]; + sprintf(integer_string, "SEH, code: %lu\n", GetExceptionCode()); + throw std::exception(integer_string); + } +} + +#endif + // Top-level wrapper around caller's coroutine callable. This function accepts // the coroutine library's implicit coro::self& parameter and saves it, but // does not pass it down to the caller's callable. @@ -282,7 +323,11 @@ void LLCoros::toplevel(coro::self& self, CoroData* data, const callable_t& calla // run the code the caller actually wants in the coroutine try { +#if LL_WINDOWS + winlevel(callable); +#else callable(); +#endif } catch (const LLContinueError&) { diff --git a/indra/llcommon/llcoros.h b/indra/llcommon/llcoros.h index bbe2d22af4..884d6b159c 100644 --- a/indra/llcommon/llcoros.h +++ b/indra/llcommon/llcoros.h @@ -182,6 +182,9 @@ private: bool cleanup(const LLSD&); struct CoroData; static void no_cleanup(CoroData*); +#if LL_WINDOWS + static void winlevel(const callable_t& callable); +#endif static void toplevel(coro::self& self, CoroData* data, const callable_t& callable); static CoroData& get_CoroData(const std::string& caller); -- cgit v1.2.3 From 1baa1e6d4da09daa9e1314b643df45028fb47175 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 9 Oct 2017 17:41:01 +0300 Subject: MAINT-7882 Crash in LLVOAvatar::logMetricsTimerRecord(...) --- indra/newview/llvoavatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index efcdb07176..cc708ea275 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7025,7 +7025,7 @@ void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapse record["elapsed"] = elapsed; record["completed"] = completed; U32 grid_x(0), grid_y(0); - if (getRegion()) + if (getRegion() && LLWorld::instance().isRegionListed(getRegion())) { record["central_bake_version"] = LLSD::Integer(getRegion()->getCentralBakeVersion()); grid_from_region_handle(getRegion()->getHandle(), &grid_x, &grid_y); -- cgit v1.2.3 From bff358ecc532ed22f7fcbfee978537098bd8be6d Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 10 Oct 2017 14:52:54 +0300 Subject: MAINT-7892 Show MOTD on teleport --- indra/newview/llviewerdisplay.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra') diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index bfa9fa03fa..6d4fc94b63 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -441,6 +441,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) gAgent.setTeleportMessage( LLAgent::sTeleportProgressMessages["requesting"]); gViewerWindow->setProgressString(LLAgent::sTeleportProgressMessages["requesting"]); + gViewerWindow->setProgressMessage(gAgent.mMOTD); break; case LLAgent::TELEPORT_REQUESTED: @@ -518,6 +519,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) } gViewerWindow->setProgressPercent( percent_done ); + gViewerWindow->setProgressMessage(std::string()); } else if (gRestoreGL) @@ -539,6 +541,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) gViewerWindow->setProgressPercent( percent_done ); } + gViewerWindow->setProgressMessage(std::string()); } ////////////////////////// -- cgit v1.2.3 From 746848bee9a2358a6229498901208db38c4b4542 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 6 Apr 2017 14:46:48 -0700 Subject: MAINT-7255: Change viewer to use UserInfo cap if available. --- indra/newview/llagent.cpp | 156 +++++++++++++++++++++++++++++++++----- indra/newview/llagent.h | 10 ++- indra/newview/llviewermessage.cpp | 2 +- indra/newview/llviewerregion.cpp | 1 + 4 files changed, 148 insertions(+), 21 deletions(-) (limited to 'indra') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 8dd0b06ed2..ebff73debf 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -47,7 +47,9 @@ #include "llfloatercamera.h" #include "llfloaterimcontainer.h" #include "llfloaterperms.h" +#include "llfloaterpreference.h" #include "llfloaterreg.h" +#include "llfloatersnapshot.h" #include "llfloatertools.h" #include "llgroupactions.h" #include "llgroupmgr.h" @@ -4334,15 +4336,143 @@ void LLAgent::sendAgentDataUpdateRequest() void LLAgent::sendAgentUserInfoRequest() { - if(getID().isNull()) - return; // not logged in - gMessageSystem->newMessageFast(_PREHASH_UserInfoRequest); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, getID()); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, getSessionID()); - sendReliableMessage(); + std::string cap; + + if (getID().isNull()) + return; // not logged in + + if (mRegionp) + cap = mRegionp->getCapability("UserInfo"); + + if (!cap.empty()) + { + LLCoros::instance().launch("requestAgentUserInfoCoro", + boost::bind(&LLAgent::requestAgentUserInfoCoro, this, cap)); + } + else + { + sendAgentUserInfoRequestMessage(); + } } +void LLAgent::requestAgentUserInfoCoro(std::string capurl) +{ + LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t + httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("requestAgentUserInfoCoro", httpPolicy)); + LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCore::HttpHeaders::ptr_t httpHeaders; + + httpOpts->setFollowRedirects(true); + + LLSD result = httpAdapter->getAndSuspend(httpRequest, capurl, httpOpts, httpHeaders); + + LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; + LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); + + if (!status) + { + LL_WARNS("UserInfo") << "Failed to get user information." << LL_ENDL; + return; + } + else if (!result["success"].asBoolean()) + { + LL_WARNS("UserInfo") << "Failed to get user information: " << result["message"] << LL_ENDL; + return; + } + + bool im_via_email; + std::string email; + std::string dir_visibility; + + im_via_email = result["im_via_email"].asBoolean(); + email = result["email"].asString(); + dir_visibility = result["directory_visibility"].asString(); + + // TODO: This should probably be changed. I'm not entirely comfortable + // having LLAgent interact directly with the UI in this way. + LLFloaterPreference::updateUserInfo(dir_visibility, im_via_email); + LLFloaterSnapshot::setAgentEmail(email); +} + +void LLAgent::sendAgentUpdateUserInfo(bool im_via_email, const std::string& directory_visibility) +{ + std::string cap; + + if (getID().isNull()) + return; // not logged in + + if (mRegionp) + cap = mRegionp->getCapability("UserInfo"); + + if (!cap.empty()) + { + LLCoros::instance().launch("updateAgentUserInfoCoro", + boost::bind(&LLAgent::updateAgentUserInfoCoro, this, cap, im_via_email, directory_visibility)); + } + else + { + sendAgentUpdateUserInfoMessage(im_via_email, directory_visibility); + } +} + + +void LLAgent::updateAgentUserInfoCoro(std::string capurl, bool im_via_email, std::string directory_visibility) +{ + LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t + httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("requestAgentUserInfoCoro", httpPolicy)); + LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCore::HttpHeaders::ptr_t httpHeaders; + + httpOpts->setFollowRedirects(true); + LLSD body(LLSDMap + ("dir_visibility", LLSD::String(directory_visibility)) + ("im_via_email", LLSD::Boolean(im_via_email))); + + LLSD result = httpAdapter->postAndSuspend(httpRequest, capurl, body, httpOpts, httpHeaders); + + LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; + LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); + + if (!status) + { + LL_WARNS("UserInfo") << "Failed to set user information." << LL_ENDL; + } + else if (!result["success"].asBoolean()) + { + LL_WARNS("UserInfo") << "Failed to set user information: " << result["message"] << LL_ENDL; + } +} + +// deprecated: +// May be removed when UserInfo cap propagates to all simhosts in grid +void LLAgent::sendAgentUserInfoRequestMessage() +{ + gMessageSystem->newMessageFast(_PREHASH_UserInfoRequest); + gMessageSystem->nextBlockFast(_PREHASH_AgentData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, getID()); + gMessageSystem->addUUIDFast(_PREHASH_SessionID, getSessionID()); + sendReliableMessage(); +} + +void LLAgent::sendAgentUpdateUserInfoMessage(bool im_via_email, const std::string& directory_visibility) +{ + gMessageSystem->newMessageFast(_PREHASH_UpdateUserInfo); + gMessageSystem->nextBlockFast(_PREHASH_AgentData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, getID()); + gMessageSystem->addUUIDFast(_PREHASH_SessionID, getSessionID()); + gMessageSystem->nextBlockFast(_PREHASH_UserData); + gMessageSystem->addBOOLFast(_PREHASH_IMViaEMail, im_via_email); + gMessageSystem->addString("DirectoryVisibility", directory_visibility); + gAgent.sendReliableMessage(); + +} +// end deprecated +//------ + void LLAgent::observeFriends() { if(!mFriendObserver) @@ -4410,18 +4540,6 @@ const void LLAgent::getTeleportSourceSLURL(LLSLURL& slurl) const slurl = *mTeleportSourceSLURL; } -void LLAgent::sendAgentUpdateUserInfo(bool im_via_email, const std::string& directory_visibility ) -{ - gMessageSystem->newMessageFast(_PREHASH_UpdateUserInfo); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, getID()); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, getSessionID()); - gMessageSystem->nextBlockFast(_PREHASH_UserData); - gMessageSystem->addBOOLFast(_PREHASH_IMViaEMail, im_via_email); - gMessageSystem->addString("DirectoryVisibility", directory_visibility); - gAgent.sendReliableMessage(); -} - // static void LLAgent::dumpGroupInfo() { diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index b5da5e9062..4bb4d317e8 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -912,9 +912,17 @@ public: void sendReliableMessage(); void sendAgentDataUpdateRequest(); void sendAgentUserInfoRequest(); - // IM to Email and Online visibility + +// IM to Email and Online visibility void sendAgentUpdateUserInfo(bool im_to_email, const std::string& directory_visibility); +private: + void requestAgentUserInfoCoro(std::string capurl); + void updateAgentUserInfoCoro(std::string capurl, bool im_via_email, std::string directory_visibility); + // DEPRECATED: may be removed when User Info cap propagates + void sendAgentUserInfoRequestMessage(); + void sendAgentUpdateUserInfoMessage(bool im_via_email, const std::string& directory_visibility); + //-------------------------------------------------------------------- // Receive //-------------------------------------------------------------------- diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 4848101750..98093344a9 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -7259,7 +7259,7 @@ void send_places_query(const LLUUID& query_id, gAgent.sendReliableMessage(); } - +// Deprecated in favor of cap "UserInfo" void process_user_info_reply(LLMessageSystem* msg, void**) { LLUUID agent_id; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 3fd2af87de..3f479802aa 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -2896,6 +2896,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("UpdateScriptAgent"); capabilityNames.append("UpdateScriptTask"); capabilityNames.append("UploadBakedTexture"); + capabilityNames.append("UserInfo"); capabilityNames.append("ViewerAsset"); capabilityNames.append("ViewerMetrics"); capabilityNames.append("ViewerStartAuction"); -- cgit v1.2.3 From dde727aa0f293b4a91ebe5ed573a55e87caa413a Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 6 Jun 2017 10:21:34 -0700 Subject: MAINT-7254, MAINT-7255: Use cap to get and set UserInfo on simhost. Check new is_verified flag and disable IM2Email if value is false. --- indra/newview/llagent.cpp | 4 +++- indra/newview/llfloaterpreference.cpp | 11 ++++++----- indra/newview/llfloaterpreference.h | 4 ++-- indra/newview/llviewermessage.cpp | 3 ++- 4 files changed, 13 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index ebff73debf..f67bb22f5b 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -4383,16 +4383,18 @@ void LLAgent::requestAgentUserInfoCoro(std::string capurl) } bool im_via_email; + bool is_verified_email; std::string email; std::string dir_visibility; im_via_email = result["im_via_email"].asBoolean(); + is_verified_email = result["is_verified"].asBoolean(); email = result["email"].asString(); dir_visibility = result["directory_visibility"].asString(); // TODO: This should probably be changed. I'm not entirely comfortable // having LLAgent interact directly with the UI in this way. - LLFloaterPreference::updateUserInfo(dir_visibility, im_via_email); + LLFloaterPreference::updateUserInfo(dir_visibility, im_via_email, is_verified_email); LLFloaterSnapshot::setAgentEmail(email); } diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 1f460c05ec..e369403e22 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1016,12 +1016,12 @@ void LLFloaterPreference::onBtnCancel(const LLSD& userdata) } // static -void LLFloaterPreference::updateUserInfo(const std::string& visibility, bool im_via_email) +void LLFloaterPreference::updateUserInfo(const std::string& visibility, bool im_via_email, bool is_verified_email) { LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); if (instance) { - instance->setPersonalInfo(visibility, im_via_email); + instance->setPersonalInfo(visibility, im_via_email, is_verified_email); } } @@ -1830,7 +1830,7 @@ bool LLFloaterPreference::moveTranscriptsAndLog() return true; } -void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im_via_email) +void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im_via_email, bool is_verified_email) { mGotPersonalInfo = true; mOriginalIMViaEmail = im_via_email; @@ -1855,8 +1855,9 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im getChildView("friends_online_notify_checkbox")->setEnabled(TRUE); getChild("online_visibility")->setValue(mOriginalHideOnlineStatus); getChild("online_visibility")->setLabelArg("[DIR_VIS]", mDirectoryVisibility); - getChildView("send_im_to_email")->setEnabled(TRUE); - getChild("send_im_to_email")->setValue(im_via_email); + getChildView("send_im_to_email")->setEnabled(is_verified_email); + // *TODO: Show or hide verify email text here based on is_verified_email + getChild("send_im_to_email")->setValue(im_via_email); getChildView("favorites_on_login_check")->setEnabled(TRUE); getChildView("log_path_button")->setEnabled(TRUE); getChildView("chat_font_size")->setEnabled(TRUE); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 2bb2e7e9ff..444ad5a928 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -75,7 +75,7 @@ public: /*virtual*/ void changed(const LLUUID& session_id, U32 mask) {}; // static data update, called from message handler - static void updateUserInfo(const std::string& visibility, bool im_via_email); + static void updateUserInfo(const std::string& visibility, bool im_via_email, bool is_verified_email); // refresh all the graphics preferences menus static void refreshEnabledGraphics(); @@ -147,7 +147,7 @@ public: void onClickLogPath(); bool moveTranscriptsAndLog(); void enableHistory(); - void setPersonalInfo(const std::string& visibility, bool im_via_email); + void setPersonalInfo(const std::string& visibility, bool im_via_email, bool is_verified_email); void refreshEnabledState(); void onCommitWindowedMode(); void refresh(); // Refresh enable/disable diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 98093344a9..2144c7d481 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -7277,7 +7277,8 @@ void process_user_info_reply(LLMessageSystem* msg, void**) std::string dir_visibility; msg->getString( "UserData", "DirectoryVisibility", dir_visibility); - LLFloaterPreference::updateUserInfo(dir_visibility, im_via_email); + // For Message based user info information the is_verified is assumed to be false. + LLFloaterPreference::updateUserInfo(dir_visibility, im_via_email, false); LLFloaterSnapshot::setAgentEmail(email); } -- cgit v1.2.3 From 19bb6fd33e315e1370583d7a90ec3da10f184a54 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 27 Sep 2017 15:27:30 -0400 Subject: MAINT-7081: Mention nghttp2 library wherever it must be mentioned. --- indra/cmake/Copy3rdPartyLibs.cmake | 1 + indra/cmake/NGHTTP2.cmake | 20 ++++++++++++++++++++ indra/llcorehttp/CMakeLists.txt | 4 ++++ indra/llmessage/CMakeLists.txt | 4 ++++ indra/llplugin/CMakeLists.txt | 2 +- indra/newview/CMakeLists.txt | 1 + indra/newview/viewer_manifest.py | 1 + 7 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 indra/cmake/NGHTTP2.cmake (limited to 'indra') diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 5ccbe7d1d8..cb7432ce4c 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -169,6 +169,7 @@ elseif(DARWIN) ${EXPAT_COPY} libGLOD.dylib libndofdev.dylib + libnghttp2.dylib ) if (FMODEX) diff --git a/indra/cmake/NGHTTP2.cmake b/indra/cmake/NGHTTP2.cmake new file mode 100644 index 0000000000..df191ff3c1 --- /dev/null +++ b/indra/cmake/NGHTTP2.cmake @@ -0,0 +1,20 @@ +include(Prebuilt) + +set(NGHTTP2_FIND_QUIETLY ON) +set(NGHTTP2_FIND_REQUIRED ON) + +if (USESYSTEMLIBS) + include(FindNGHTTP2) +else (USESYSTEMLIBS) + use_prebuilt_binary(nghttp2) + if (WINDOWS) + set(NGHTTP2_LIBRARIES + ${ARCH_PREBUILT_DIRS_RELEASE}/nghttp2.lib + ) + elseif (DARWIN) + set(NGHTTP2_LIBRARIES libnghttp2.dylib) + else (WINDOWS) + set(NGHTTP2_LIBRARIES libnghttp2.a) + endif (WINDOWS) + set(NGHTTP2_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/nghttp2) +endif (USESYSTEMLIBS) diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index 435fb09aa4..40ec836f12 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -6,6 +6,7 @@ include(00-Common) include(GoogleMock) include(CURL) include(OpenSSL) +include(NGHTTP2) include(ZLIB) include(LLCoreHttp) include(LLAddBuildTest) @@ -94,6 +95,7 @@ target_link_libraries( ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARIES} + ${NGHTTP2_LIBRARIES} ${BOOST_THREAD_LIBRARY} ${BOOST_SYSTEM_LIBRARY} ) @@ -132,6 +134,7 @@ if (LL_TESTS) ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARIES} + ${NGHTTP2_LIBRARIES} ${BOOST_THREAD_LIBRARY} ${BOOST_SYSTEM_LIBRARY} ) @@ -202,6 +205,7 @@ endif (DARWIN) ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARIES} + ${NGHTTP2_LIBRARIES} ${BOOST_THREAD_LIBRARY} ${BOOST_SYSTEM_LIBRARY} ) diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt index 87bec60d95..e0922c0667 100644 --- a/indra/llmessage/CMakeLists.txt +++ b/indra/llmessage/CMakeLists.txt @@ -214,6 +214,7 @@ target_link_libraries( ${JSONCPP_LIBRARIES} ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARIES} + ${NGHTTP2_LIBRARIES} ${XMLRPCEPI_LIBRARIES} ${LLCOREHTTP_LIBRARIES} ${BOOST_COROUTINE_LIBRARY} @@ -231,6 +232,7 @@ target_link_libraries( ${JSONCPP_LIBRARIES} ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARIES} + ${NGHTTP2_LIBRARIES} ${XMLRPCEPI_LIBRARIES} ${LLCOREHTTP_LIBRARIES} ${BOOST_COROUTINE_LIBRARY} @@ -257,6 +259,7 @@ if (LINUX) ${LLVFS_LIBRARIES} ${LLMATH_LIBRARIES} ${CURL_LIBRARIES} + ${NGHTTP2_LIBRARIES} ${LLCOMMON_LIBRARIES} ${LLMESSAGE_LIBRARIES} ${LLCOREHTTP_LIBRARIES} @@ -272,6 +275,7 @@ else (LINUX) ${LLVFS_LIBRARIES} ${LLMATH_LIBRARIES} ${CURL_LIBRARIES} + ${NGHTTP2_LIBRARIES} ${LLCOMMON_LIBRARIES} ${LLMESSAGE_LIBRARIES} ${LLCOREHTTP_LIBRARIES} diff --git a/indra/llplugin/CMakeLists.txt b/indra/llplugin/CMakeLists.txt index 2cdea67723..129efeb529 100644 --- a/indra/llplugin/CMakeLists.txt +++ b/indra/llplugin/CMakeLists.txt @@ -82,7 +82,7 @@ if (LL_TESTS) set_source_files_properties( llplugincookiestore.cpp PROPERTIES - LL_TEST_ADDITIONAL_LIBRARIES "${CURL_LIBRARIES}" + LL_TEST_ADDITIONAL_LIBRARIES "${CURL_LIBRARIES};${NGHTTP2_LIBRARIES}" ) LL_ADD_PROJECT_UNIT_TESTS(llplugin "${llplugin_TEST_SOURCE_FILES}") diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f353109deb..2100c91cfe 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2219,6 +2219,7 @@ if (LL_TESTS) ${LLCOMMON_LIBRARIES} ${JSONCPP_LIBRARIES} ${CURL_LIBRARIES} + ${NGHTTP2_LIBRARIES} ) set_source_files_properties( diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 900e9f7b1b..e9e1b1d6ac 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -930,6 +930,7 @@ class DarwinManifest(ViewerManifest): "libexpat.1.dylib", "libexception_handler.dylib", "libGLOD.dylib", + "libnghttp2.dylib", ): dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) -- cgit v1.2.3 From 1a22b7706419f592c132a1c9234c9efeb10fd4f7 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 28 Sep 2017 17:58:03 -0400 Subject: MAINT-7081: Package all libnghttp2.*.dylibs. To support that, enhance path_optional() to accept wildcards and return the expanded filenames. --- indra/newview/viewer_manifest.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index e9e1b1d6ac..29c9337cc1 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -906,10 +906,19 @@ class DarwinManifest(ViewerManifest): or a list containing dst (present). Concatenate these return values to get a list of all libs that are present. """ - if self.path(src, dst): - return [dst] - print "Skipping %s" % dst - return [] + # This was simple before we started needing to pass + # wildcards. Fortunately, self.path() ends up appending a + # (source, dest) pair to self.file_list for every expanded + # file processed. Remember its size before the call. + oldlen = len(self.file_list) + self.path(src, dst) + # The dest appended to self.file_list has been prepended + # with self.get_dst_prefix(). Strip it off again. + added = [os.path.relpath(d, self.get_dst_prefix()) + for s, d in self.file_list[oldlen:]] + if not added: + print "Skipping %s" % dst + return added # dylibs is a list of all the .dylib files we expect to need # in our bundled sub-apps. For each of these we'll create a @@ -930,7 +939,10 @@ class DarwinManifest(ViewerManifest): "libexpat.1.dylib", "libexception_handler.dylib", "libGLOD.dylib", - "libnghttp2.dylib", + # libnghttp2.dylib is a symlink to + # libnghttp2.major.dylib, which is a symlink + # to libnghttp2.version.dylib. Get all of them. + "libnghttp2.*dylib", ): dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) -- cgit v1.2.3 From a05214da35863dd5f0fd8ea47c494190b1c10656 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 29 Sep 2017 08:45:45 -0400 Subject: MAINT-2081: Remove ancient snapshot of CMake GetPrerequisites. Mani captured that snapshot back when CMake version 2.8 was newer than what was running on our build systems. Now we have to assume that the bundled GetPrerequisites.cmake is better than our old snapshot. Use the bunded one. --- indra/cmake/CMakeLists.txt | 1 - indra/cmake/DeploySharedLibs.cmake | 5 +- indra/cmake/GetPrerequisites_2_8.cmake | 786 --------------------------------- 3 files changed, 1 insertion(+), 791 deletions(-) delete mode 100644 indra/cmake/GetPrerequisites_2_8.cmake (limited to 'indra') diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 100645611e..4a3ebe4835 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -44,7 +44,6 @@ set(cmake_SOURCE_FILES GLH.cmake GLOD.cmake ## GStreamer010Plugin.cmake - GetPrerequisites_2_8.cmake GoogleBreakpad.cmake GoogleMock.cmake Havok.cmake diff --git a/indra/cmake/DeploySharedLibs.cmake b/indra/cmake/DeploySharedLibs.cmake index e57fd5eee3..9d6cf0cb35 100644 --- a/indra/cmake/DeploySharedLibs.cmake +++ b/indra/cmake/DeploySharedLibs.cmake @@ -7,10 +7,7 @@ # SEARCH_DIRS= The full paths to dirs to search for dependencies. # DST_PATH= The full path where the dependecies will be copied. -# *FIX:Mani - I pulled in the CMake 2.8 GetPrerequisites.cmake script here, because it works on windows where 2.6 did not. -# Once we have officially upgraded to 2.8 we can just use that version of GetPrerequisites.cmake. -get_filename_component(current_dir ${CMAKE_CURRENT_LIST_FILE} PATH) -include(${current_dir}/GetPrerequisites_2_8.cmake) +include(GetPrerequisites) message(STATUS "Getting recursive dependencies for file: ${BIN_NAME}") diff --git a/indra/cmake/GetPrerequisites_2_8.cmake b/indra/cmake/GetPrerequisites_2_8.cmake deleted file mode 100644 index 05ec1539ba..0000000000 --- a/indra/cmake/GetPrerequisites_2_8.cmake +++ /dev/null @@ -1,786 +0,0 @@ -# GetPrerequisites.cmake -# -# This script provides functions to list the .dll, .dylib or .so files that an -# executable or shared library file depends on. (Its prerequisites.) -# -# It uses various tools to obtain the list of required shared library files: -# dumpbin (Windows) -# ldd (Linux/Unix) -# otool (Mac OSX) -# -# The following functions are provided by this script: -# gp_append_unique -# is_file_executable -# gp_item_default_embedded_path -# (projects can override with gp_item_default_embedded_path_override) -# gp_resolve_item -# (projects can override with gp_resolve_item_override) -# gp_resolved_file_type -# gp_file_type -# get_prerequisites -# list_prerequisites -# list_prerequisites_by_glob -# -# Requires CMake 2.6 or greater because it uses function, break, return and -# PARENT_SCOPE. - -#============================================================================= -# Copyright 2008-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distributed this file outside of CMake, substitute the full -# License text for the above reference.) - -# gp_append_unique list_var value -# -# Append value to the list variable ${list_var} only if the value is not -# already in the list. -# -function(gp_append_unique list_var value) - set(contains 0) - - foreach(item ${${list_var}}) - if("${item}" STREQUAL "${value}") - set(contains 1) - break() - endif("${item}" STREQUAL "${value}") - endforeach(item) - - if(NOT contains) - set(${list_var} ${${list_var}} "${value}" PARENT_SCOPE) - endif(NOT contains) -endfunction(gp_append_unique) - - -# is_file_executable file result_var -# -# Return 1 in ${result_var} if ${file} is a binary executable. -# -# Return 0 in ${result_var} otherwise. -# -function(is_file_executable file result_var) - # - # A file is not executable until proven otherwise: - # - set(${result_var} 0 PARENT_SCOPE) - - get_filename_component(file_full "${file}" ABSOLUTE) - string(TOLOWER "${file_full}" file_full_lower) - - # If file name ends in .exe on Windows, *assume* executable: - # - if(WIN32) - if("${file_full_lower}" MATCHES "\\.exe$") - set(${result_var} 1 PARENT_SCOPE) - return() - endif("${file_full_lower}" MATCHES "\\.exe$") - - # A clause could be added here that uses output or return value of dumpbin - # to determine ${result_var}. In 99%+? practical cases, the exe name - # match will be sufficient... - # - endif(WIN32) - - # Use the information returned from the Unix shell command "file" to - # determine if ${file_full} should be considered an executable file... - # - # If the file command's output contains "executable" and does *not* contain - # "text" then it is likely an executable suitable for prerequisite analysis - # via the get_prerequisites macro. - # - if(UNIX) - if(NOT file_cmd) - find_program(file_cmd "file") - endif(NOT file_cmd) - - if(file_cmd) - execute_process(COMMAND "${file_cmd}" "${file_full}" - OUTPUT_VARIABLE file_ov - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - - # Replace the name of the file in the output with a placeholder token - # (the string " _file_full_ ") so that just in case the path name of - # the file contains the word "text" or "executable" we are not fooled - # into thinking "the wrong thing" because the file name matches the - # other 'file' command output we are looking for... - # - string(REPLACE "${file_full}" " _file_full_ " file_ov "${file_ov}") - string(TOLOWER "${file_ov}" file_ov) - - #message(STATUS "file_ov='${file_ov}'") - if("${file_ov}" MATCHES "executable") - #message(STATUS "executable!") - if("${file_ov}" MATCHES "text") - #message(STATUS "but text, so *not* a binary executable!") - else("${file_ov}" MATCHES "text") - set(${result_var} 1 PARENT_SCOPE) - return() - endif("${file_ov}" MATCHES "text") - endif("${file_ov}" MATCHES "executable") - else(file_cmd) - message(STATUS "warning: No 'file' command, skipping execute_process...") - endif(file_cmd) - endif(UNIX) -endfunction(is_file_executable) - - -# gp_item_default_embedded_path item default_embedded_path_var -# -# Return the path that others should refer to the item by when the item -# is embedded inside a bundle. -# -# Override on a per-project basis by providing a project-specific -# gp_item_default_embedded_path_override function. -# -function(gp_item_default_embedded_path item default_embedded_path_var) - - # On Windows and Linux, "embed" prerequisites in the same directory - # as the executable by default: - # - set(path "@executable_path") - set(overridden 0) - - # On the Mac, relative to the executable depending on the type - # of the thing we are embedding: - # - if(APPLE) - # - # The assumption here is that all executables in the bundle will be - # in same-level-directories inside the bundle. The parent directory - # of an executable inside the bundle should be MacOS or a sibling of - # MacOS and all embedded paths returned from here will begin with - # "@executable_path/../" and will work from all executables in all - # such same-level-directories inside the bundle. - # - - # By default, embed things right next to the main bundle executable: - # - set(path "@executable_path/../../Contents/MacOS") - - # Embed .dylibs right next to the main bundle executable: - # - if(item MATCHES "\\.dylib$") - set(path "@executable_path/../MacOS") - set(overridden 1) - endif(item MATCHES "\\.dylib$") - - # Embed frameworks in the embedded "Frameworks" directory (sibling of MacOS): - # - if(NOT overridden) - if(item MATCHES "[^/]+\\.framework/") - set(path "@executable_path/../Frameworks") - set(overridden 1) - endif(item MATCHES "[^/]+\\.framework/") - endif(NOT overridden) - endif() - - # Provide a hook so that projects can override the default embedded location - # of any given library by whatever logic they choose: - # - if(COMMAND gp_item_default_embedded_path_override) - gp_item_default_embedded_path_override("${item}" path) - endif(COMMAND gp_item_default_embedded_path_override) - - set(${default_embedded_path_var} "${path}" PARENT_SCOPE) -endfunction(gp_item_default_embedded_path) - - -# gp_resolve_item context item exepath dirs resolved_item_var -# -# Resolve an item into an existing full path file. -# -# Override on a per-project basis by providing a project-specific -# gp_resolve_item_override function. -# -function(gp_resolve_item context item exepath dirs resolved_item_var) - set(resolved 0) - set(resolved_item "${item}") - - # Is it already resolved? - # - if(EXISTS "${resolved_item}") - set(resolved 1) - endif(EXISTS "${resolved_item}") - - if(NOT resolved) - if(item MATCHES "@executable_path") - # - # @executable_path references are assumed relative to exepath - # - string(REPLACE "@executable_path" "${exepath}" ri "${item}") - get_filename_component(ri "${ri}" ABSOLUTE) - - if(EXISTS "${ri}") - #message(STATUS "info: embedded item exists (${ri})") - set(resolved 1) - set(resolved_item "${ri}") - else(EXISTS "${ri}") - message(STATUS "warning: embedded item does not exist '${ri}'") - endif(EXISTS "${ri}") - endif(item MATCHES "@executable_path") - endif(NOT resolved) - - if(NOT resolved) - if(item MATCHES "@loader_path") - # - # @loader_path references are assumed relative to the - # PATH of the given "context" (presumably another library) - # - get_filename_component(contextpath "${context}" PATH) - string(REPLACE "@loader_path" "${contextpath}" ri "${item}") - get_filename_component(ri "${ri}" ABSOLUTE) - - if(EXISTS "${ri}") - #message(STATUS "info: embedded item exists (${ri})") - set(resolved 1) - set(resolved_item "${ri}") - else(EXISTS "${ri}") - message(STATUS "warning: embedded item does not exist '${ri}'") - endif(EXISTS "${ri}") - endif(item MATCHES "@loader_path") - endif(NOT resolved) - - if(NOT resolved) - set(ri "ri-NOTFOUND") - find_file(ri "${item}" ${exepath} ${dirs} NO_DEFAULT_PATH) - find_file(ri "${item}" ${exepath} ${dirs} /usr/lib) - if(ri) - #message(STATUS "info: 'find_file' in exepath/dirs (${ri})") - set(resolved 1) - set(resolved_item "${ri}") - set(ri "ri-NOTFOUND") - endif(ri) - endif(NOT resolved) - - if(NOT resolved) - if(item MATCHES "[^/]+\\.framework/") - set(fw "fw-NOTFOUND") - find_file(fw "${item}" - "~/Library/Frameworks" - "/Library/Frameworks" - "/System/Library/Frameworks" - ) - if(fw) - #message(STATUS "info: 'find_file' found framework (${fw})") - set(resolved 1) - set(resolved_item "${fw}") - set(fw "fw-NOTFOUND") - endif(fw) - endif(item MATCHES "[^/]+\\.framework/") - endif(NOT resolved) - - # Using find_program on Windows will find dll files that are in the PATH. - # (Converting simple file names into full path names if found.) - # - if(WIN32) - if(NOT resolved) - set(ri "ri-NOTFOUND") - find_program(ri "${item}" PATHS "${exepath};${dirs}" NO_DEFAULT_PATH) - find_program(ri "${item}" PATHS "${exepath};${dirs}") - if(ri) - #message(STATUS "info: 'find_program' in exepath/dirs (${ri})") - set(resolved 1) - set(resolved_item "${ri}") - set(ri "ri-NOTFOUND") - endif(ri) - endif(NOT resolved) - endif(WIN32) - - # Provide a hook so that projects can override item resolution - # by whatever logic they choose: - # - if(COMMAND gp_resolve_item_override) - gp_resolve_item_override("${context}" "${item}" "${exepath}" "${dirs}" resolved_item resolved) - endif(COMMAND gp_resolve_item_override) - - if(NOT resolved) - message(STATUS " -warning: cannot resolve item '${item}' - - possible problems: - need more directories? - need to use InstallRequiredSystemLibraries? - run in install tree instead of build tree? -") -# message(STATUS " -#****************************************************************************** -#warning: cannot resolve item '${item}' -# -# possible problems: -# need more directories? -# need to use InstallRequiredSystemLibraries? -# run in install tree instead of build tree? -# -# context='${context}' -# item='${item}' -# exepath='${exepath}' -# dirs='${dirs}' -# resolved_item_var='${resolved_item_var}' -#****************************************************************************** -#") - endif(NOT resolved) - - set(${resolved_item_var} "${resolved_item}" PARENT_SCOPE) -endfunction(gp_resolve_item) - - -# gp_resolved_file_type original_file file exepath dirs type_var -# -# Return the type of ${file} with respect to ${original_file}. String -# describing type of prerequisite is returned in variable named ${type_var}. -# -# Use ${exepath} and ${dirs} if necessary to resolve non-absolute ${file} -# values -- but only for non-embedded items. -# -# Possible types are: -# system -# local -# embedded -# other -# -function(gp_resolved_file_type original_file file exepath dirs type_var) - #message(STATUS "**") - - if(NOT IS_ABSOLUTE "${original_file}") - message(STATUS "warning: gp_resolved_file_type expects absolute full path for first arg original_file") - endif() - - set(is_embedded 0) - set(is_local 0) - set(is_system 0) - - set(resolved_file "${file}") - - if("${file}" MATCHES "^@(executable|loader)_path") - set(is_embedded 1) - endif() - - if(NOT is_embedded) - if(NOT IS_ABSOLUTE "${file}") - gp_resolve_item("${original_file}" "${file}" "${exepath}" "${dirs}" resolved_file) - endif() - - string(TOLOWER "${original_file}" original_lower) - string(TOLOWER "${resolved_file}" lower) - - if(UNIX) - if(resolved_file MATCHES "^(/lib/|/lib32/|/lib64/|/usr/lib/|/usr/lib32/|/usr/lib64/|/usr/X11R6/)") - set(is_system 1) - endif() - endif() - - if(APPLE) - if(resolved_file MATCHES "^(/System/Library/|/usr/lib/)") - set(is_system 1) - endif() - endif() - - if(WIN32) - string(TOLOWER "$ENV{SystemRoot}" sysroot) - string(REGEX REPLACE "\\\\" "/" sysroot "${sysroot}") - - string(TOLOWER "$ENV{windir}" windir) - string(REGEX REPLACE "\\\\" "/" windir "${windir}") - - if(lower MATCHES "^(${sysroot}/system|${windir}/system|${sysroot}/syswow|${windir}/syswow|(.*/)*msvc[^/]+dll)") - set(is_system 1) - endif() - endif() - - if(NOT is_system) - get_filename_component(original_path "${original_lower}" PATH) - get_filename_component(path "${lower}" PATH) - if("${original_path}" STREQUAL "${path}") - set(is_local 1) - endif() - endif() - endif() - - # Return type string based on computed booleans: - # - set(type "other") - - if(is_system) - set(type "system") - elseif(is_embedded) - set(type "embedded") - elseif(is_local) - set(type "local") - endif() - - #message(STATUS "gp_resolved_file_type: '${file}' '${resolved_file}'") - #message(STATUS " type: '${type}'") - - if(NOT is_embedded) - if(NOT IS_ABSOLUTE "${resolved_file}") - if(lower MATCHES "^msvc[^/]+dll" AND is_system) - message(STATUS "info: non-absolute msvc file '${file}' returning type '${type}'") - else() - message(STATUS "warning: gp_resolved_file_type non-absolute file '${file}' returning type '${type}' -- possibly incorrect") - endif() - endif() - endif() - - set(${type_var} "${type}" PARENT_SCOPE) - - #message(STATUS "**") -endfunction() - - -# gp_file_type original_file file type_var -# -# Return the type of ${file} with respect to ${original_file}. String -# describing type of prerequisite is returned in variable named ${type_var}. -# -# Possible types are: -# system -# local -# embedded -# other -# -function(gp_file_type original_file file type_var) - if(NOT IS_ABSOLUTE "${original_file}") - message(STATUS "warning: gp_file_type expects absolute full path for first arg original_file") - endif() - - get_filename_component(exepath "${original_file}" PATH) - - set(type "") - gp_resolved_file_type("${original_file}" "${file}" "${exepath}" "" type) - - set(${type_var} "${type}" PARENT_SCOPE) -endfunction(gp_file_type) - - -# get_prerequisites target prerequisites_var exclude_system recurse dirs -# -# Get the list of shared library files required by ${target}. The list in -# the variable named ${prerequisites_var} should be empty on first entry to -# this function. On exit, ${prerequisites_var} will contain the list of -# required shared library files. -# -# target is the full path to an executable file -# -# prerequisites_var is the name of a CMake variable to contain the results -# -# exclude_system is 0 or 1: 0 to include "system" prerequisites , 1 to -# exclude them -# -# recurse is 0 or 1: 0 for direct prerequisites only, 1 for all prerequisites -# recursively -# -# exepath is the path to the top level executable used for @executable_path -# replacment on the Mac -# -# dirs is a list of paths where libraries might be found: these paths are -# searched first when a target without any path info is given. Then standard -# system locations are also searched: PATH, Framework locations, /usr/lib... -# -function(get_prerequisites target prerequisites_var exclude_system recurse exepath dirs) - set(verbose 0) - set(eol_char "E") - - if(NOT IS_ABSOLUTE "${target}") - message("warning: target '${target}' is not absolute...") - endif(NOT IS_ABSOLUTE "${target}") - - if(NOT EXISTS "${target}") - message("warning: target '${target}' does not exist...") - endif(NOT EXISTS "${target}") - - # - # - # Try to choose the right tool by default. Caller can set gp_tool prior to - # calling this function to force using a different tool. - # - if("${gp_tool}" STREQUAL "") - set(gp_tool "ldd") - if(APPLE) - set(gp_tool "otool") - endif(APPLE) - if(WIN32) - set(gp_tool "dumpbin") - endif(WIN32) - endif("${gp_tool}" STREQUAL "") - - set(gp_tool_known 0) - - if("${gp_tool}" STREQUAL "ldd") - set(gp_cmd_args "") - set(gp_regex "^[\t ]*[^\t ]+ => ([^\t ]+).*${eol_char}$") - set(gp_regex_cmp_count 1) - set(gp_tool_known 1) - endif("${gp_tool}" STREQUAL "ldd") - - if("${gp_tool}" STREQUAL "otool") - set(gp_cmd_args "-L") - set(gp_regex "^\t([^\t]+) \\(compatibility version ([0-9]+.[0-9]+.[0-9]+), current version ([0-9]+.[0-9]+.[0-9]+)\\)${eol_char}$") - set(gp_regex_cmp_count 3) - set(gp_tool_known 1) - endif("${gp_tool}" STREQUAL "otool") - - if("${gp_tool}" STREQUAL "dumpbin") - set(gp_cmd_args "/dependents") - set(gp_regex "^ ([^ ].*[Dd][Ll][Ll])${eol_char}$") - set(gp_regex_cmp_count 1) - set(gp_tool_known 1) - set(ENV{VS_UNICODE_OUTPUT} "") # Block extra output from inside VS IDE. - endif("${gp_tool}" STREQUAL "dumpbin") - - if(NOT gp_tool_known) - message(STATUS "warning: gp_tool='${gp_tool}' is an unknown tool...") - message(STATUS "CMake function get_prerequisites needs more code to handle '${gp_tool}'") - message(STATUS "Valid gp_tool values are dumpbin, ldd and otool.") - return() - endif(NOT gp_tool_known) - - set(gp_cmd_paths ${gp_cmd_paths} - "C:/Program Files/Microsoft Visual Studio 9.0/VC/bin" - "C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin" - "C:/Program Files/Microsoft Visual Studio 8/VC/BIN" - "C:/Program Files (x86)/Microsoft Visual Studio 8/VC/BIN" - "C:/Program Files/Microsoft Visual Studio .NET 2003/VC7/BIN" - "C:/Program Files (x86)/Microsoft Visual Studio .NET 2003/VC7/BIN" - "/usr/local/bin" - "/usr/bin" - ) - - find_program(gp_cmd ${gp_tool} PATHS ${gp_cmd_paths}) - - if(NOT gp_cmd) - message(STATUS "warning: could not find '${gp_tool}' - cannot analyze prerequisites...") - return() - endif(NOT gp_cmd) - - if("${gp_tool}" STREQUAL "dumpbin") - # When running dumpbin, it also needs the "Common7/IDE" directory in the - # PATH. It will already be in the PATH if being run from a Visual Studio - # command prompt. Add it to the PATH here in case we are running from a - # different command prompt. - # - get_filename_component(gp_cmd_dir "${gp_cmd}" PATH) - get_filename_component(gp_cmd_dlls_dir "${gp_cmd_dir}/../../Common7/IDE" ABSOLUTE) - if(EXISTS "${gp_cmd_dlls_dir}") - # only add to the path if it is not already in the path - if(NOT "$ENV{PATH}" MATCHES "${gp_cmd_dlls_dir}") - set(ENV{PATH} "$ENV{PATH};${gp_cmd_dlls_dir}") - endif(NOT "$ENV{PATH}" MATCHES "${gp_cmd_dlls_dir}") - endif(EXISTS "${gp_cmd_dlls_dir}") - endif("${gp_tool}" STREQUAL "dumpbin") - # - # - - if("${gp_tool}" STREQUAL "ldd") - set(old_ld_env "$ENV{LD_LIBRARY_PATH}") - foreach(dir ${exepath} ${dirs}) - set(ENV{LD_LIBRARY_PATH} "${dir}:$ENV{LD_LIBRARY_PATH}") - endforeach(dir) - endif("${gp_tool}" STREQUAL "ldd") - - - # Track new prerequisites at each new level of recursion. Start with an - # empty list at each level: - # - set(unseen_prereqs) - - # Run gp_cmd on the target: - # - execute_process( - COMMAND ${gp_cmd} ${gp_cmd_args} ${target} - OUTPUT_VARIABLE gp_cmd_ov - ) - - if("${gp_tool}" STREQUAL "ldd") - set(ENV{LD_LIBRARY_PATH} "${old_ld_env}") - endif("${gp_tool}" STREQUAL "ldd") - - if(verbose) - message(STATUS "") - message(STATUS "gp_cmd_ov='${gp_cmd_ov}'") - message(STATUS "") - endif(verbose) - - get_filename_component(target_dir "${target}" PATH) - - # Convert to a list of lines: - # - string(REGEX REPLACE ";" "\\\\;" candidates "${gp_cmd_ov}") - string(REGEX REPLACE "\n" "${eol_char};" candidates "${candidates}") - - # Analyze each line for file names that match the regular expression: - # - foreach(candidate ${candidates}) - if("${candidate}" MATCHES "${gp_regex}") - # Extract information from each candidate: - string(REGEX REPLACE "${gp_regex}" "\\1" raw_item "${candidate}") - - if(gp_regex_cmp_count GREATER 1) - string(REGEX REPLACE "${gp_regex}" "\\2" raw_compat_version "${candidate}") - string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\1" compat_major_version "${raw_compat_version}") - string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\2" compat_minor_version "${raw_compat_version}") - string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\3" compat_patch_version "${raw_compat_version}") - endif(gp_regex_cmp_count GREATER 1) - - if(gp_regex_cmp_count GREATER 2) - string(REGEX REPLACE "${gp_regex}" "\\3" raw_current_version "${candidate}") - string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\1" current_major_version "${raw_current_version}") - string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\2" current_minor_version "${raw_current_version}") - string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\3" current_patch_version "${raw_current_version}") - endif(gp_regex_cmp_count GREATER 2) - - # Use the raw_item as the list entries returned by this function. Use the - # gp_resolve_item function to resolve it to an actual full path file if - # necessary. - # - set(item "${raw_item}") - - # Add each item unless it is excluded: - # - set(add_item 1) - - if(${exclude_system}) - set(type "") - gp_resolved_file_type("${target}" "${item}" "${exepath}" "${dirs}" type) - if("${type}" STREQUAL "system") - set(add_item 0) - endif("${type}" STREQUAL "system") - endif(${exclude_system}) - - if(add_item) - list(LENGTH ${prerequisites_var} list_length_before_append) - gp_append_unique(${prerequisites_var} "${item}") - list(LENGTH ${prerequisites_var} list_length_after_append) - - if(${recurse}) - # If item was really added, this is the first time we have seen it. - # Add it to unseen_prereqs so that we can recursively add *its* - # prerequisites... - # - # But first: resolve its name to an absolute full path name such - # that the analysis tools can simply accept it as input. - # - if(NOT list_length_before_append EQUAL list_length_after_append) - gp_resolve_item("${target}" "${item}" "${exepath}" "${dirs}" resolved_item) - set(unseen_prereqs ${unseen_prereqs} "${resolved_item}") - endif(NOT list_length_before_append EQUAL list_length_after_append) - endif(${recurse}) - endif(add_item) - else("${candidate}" MATCHES "${gp_regex}") - if(verbose) - message(STATUS "ignoring non-matching line: '${candidate}'") - endif(verbose) - endif("${candidate}" MATCHES "${gp_regex}") - endforeach(candidate) - - list(LENGTH ${prerequisites_var} prerequisites_var_length) - if(prerequisites_var_length GREATER 0) - list(SORT ${prerequisites_var}) - endif(prerequisites_var_length GREATER 0) - if(${recurse}) - set(more_inputs ${unseen_prereqs}) - foreach(input ${more_inputs}) - get_prerequisites("${input}" ${prerequisites_var} ${exclude_system} ${recurse} "${exepath}" "${dirs}") - endforeach(input) - endif(${recurse}) - - set(${prerequisites_var} ${${prerequisites_var}} PARENT_SCOPE) -endfunction(get_prerequisites) - - -# list_prerequisites target all exclude_system verbose -# -# ARGV0 (target) is the full path to an executable file -# -# optional ARGV1 (all) is 0 or 1: 0 for direct prerequisites only, -# 1 for all prerequisites recursively -# -# optional ARGV2 (exclude_system) is 0 or 1: 0 to include "system" -# prerequisites , 1 to exclude them -# -# optional ARGV3 (verbose) is 0 or 1: 0 to print only full path -# names of prerequisites, 1 to print extra information -# -function(list_prerequisites target) - if("${ARGV1}" STREQUAL "") - set(all 1) - else("${ARGV1}" STREQUAL "") - set(all "${ARGV1}") - endif("${ARGV1}" STREQUAL "") - - if("${ARGV2}" STREQUAL "") - set(exclude_system 0) - else("${ARGV2}" STREQUAL "") - set(exclude_system "${ARGV2}") - endif("${ARGV2}" STREQUAL "") - - if("${ARGV3}" STREQUAL "") - set(verbose 0) - else("${ARGV3}" STREQUAL "") - set(verbose "${ARGV3}") - endif("${ARGV3}" STREQUAL "") - - set(count 0) - set(count_str "") - set(print_count "${verbose}") - set(print_prerequisite_type "${verbose}") - set(print_target "${verbose}") - set(type_str "") - - get_filename_component(exepath "${target}" PATH) - - set(prereqs "") - get_prerequisites("${target}" prereqs ${exclude_system} ${all} "${exepath}" "") - - if(print_target) - message(STATUS "File '${target}' depends on:") - endif(print_target) - - foreach(d ${prereqs}) - math(EXPR count "${count} + 1") - - if(print_count) - set(count_str "${count}. ") - endif(print_count) - - if(print_prerequisite_type) - gp_file_type("${target}" "${d}" type) - set(type_str " (${type})") - endif(print_prerequisite_type) - - message(STATUS "${count_str}${d}${type_str}") - endforeach(d) -endfunction(list_prerequisites) - - -# list_prerequisites_by_glob glob_arg glob_exp -# -# glob_arg is GLOB or GLOB_RECURSE -# -# glob_exp is a globbing expression used with "file(GLOB" to retrieve a list -# of matching files. If a matching file is executable, its prerequisites are -# listed. -# -# Any additional (optional) arguments provided are passed along as the -# optional arguments to the list_prerequisites calls. -# -function(list_prerequisites_by_glob glob_arg glob_exp) - message(STATUS "=============================================================================") - message(STATUS "List prerequisites of executables matching ${glob_arg} '${glob_exp}'") - message(STATUS "") - file(${glob_arg} file_list ${glob_exp}) - foreach(f ${file_list}) - is_file_executable("${f}" is_f_executable) - if(is_f_executable) - message(STATUS "=============================================================================") - list_prerequisites("${f}" ${ARGN}) - message(STATUS "") - endif(is_f_executable) - endforeach(f) -endfunction(list_prerequisites_by_glob) -- cgit v1.2.3 From ee2a1902a59f41326bea2dccb79f920640cad7c0 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 29 Sep 2017 08:46:44 -0400 Subject: MAINT-7081: Mention nghttp2.dll where it must be mentioned. --- indra/cmake/Copy3rdPartyLibs.cmake | 1 + indra/newview/viewer_manifest.py | 3 +++ 2 files changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index cb7432ce4c..bd55fc39c0 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -37,6 +37,7 @@ if(WINDOWS) libapriconv-1.dll ssleay32.dll libeay32.dll + nghttp2.dll glod.dll libhunspell.dll ) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 29c9337cc1..ecff21e6d2 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -454,6 +454,9 @@ class WindowsManifest(ViewerManifest): self.path("ssleay32.dll") self.path("libeay32.dll") + # HTTP/2 + self.path("nghttp2.dll") + # Hunspell self.path("libhunspell.dll") -- cgit v1.2.3 From 586d697475da239060abd8df030778fbdfb0cf51 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 29 Sep 2017 17:06:42 -0400 Subject: MAINT-7081: Try requesting HTTP/2 when a request wants pipelining. --- indra/llcorehttp/_httplibcurl.cpp | 32 ++++---- indra/llcorehttp/_httpoprequest.cpp | 151 ++++++++++++++---------------------- 2 files changed, 76 insertions(+), 107 deletions(-) (limited to 'indra') diff --git a/indra/llcorehttp/_httplibcurl.cpp b/indra/llcorehttp/_httplibcurl.cpp index c25e01a318..947a065d0a 100644 --- a/indra/llcorehttp/_httplibcurl.cpp +++ b/indra/llcorehttp/_httplibcurl.cpp @@ -40,6 +40,15 @@ namespace void check_curl_multi_code(CURLMcode code); void check_curl_multi_code(CURLMcode code, int curl_setopt_option); +// This is a template because different 'option' values require different +// types for 'ARG'. Just pass them through unchanged (by value). +template +void check_curl_multi_setopt(CURLM* handle, CURLMoption option, ARG argument) +{ + CURLMcode code = curl_multi_setopt(handle, option, argument); + check_curl_multi_code(code, option); +} + static const char * const LOG_CORE("CoreHttp"); } // end anonymous namespace @@ -466,41 +475,34 @@ void HttpLibcurl::policyUpdated(int policy_class) // Enable policy if stalled policy.stallPolicy(policy_class, false); mDirtyPolicy[policy_class] = false; - + if (options.mPipelining > 1) { // We'll try to do pipelining on this multihandle - code = curl_multi_setopt(multi_handle, + check_curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, 1L); - check_curl_multi_code(code, CURLMOPT_PIPELINING); - code = curl_multi_setopt(multi_handle, + check_curl_multi_setopt(multi_handle, CURLMOPT_MAX_PIPELINE_LENGTH, long(options.mPipelining)); - check_curl_multi_code(code, CURLMOPT_MAX_PIPELINE_LENGTH); - code = curl_multi_setopt(multi_handle, + check_curl_multi_setopt(multi_handle, CURLMOPT_MAX_HOST_CONNECTIONS, long(options.mPerHostConnectionLimit)); - check_curl_multi_code(code, CURLMOPT_MAX_HOST_CONNECTIONS); - code = curl_multi_setopt(multi_handle, + check_curl_multi_setopt(multi_handle, CURLMOPT_MAX_TOTAL_CONNECTIONS, long(options.mConnectionLimit)); - check_curl_multi_code(code, CURLMOPT_MAX_TOTAL_CONNECTIONS); } else { - code = curl_multi_setopt(multi_handle, + check_curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, 0L); - check_curl_multi_code(code, CURLMOPT_PIPELINING); - code = curl_multi_setopt(multi_handle, + check_curl_multi_setopt(multi_handle, CURLMOPT_MAX_HOST_CONNECTIONS, 0L); - check_curl_multi_code(code, CURLMOPT_MAX_HOST_CONNECTIONS); - code = curl_multi_setopt(multi_handle, + check_curl_multi_setopt(multi_handle, CURLMOPT_MAX_TOTAL_CONNECTIONS, long(options.mConnectionLimit)); - check_curl_multi_code(code, CURLMOPT_MAX_TOTAL_CONNECTIONS); } } else if (! mDirtyPolicy[policy_class]) diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index f526af37b5..dae795c41c 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -108,6 +108,15 @@ void os_strlower(char * str); // Error testing and reporting for libcurl status codes void check_curl_easy_code(CURLcode code, int curl_setopt_option); +// This is a template because different 'option' values require different +// types for 'ARG'. Just pass them through unchanged (by value). +template +void check_curl_easy_setopt(CURL* handle, CURLoption option, ARG argument) +{ + CURLcode code = curl_easy_setopt(handle, option, argument); + check_curl_easy_code(code, option); +} + static const char * const LOG_CORE("CoreHttp"); } // end anonymous namespace @@ -491,45 +500,28 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) return HttpStatus(HttpStatus::LLCORE, HE_BAD_ALLOC); } - code = curl_easy_setopt(mCurlHandle, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); - check_curl_easy_code(code, CURLOPT_IPRESOLVE); - code = curl_easy_setopt(mCurlHandle, CURLOPT_NOSIGNAL, 1); - check_curl_easy_code(code, CURLOPT_NOSIGNAL); - code = curl_easy_setopt(mCurlHandle, CURLOPT_NOPROGRESS, 1); - check_curl_easy_code(code, CURLOPT_NOPROGRESS); - code = curl_easy_setopt(mCurlHandle, CURLOPT_URL, mReqURL.c_str()); - check_curl_easy_code(code, CURLOPT_URL); - code = curl_easy_setopt(mCurlHandle, CURLOPT_PRIVATE, getHandle()); - check_curl_easy_code(code, CURLOPT_PRIVATE); - code = curl_easy_setopt(mCurlHandle, CURLOPT_ENCODING, ""); - check_curl_easy_code(code, CURLOPT_ENCODING); - - code = curl_easy_setopt(mCurlHandle, CURLOPT_AUTOREFERER, 1); - check_curl_easy_code(code, CURLOPT_AUTOREFERER); - code = curl_easy_setopt(mCurlHandle, CURLOPT_MAXREDIRS, HTTP_REDIRECTS_DEFAULT); - check_curl_easy_code(code, CURLOPT_MAXREDIRS); - code = curl_easy_setopt(mCurlHandle, CURLOPT_WRITEFUNCTION, writeCallback); - check_curl_easy_code(code, CURLOPT_WRITEFUNCTION); - code = curl_easy_setopt(mCurlHandle, CURLOPT_WRITEDATA, getHandle()); - check_curl_easy_code(code, CURLOPT_WRITEDATA); - code = curl_easy_setopt(mCurlHandle, CURLOPT_READFUNCTION, readCallback); - check_curl_easy_code(code, CURLOPT_READFUNCTION); - code = curl_easy_setopt(mCurlHandle, CURLOPT_READDATA, getHandle()); - check_curl_easy_code(code, CURLOPT_READDATA); - code = curl_easy_setopt(mCurlHandle, CURLOPT_SEEKFUNCTION, seekCallback); - check_curl_easy_code(code, CURLOPT_SEEKFUNCTION); - code = curl_easy_setopt(mCurlHandle, CURLOPT_SEEKDATA, getHandle()); - check_curl_easy_code(code, CURLOPT_SEEKDATA); - - code = curl_easy_setopt(mCurlHandle, CURLOPT_COOKIEFILE, ""); - check_curl_easy_code(code, CURLOPT_COOKIEFILE); + check_curl_easy_setopt(mCurlHandle, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); + check_curl_easy_setopt(mCurlHandle, CURLOPT_NOSIGNAL, 1); + check_curl_easy_setopt(mCurlHandle, CURLOPT_NOPROGRESS, 1); + check_curl_easy_setopt(mCurlHandle, CURLOPT_URL, mReqURL.c_str()); + check_curl_easy_setopt(mCurlHandle, CURLOPT_PRIVATE, getHandle()); + check_curl_easy_setopt(mCurlHandle, CURLOPT_ENCODING, ""); + + check_curl_easy_setopt(mCurlHandle, CURLOPT_AUTOREFERER, 1); + check_curl_easy_setopt(mCurlHandle, CURLOPT_MAXREDIRS, HTTP_REDIRECTS_DEFAULT); + check_curl_easy_setopt(mCurlHandle, CURLOPT_WRITEFUNCTION, writeCallback); + check_curl_easy_setopt(mCurlHandle, CURLOPT_WRITEDATA, getHandle()); + check_curl_easy_setopt(mCurlHandle, CURLOPT_READFUNCTION, readCallback); + check_curl_easy_setopt(mCurlHandle, CURLOPT_READDATA, getHandle()); + check_curl_easy_setopt(mCurlHandle, CURLOPT_SEEKFUNCTION, seekCallback); + check_curl_easy_setopt(mCurlHandle, CURLOPT_SEEKDATA, getHandle()); + + check_curl_easy_setopt(mCurlHandle, CURLOPT_COOKIEFILE, ""); if (gpolicy.mSslCtxCallback) { - code = curl_easy_setopt(mCurlHandle, CURLOPT_SSL_CTX_FUNCTION, curlSslCtxCallback); - check_curl_easy_code(code, CURLOPT_SSL_CTX_FUNCTION); - code = curl_easy_setopt(mCurlHandle, CURLOPT_SSL_CTX_DATA, getHandle()); - check_curl_easy_code(code, CURLOPT_SSL_CTX_DATA); + check_curl_easy_setopt(mCurlHandle, CURLOPT_SSL_CTX_FUNCTION, curlSslCtxCallback); + check_curl_easy_setopt(mCurlHandle, CURLOPT_SSL_CTX_DATA, getHandle()); mCallbackSSLVerify = gpolicy.mSslCtxCallback; } @@ -547,16 +539,12 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) dnsCacheTimeout = mReqOptions->getDNSCacheTimeout(); nobody = mReqOptions->getHeadersOnly() ? 1L : 0L; } - code = curl_easy_setopt(mCurlHandle, CURLOPT_FOLLOWLOCATION, follow_redirect); - check_curl_easy_code(code, CURLOPT_FOLLOWLOCATION); + check_curl_easy_setopt(mCurlHandle, CURLOPT_FOLLOWLOCATION, follow_redirect); - code = curl_easy_setopt(mCurlHandle, CURLOPT_SSL_VERIFYPEER, sslPeerV); - check_curl_easy_code(code, CURLOPT_SSL_VERIFYPEER); - code = curl_easy_setopt(mCurlHandle, CURLOPT_SSL_VERIFYHOST, sslHostV); - check_curl_easy_code(code, CURLOPT_SSL_VERIFYHOST); + check_curl_easy_setopt(mCurlHandle, CURLOPT_SSL_VERIFYPEER, sslPeerV); + check_curl_easy_setopt(mCurlHandle, CURLOPT_SSL_VERIFYHOST, sslHostV); - code = curl_easy_setopt(mCurlHandle, CURLOPT_NOBODY, nobody); - check_curl_easy_code(code, CURLOPT_NOBODY); + check_curl_easy_setopt(mCurlHandle, CURLOPT_NOBODY, nobody); // The Linksys WRT54G V5 router has an issue with frequent // DNS lookups from LAN machines. If they happen too often, @@ -564,8 +552,7 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) // about 700 or so requests and starts issuing TCP RSTs to // new connections. Reuse the DNS lookups for even a few // seconds and no RSTs. - code = curl_easy_setopt(mCurlHandle, CURLOPT_DNS_CACHE_TIMEOUT, dnsCacheTimeout); - check_curl_easy_code(code, CURLOPT_DNS_CACHE_TIMEOUT); + check_curl_easy_setopt(mCurlHandle, CURLOPT_DNS_CACHE_TIMEOUT, dnsCacheTimeout); if (gpolicy.mUseLLProxy) { @@ -588,81 +575,66 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) { // *TODO: This is fine for now but get fuller socks5/ // authentication thing going later.... - code = curl_easy_setopt(mCurlHandle, CURLOPT_PROXY, gpolicy.mHttpProxy.c_str()); - check_curl_easy_code(code, CURLOPT_PROXY); - code = curl_easy_setopt(mCurlHandle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); - check_curl_easy_code(code, CURLOPT_PROXYTYPE); + check_curl_easy_setopt(mCurlHandle, CURLOPT_PROXY, gpolicy.mHttpProxy.c_str()); + check_curl_easy_setopt(mCurlHandle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); } if (gpolicy.mCAPath.size()) { - code = curl_easy_setopt(mCurlHandle, CURLOPT_CAPATH, gpolicy.mCAPath.c_str()); - check_curl_easy_code(code, CURLOPT_CAPATH); + check_curl_easy_setopt(mCurlHandle, CURLOPT_CAPATH, gpolicy.mCAPath.c_str()); } if (gpolicy.mCAFile.size()) { - code = curl_easy_setopt(mCurlHandle, CURLOPT_CAINFO, gpolicy.mCAFile.c_str()); - check_curl_easy_code(code, CURLOPT_CAINFO); + check_curl_easy_setopt(mCurlHandle, CURLOPT_CAINFO, gpolicy.mCAFile.c_str()); } switch (mReqMethod) { case HOR_GET: if (nobody == 0) - code = curl_easy_setopt(mCurlHandle, CURLOPT_HTTPGET, 1); - check_curl_easy_code(code, CURLOPT_HTTPGET); + check_curl_easy_setopt(mCurlHandle, CURLOPT_HTTPGET, 1); break; case HOR_POST: { - code = curl_easy_setopt(mCurlHandle, CURLOPT_POST, 1); - check_curl_easy_code(code, CURLOPT_POST); - code = curl_easy_setopt(mCurlHandle, CURLOPT_ENCODING, ""); - check_curl_easy_code(code, CURLOPT_ENCODING); + check_curl_easy_setopt(mCurlHandle, CURLOPT_POST, 1); + check_curl_easy_setopt(mCurlHandle, CURLOPT_ENCODING, ""); long data_size(0); if (mReqBody) { data_size = mReqBody->size(); } - code = curl_easy_setopt(mCurlHandle, CURLOPT_POSTFIELDS, static_cast(NULL)); - check_curl_easy_code(code, CURLOPT_POSTFIELDS); - code = curl_easy_setopt(mCurlHandle, CURLOPT_POSTFIELDSIZE, data_size); - check_curl_easy_code(code, CURLOPT_POSTFIELDSIZE); + check_curl_easy_setopt(mCurlHandle, CURLOPT_POSTFIELDS, static_cast(NULL)); + check_curl_easy_setopt(mCurlHandle, CURLOPT_POSTFIELDSIZE, data_size); mCurlHeaders = curl_slist_append(mCurlHeaders, "Expect:"); } break; case HOR_PATCH: - code = curl_easy_setopt(mCurlHandle, CURLOPT_CUSTOMREQUEST, "PATCH"); - check_curl_easy_code(code, CURLOPT_CUSTOMREQUEST); + check_curl_easy_setopt(mCurlHandle, CURLOPT_CUSTOMREQUEST, "PATCH"); // fall through. The rest is the same as PUT case HOR_PUT: { - code = curl_easy_setopt(mCurlHandle, CURLOPT_UPLOAD, 1); - check_curl_easy_code(code, CURLOPT_UPLOAD); + check_curl_easy_setopt(mCurlHandle, CURLOPT_UPLOAD, 1); long data_size(0); if (mReqBody) { data_size = mReqBody->size(); } - code = curl_easy_setopt(mCurlHandle, CURLOPT_INFILESIZE, data_size); - check_curl_easy_code(code, CURLOPT_INFILESIZE); + check_curl_easy_setopt(mCurlHandle, CURLOPT_INFILESIZE, data_size); mCurlHeaders = curl_slist_append(mCurlHeaders, "Expect:"); } break; case HOR_DELETE: - code = curl_easy_setopt(mCurlHandle, CURLOPT_CUSTOMREQUEST, "DELETE"); - check_curl_easy_code(code, CURLOPT_CUSTOMREQUEST); + check_curl_easy_setopt(mCurlHandle, CURLOPT_CUSTOMREQUEST, "DELETE"); break; case HOR_COPY: - code = curl_easy_setopt(mCurlHandle, CURLOPT_CUSTOMREQUEST, "COPY"); - check_curl_easy_code(code, CURLOPT_CUSTOMREQUEST); + check_curl_easy_setopt(mCurlHandle, CURLOPT_CUSTOMREQUEST, "COPY"); break; case HOR_MOVE: - code = curl_easy_setopt(mCurlHandle, CURLOPT_CUSTOMREQUEST, "MOVE"); - check_curl_easy_code(code, CURLOPT_CUSTOMREQUEST); + check_curl_easy_setopt(mCurlHandle, CURLOPT_CUSTOMREQUEST, "MOVE"); break; default: @@ -680,12 +652,9 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) // Tracing if (mTracing >= HTTP_TRACE_CURL_HEADERS) { - code = curl_easy_setopt(mCurlHandle, CURLOPT_VERBOSE, 1); - check_curl_easy_code(code, CURLOPT_VERBOSE); - code = curl_easy_setopt(mCurlHandle, CURLOPT_DEBUGDATA, this); - check_curl_easy_code(code, CURLOPT_DEBUGDATA); - code = curl_easy_setopt(mCurlHandle, CURLOPT_DEBUGFUNCTION, debugCallback); - check_curl_easy_code(code, CURLOPT_DEBUGFUNCTION); + check_curl_easy_setopt(mCurlHandle, CURLOPT_VERBOSE, 1); + check_curl_easy_setopt(mCurlHandle, CURLOPT_DEBUGDATA, this); + check_curl_easy_setopt(mCurlHandle, CURLOPT_DEBUGFUNCTION, debugCallback); } // There's a CURLOPT for this now... @@ -762,6 +731,9 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) // // xfer_timeout *= cpolicy.mPipelining; xfer_timeout *= 2L; + + // Also try requesting HTTP/2. + check_curl_easy_setopt(mCurlHandle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); } // *DEBUG: Enable following override for timeout handling and "[curl:bugs] #1420" tests //if (cpolicy.mPipelining) @@ -769,10 +741,8 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) // xfer_timeout = 1L; // timeout = 1L; //} - code = curl_easy_setopt(mCurlHandle, CURLOPT_TIMEOUT, xfer_timeout); - check_curl_easy_code(code, CURLOPT_TIMEOUT); - code = curl_easy_setopt(mCurlHandle, CURLOPT_CONNECTTIMEOUT, timeout); - check_curl_easy_code(code, CURLOPT_CONNECTTIMEOUT); + check_curl_easy_setopt(mCurlHandle, CURLOPT_TIMEOUT, xfer_timeout); + check_curl_easy_setopt(mCurlHandle, CURLOPT_CONNECTTIMEOUT, timeout); // Request headers if (mReqHeaders) @@ -780,15 +750,12 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) // Caller's headers last to override mCurlHeaders = append_headers_to_slist(mReqHeaders, mCurlHeaders); } - code = curl_easy_setopt(mCurlHandle, CURLOPT_HTTPHEADER, mCurlHeaders); - check_curl_easy_code(code, CURLOPT_HTTPHEADER); + check_curl_easy_setopt(mCurlHandle, CURLOPT_HTTPHEADER, mCurlHeaders); if (mProcFlags & (PF_SCAN_RANGE_HEADER | PF_SAVE_HEADERS | PF_USE_RETRY_AFTER)) { - code = curl_easy_setopt(mCurlHandle, CURLOPT_HEADERFUNCTION, headerCallback); - check_curl_easy_code(code, CURLOPT_HEADERFUNCTION); - code = curl_easy_setopt(mCurlHandle, CURLOPT_HEADERDATA, this); - check_curl_easy_code(code, CURLOPT_HEADERDATA); + check_curl_easy_setopt(mCurlHandle, CURLOPT_HEADERFUNCTION, headerCallback); + check_curl_easy_setopt(mCurlHandle, CURLOPT_HEADERDATA, this); } if (status) -- cgit v1.2.3 From 6b508cd9d45d8c74477efb0b97b1cbcccb714e78 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 30 Sep 2017 22:05:21 -0400 Subject: MAINT-7081: Eliminate unused variable errors after new refactoring. The new helper functions check_curl_easy_setopt() and check_curl_multi_setopt() encapsulate the pervasive idiom: code = curl_{easy,multi}_setopt(handle, option, arg); check_curl_{easy,multi}_code(code, option); But since each of these helper functions contains its own local CURL{,M}code variable 'code', having a caller-scope variable reused for every such call is no longer necessary -- in fact is no longer used at all. That produces a fatal warning with MSVC. Get rid of those now-unused variables. --- indra/llcorehttp/_httplibcurl.cpp | 1 - indra/llcorehttp/_httpoprequest.cpp | 2 -- 2 files changed, 3 deletions(-) (limited to 'indra') diff --git a/indra/llcorehttp/_httplibcurl.cpp b/indra/llcorehttp/_httplibcurl.cpp index 947a065d0a..abd304f6a5 100644 --- a/indra/llcorehttp/_httplibcurl.cpp +++ b/indra/llcorehttp/_httplibcurl.cpp @@ -470,7 +470,6 @@ void HttpLibcurl::policyUpdated(int policy_class) HttpPolicyClass & options(policy.getClassOptions(policy_class)); CURLM * multi_handle(mMultiHandles[policy_class]); - CURLMcode code; // Enable policy if stalled policy.stallPolicy(policy_class, false); diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index dae795c41c..1049c9da96 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -460,8 +460,6 @@ void HttpOpRequest::setupCommon(HttpRequest::policy_t policy_id, // *TODO: Move this to _httplibcurl where it belongs. HttpStatus HttpOpRequest::prepareRequest(HttpService * service) { - CURLcode code; - // Scrub transport and result data for retried op case mCurlActive = false; mCurlHandle = NULL; -- cgit v1.2.3 From 526087d9ab6f1fb24e8808a6bef83e26fe6da857 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 4 Oct 2017 12:43:53 -0700 Subject: MAINT-7468: Show tooltip on disabled IM to Email if unverified email. --- indra/newview/llfloaterpreference.cpp | 7 +++++++ indra/newview/skins/default/xui/en/floater_preferences.xml | 6 ++++++ 2 files changed, 13 insertions(+) (limited to 'indra') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index e369403e22..5222637039 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1856,6 +1856,13 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im getChild("online_visibility")->setValue(mOriginalHideOnlineStatus); getChild("online_visibility")->setLabelArg("[DIR_VIS]", mDirectoryVisibility); getChildView("send_im_to_email")->setEnabled(is_verified_email); + + std::string tooltip; + if (!is_verified_email) + tooltip = getString("email_unverified_tooltip"); + + getChildView("send_im_to_email")->setToolTip(tooltip); + // *TODO: Show or hide verify email text here based on is_verified_email getChild("send_im_to_email")->setValue(im_via_email); getChildView("favorites_on_login_check")->setEnabled(TRUE); diff --git a/indra/newview/skins/default/xui/en/floater_preferences.xml b/indra/newview/skins/default/xui/en/floater_preferences.xml index 5ca527ad20..845c1efe4d 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences.xml @@ -11,6 +11,12 @@ single_instance="true" title="PREFERENCES" width="658"> + + Please verify your email to enable IM to Email by visiting +https://accounts.secondlife.com/change_email/ + +