errendimendu orokorra hobetzen da. Honek ez du aldatzen erabiltzaileekin elkarreragiteko aurkezten den shell-a.
Extended_description-fi.utf-8: Komentosarjat ajetaan oletuksena järjestelmän komentotulkilla.\n\nJärjestelmän suorituskykyä voidaan parantaa käyttämällä dashia järjestelmän oletuskomentotulkkina. Tämä ei vaikuta käyttäjille näytettäviin komentotulkkeihin.
Extended_description-fr.utf-8: Le shell système est l'interpréteur de commandes utilisé par le système.\n\nUtiliser Dash comme interpréteur de ligne de commande du système améliorera les performances globales. Cela ne change pas l'interpréteur utilisé interactivement par les utilisateurs.
Extended_description-id.utf-8: Sistem shell adalah perintah intepreter bawaan untuk skrip shell\n\nMenggunakan dash sebagai sistem shell akan meningkatkan performa keseluruhan sistem. Ini tidak mengubah shell yang disajikan ke pengguna interaktif
Extended_description-it.utf-8: La shell di sistema è l'interprete dei comandi predefinito negli script della shell.\n\nUsando dash come shell di sistema miglioreranno le prestazioni generali del sistema. Non verrà cambiata la shell presentata agli utenti interattivi.
Extended_description-ja.utf-8: システムシェルはシェルスクリプト用のデフォルトのコマンドインタプリタです。\n\ndash をシステムシェルとして使うことは、システム全体のパフォーマンスを改善します。対話的に利用しているユーザのシェルについては、変更しません。
Extended_description-nl.utf-8: De systeemshell is de standaard commandovertolker voor shell scripts.\n\nAls u dash als de systeemshell gebruikt, zal dit de prestaties van het systeem ten goede komen. Het verandert niets aan de shell die interactieve gebruikers te zien krijgen.
Extended_description-pl.utf-8: Powłoka systemowa jest domyślnym interpreterem poleceń dla skryptów powłoki\n\nUżycie programu dash jako powłoki systemowej poprawi ogólną wydajność systemu. Wybranie tej opcji nie zmieni powłoki zwykłych użytkowników.
Extended_description-pt.utf-8: A shell do sistema é o interpretador de comandos predefinido para scripts da shell.\n\nUtilizar o dash como shell do sistema irá melhorar a performance em geral do sistema. Não altera a shell apresentada aos utilizadores interactivos.
Extended_description-pt_br.utf-8: O shell do sistema é o interpretador de comandos padrão para shell scripts.\n\nUsar o dash como shell do sistema irá melhorar o desempenho geral do sistema. Isso não altera o shell apresentado para usuários interativos.
Extended_description-ro.utf-8: Un shell de sistem este interpretorul de comenzi implicit pentru scripturi shell.\n\nFolosind dash ca shell pentru sistem va îmbunătăți performanța generală a sistemului. Această schimbare nu va afecta ce shell este folosit pentru utilizatorii interactivi.
Extended_description-ru.utf-8: Системная оболочка -- это командный интерпретатор для сценариев оболочки командной строки.\n\nИспользование dash в качестве системной оболочки улучшит общую производительность системы. Это не изменит оболочки командной строки, используемые пользователями.
Extended_description-sk.utf-8: Systémový shell je východzí príkazový interpret shellových skriptov.\n\nPoužitie dash ako systémového shellu celkovo zlepší výkon systému. Toto nastavenie nijako neovplyvní interaktívny shell jednotlivých používateľov.
Extended_description-sr.utf-8: Системски (shell) је подразумијавани тумач за (shell) скрипте.\n\nКориштењем (dash) повећавају се свеукупне систмеске перформансе. Не мијења(shell) представљен интерактивним корисницима.
Extended_description-sv.utf-8: Systemskalet är kommandotolken för skript skrivna för skalet.\n\nAtt använda dash som systemskal kommer att inverka positivt på drifthastigheten av hela systemet. Det kommer inte innebära att användarnas skal byts ut.
Extended_description-tr.utf-8: Sistem kabuğu, kabuk betiklerinin kullandığı öntanımlı komut yorumlayıcısıdır.\n\ndash'i sistem kabuğu olarak kullanmak sistemin başarımını artırır. Etkileşimli kullanıcıların kabukları bu değişiklikten etkilenmez.
Extended_description-vi.utf-8: Trình bao hệ thống là bộ thông thích lệnh mặc định cho văn lệnh trình bao.\n\nDùng dash làm trình bao hệ thống thì tăng cường hiệu suất toàn cục của hệ thống. Nó không sửa đổi trình bao được hiển thị cho người dùng tương tác (v.d. bash, tcsh).
Type: boolean

Name: debconf-apt-progress/info
Description: ${DESCRIPTION}
Type: text

Name: debconf-apt-progress/media-change
Description: Media change
Description-ar.utf-8: تغيير القرص
Description-ast.utf-8: Camudar media
Description-be.utf-8: Змена носьбіта
Description-bg.utf-8: Смяна на носителя
Description-bn.utf-8: মিডিয়া পরিবর্তন
Description-bs.utf-8: Promjena medija
Description-ca.utf-8: Canvi de medi
Description-cs.utf-8: Výměna média
Description-cy.utf-8: Newid cyfrwng
Description-da.utf-8: Nyt medie
Description-de.utf-8: Datenträgerwechsel
Description-dz.utf-8: མི་ཌི་ཡ་ བསྒྱུར་བཅོས།
Description-el.utf-8: Αλλαγή μέσου
Description-eo.utf-8: Ŝanĝo de datumportilo
Description-es.utf-8: Cambio de medio
Description-eu.utf-8: Euskarri aldaketa
Description-fa.utf-8: تغییر رسانه
Description-fi.utf-8: Taltion vaihto
Description-fr.utf-8: Changement de support
Description-ga.utf-8: Athrú meáin
Description-gl.utf-8: Cambio de soporte
Description-gu.utf-8: માધ્યમ બદલાવ
Description-he.utf-8: החלפת מדיה
Description-hi.utf-8: मीडिया परिवर्तन
Description-hr.utf-8: Promjena medija
Description-id.utf-8: Media Berubah
Description-is.utf-8: Skipti á miðli
Description-it.utf-8: Cambio supporto
Description-ja.utf-8: メディアの変更
Description-kk.utf-8: Дискті ауыстыру
Description-km.utf-8: ផ្លាស់ប្ដូរ​មេឌៀ
Description-ko.utf-8: 미디어 교체
Description-lt.utf-8: Laikmenos keitimas
Description-lv.utf-8: Datu nesēja maiņa
Description-ml.utf-8: മീഡിയയില്‍ മാറ്റം .
Description-nb.utf-8: Skift CD/DVD
Description-nl.utf-8: Verwissel medium
Description-no.utf-8: Skift CD/DVD
Description-pl.utf-8: Zmiana nośnika
Description-pt.utf-8: Mudança de meio de instalação
Description-pt_br.utf-8: Troca de mídia
Description-ro.utf-8: Schimbare de disc
Description-ru.utf-8: Смена носителя
Description-si.utf-8: මාධ්‍ය වෙනසක්
Description-sk.utf-8: Výmena nosiča
Description-sl.utf-8: Sprememba nosilca
Description-sq.utf-8: Ndryshim media
Description-sr.utf-8: Промена медија
Description-sr@latin.utf-8: Promena medija
Description-sv.utf-8: Byte av källmedium
Description-ta.utf-8: ஊடக மாற்றம்
Description-te.utf-8: మాధ్యమ మార్పు
Description-th.utf-8: เปลี่ยนแผ่น
Description-tr.utf-8: Ortamı(CD,DVD) değişimi
Description-ug.utf-8: ۋاسىتە ئالماشتۇر
Description-vi.utf-8: Đổi vật chứa
Description-zh_cn.utf-8: 更换媒介
Description-zh_tw.utf-8: 變更媒體
Extended_description: ${MESSAGE}
Extended_description-ar.utf-8: ${MESSAGE}
Extended_description-ast.utf-8: ${MESSAGE}
Extended_description-be.utf-8: ${MESSAGE}
Extended_description-bg.utf-8: ${MESSAGE}
Extended_description-bn.utf-8: ${MESSAGE}
Extended_description-bs.utf-8: ${MESSAGE}
Extended_description-ca.utf-8: ${MESSAGE}
Extended_description-cs.utf-8: ${MESSAGE}
Extended_description-cy.utf-8: ${MESSAGE}
Extended_description-da.utf-8: ${MESSAGE}
Extended_description-de.utf-8: ${MESSAGE}
Extended_description-dz.utf-8: ${MESSAGE}
Extended_description-el.utf-8: ${MESSAGE}
Extended_description-eo.utf-8: ${MESSAGE}
Extended_description-es.utf-8: ${MESSAGE}
Extended_description-eu.utf-8: ${MESSAGE}
Extended_description-fa.utf-8: ${MESSAGE}
Extended_description-fi.utf-8: ${MESSAGE}
Extended_description-fr.utf-8: ${MESSAGE}
Extended_description-ga.utf-8: ${MESSAGE}
Extended_description-gl.utf-8: ${MESSAGE}
Extended_description-gu.utf-8: ${MESSAGE}
Extended_description-he.utf-8: ${MESSAGE}
Extended_description-hi.utf-8: ${MESSAGE}
Extended_description-hr.utf-8: ${MESSAGE}
Extended_description-id.utf-8: ${MESSAGE}
Extended_description-is.utf-8: ${MESSAGE}
Extended_description-it.utf-8: ${MESSAGE}
Extended_description-ja.utf-8: ${MESSAGE}
Extended_description-kk.utf-8: ${MESSAGE}
Extended_description-km.utf-8: ${MESSAGE}
Extended_description-ko.utf-8: ${MESSAGE}
Extended_description-lt.utf-8: ${MESSAGE}
Extended_description-lv.utf-8: ${MESSAGE}
Extended_description-ml.utf-8: ${MESSAGE}
Extended_description-nb.utf-8: ${MESSAGE}
Extended_description-nl.utf-8: ${MESSAGE}
Extended_description-no.utf-8: ${MESSAGE}
Extended_description-pl.utf-8: ${MESSAGE}
Extended_description-pt.utf-8: ${MESSAGE}
Extended_description-pt_br.utf-8: ${MESSAGE}
Extended_description-ro.utf-8: ${MESSAGE}
Extended_description-ru.utf-8: ${MESSAGE}
Extended_description-si.utf-8: ${MESSAGE}
Extended_description-sk.utf-8: ${MESSAGE}
Extended_description-sl.utf-8: ${MESSAGE}
Extended_description-sq.utf-8: ${MESSAGE}
Extended_description-sr.utf-8: ${MESSAGE}
Extended_description-sr@latin.utf-8: ${MESSAGE}
Extended_description-sv.utf-8: ${MESSAGE}
Extended_description-ta.utf-8: ${MESSAGE}
Extended_description-te.utf-8: ${MESSAGE}
Extended_description-th.utf-8: ${MESSAGE}
Extended_description-tr.utf-8: ${MESSAGE}
Extended_description-ug.utf-8: ${MESSAGE}
Extended_description-vi.utf-8: ${MESSAGE}
Extended_description-zh_cn.utf-8: ${MESSAGE}
Extended_description-zh_tw.utf-8: ${MESSAGE}
Type: text

Name: debconf-apt-progress/preparing
Description: Please wait...
Description-ar.utf-8: الرجاء الانتظار...
Description-ast.utf-8: Por favor, espera...
Description-be.utf-8: Калі ласка, чакайце...
Description-bg.utf-8: Моля, изчакайте...
Description-bn.utf-8: অনুগ্রহ করে অপেক্ষা করুন...
Description-bs.utf-8: Molim čekajte...
Description-ca.utf-8: Si us plau, espereu...
Description-cs.utf-8: Čekejte prosím...
Description-cy.utf-8: Arhoswch os gwelwch yn dda...
Description-da.utf-8: Vent venligst...
Description-de.utf-8: Bitte warten ...
Description-dz.utf-8: བསྒུག་གནང་...
Description-el.utf-8: Παρακαλώ περιμένετε...
Description-eo.utf-8: Bonvolu atendi...
Description-es.utf-8: Por favor, espere...
Description-et.utf-8: Palun oota...
Description-eu.utf-8: Itxoin mesedez...
Description-fa.utf-8: لطفاً صبر کنید ...
Description-fi.utf-8: Odota...
Description-fr.utf-8: Veuillez patienter...
Description-ga.utf-8: Fan go fóill...
Description-gl.utf-8: Agarde...
Description-gu.utf-8: મહેરબાની કરી રાહ જુઓ...
Description-he.utf-8: המתן בבקשה...
Description-hi.utf-8: कृपया इंतजार करें...
Description-hr.utf-8: Molim pričekajte...
Description-hu.utf-8: Türelem...
Description-id.utf-8: Mohon menunggu...
Description-is.utf-8: Bíddu aðeins...
Description-it.utf-8: Attendere...
Description-ja.utf-8: しばらくお待ちください...
Description-kk.utf-8: Күте тұрыңыз...
Description-km.utf-8: សូម​រង់ចាំ...
Description-ko.utf-8: 잠시 기다리십시오...
Description-lt.utf-8: Palaukite...
Description-lv.utf-8: Lūdzu, uzgaidiet...
Description-mg.utf-8: Miandrasa kely azafady ...
Description-mk.utf-8: Те молам почекај...
Description-ml.utf-8: ദയവായി കാത്തിരിക്കൂ...
Description-mr.utf-8: कृपया वाट पहा
Description-nb.utf-8: Vent litt ...
Description-ne.utf-8: कृपया पर्खनुहोस्...
Description-nl.utf-8: Even geduld alstublieft ...
Description-no.utf-8: Vent litt ...
Description-pa.utf-8: ਕਿਰਪਾ ਕਰਕੇ ਉਡੀਕੋ...
Description-pl.utf-8: Proszę czekać...
Description-pt.utf-8: Por favor aguarde...
Description-pt_br.utf-8: Por favor, aguarde...
Description-ro.utf-8: Vă rugăm, așteptați...
Description-ru.utf-8: Подождите…
Description-si.utf-8: කරුණාකර රැඳෙන්න...
Description-sk.utf-8: Počkajte, prosím...
Description-sl.utf-8: Prosim počakajte ...
Description-sq.utf-8: Ju lutem prit...
Description-sr.utf-8: Сачекајте...
Description-sr@latin.utf-8: Sačekajte...
Description-sv.utf-8: Var god vänta...
Description-ta.utf-8: தயவு செய்து பொறுத்திருக்கவும் ...
Description-te.utf-8: దయచేసి వేచివుండండి...
Description-th.utf-8: กรุณารอสักครู่...
Description-tl.utf-8: Maghintay po lamang...
Description-tr.utf-8: Lütfen bekleyin...
Description-ug.utf-8: سەل كۈتۈڭ…
Description-uk.utf-8: Зачекайте, будь ласка...
Description-vi.utf-8: Hãy chờ...
Description-wo.utf-8: Muñal tuut...
Description-zh_cn.utf-8: 请稍候...
Description-zh_tw.utf-8: 請稍候...
Type: text

Name: debconf-apt-progress/title
Description: Installing packages
Description-ar.utf-8: تثبيت الحزم
Description-ast.utf-8: Instalando paquetes
Description-be.utf-8: Усталяванне пакетаў
Description-bg.utf-8: Инсталиране на пакети
Description-bn.utf-8: প্যাকেজ ইন্সটল করা হচ্ছে
Description-bs.utf-8: Instaliram pakete
Description-ca.utf-8: S'estan instal·lant els paquets
Description-cs.utf-8: Instalují se balíky
Description-cy.utf-8: Yn gosod pecynnau
Description-da.utf-8: Installerer pakker
Description-de.utf-8: Installiere Pakete
Description-dz.utf-8: ཐུམ་སྒྲིལ་ཚུ་གཞི་བཙུགས་འབད་དོ།
Description-el.utf-8: Εγκατάσταση πακέτων
Description-eo.utf-8: Instalado de pakoj
Description-es.utf-8: Instalando paquetes
Description-et.utf-8: Pakkide paigaldamine
Description-eu.utf-8: Paketeak instalatzen
Description-fa.utf-8: نصب بسته ها
Description-fi.utf-8: Asennetaan paketteja
Description-fr.utf-8: Installation des paquets
Description-ga.utf-8: Pacáistí á suiteáil
Description-gl.utf-8: A instalar os paquetes
Description-gu.utf-8: પેકેજો સ્થાપન કરે છે
Description-he.utf-8: מתקין חבילות
Description-hi.utf-8: पैकेजों की संस्थापना की जा रही है
Description-hr.utf-8: Instaliranje paketa
Description-hu.utf-8: Csomagok telepítése
Description-id.utf-8: Memasang paket-paket
Description-is.utf-8: Set upp pakka
Description-it.utf-8: Installazione dei pacchetti in corso
Description-ja.utf-8: パッケージをインストールしています
Description-kk.utf-8: Дестелерді орнату
Description-km.utf-8: កំពុង​ដំឡើង​កញ្ចប់​
Description-ko.utf-8: 패키지를 설치하는 중입니다
Description-lt.utf-8: Diegiami paketai
Description-lv.utf-8: Instalē pakas
Description-mg.utf-8: Mametraka fonosana
Description-mk.utf-8: Инсталирање пакети
Description-ml.utf-8: പാക്കേജുകള്‍ ഇന്സ്റ്റാള്‍ ചെയ്തുകൊണ്ടിരിക്കുന്നു
Description-mr.utf-8: पॅकेजची स्थापना चालू आहे
Description-nb.utf-8: Installerer pakker
Description-ne.utf-8: प्याकेजहरू स्थापना गरिदैछ
Description-nl.utf-8: Paketten worden geïnstalleerd
Description-no.utf-8: Installerer pakker
Description-pa.utf-8: ਪੈਕੇਜ ਇੰਸਟਾਲ ਕੀਤੇ ਜਾ ਰਹੇ ਹਨ
Description-pl.utf-8: Instalowanie pakietów
Description-pt.utf-8: A instalar pacotes
Description-pt_br.utf-8: Instalando pacotes
Description-ro.utf-8: Se instalează pachete
Description-ru.utf-8: Устанавливаются пакеты
Description-si.utf-8: පැකේජ ස්ථාපනය කරමින්
Description-sk.utf-8: Inštalujú sa balíky
Description-sl.utf-8: Nameščam pakete
Description-sq.utf-8: Duke instaluar paketat
Description-sr.utf-8: Инсталирање пакета
Description-sr@latin.utf-8: Instaliranje paketa
Description-sv.utf-8: Installerar paket
Description-ta.utf-8: நிறுவும் தொகுப்புகள்
Description-te.utf-8: ప్యాకేజీలను స్థాపిస్తున్నాం
Description-th.utf-8: กำลังติดตั้งแพกเกจ
Description-tl.utf-8: Nagluluklok ng mga pakete
Description-tr.utf-8: Paketler kuruluyor
Description-ug.utf-8: بوغچىلارنى ئورنىتىۋاتىدۇ
Description-uk.utf-8: Встановлення пакунків
Description-vi.utf-8: Đang cài đặt gói
Description-wo.utf-8: Mi ngi istale paket yi
Description-zh_cn.utf-8: 正在安装软件包
Description-zh_tw.utf-8: 安裝套件
Type: text

Name: debconf/frontend
Choices: Dialog, Readline, Gnome, Kde, Editor, Noninteractive
Choices-ar.utf-8: Dialog, Readline, Gnome, Kde, محرّر, لاتفاعلي
Choices-ast.utf-8: Diálogos, Consola, Gnome, Kde, Editor, Non interautiva
Choices-be.utf-8: Дыялог, Чытанне радкоў, Gnome, Kde, Рэдактар, Неінтэрактыўна
Choices-bg.utf-8: Диалози, Readline, Gnome, Kde, Редактор, Без намеса
Choices-bn.utf-8: ডায়ালগ, রিডলাইন, Gnome, Kde, সম্পাদক, ক্রিয়া-প্রতিক্রিয়াহীন
Choices-bs.utf-8: Dijaloški, Readline, Gnome, Kde, Uređivač, Neinteraktivni
Choices-ca.utf-8: Dialog, Readline, Gnome, Kde, Editor, No interactiva
Choices-cs.utf-8: Dialog, Readline, Gnome, Kde, Editor, Neinteraktivní
Choices-cy.utf-8: Dialog, Readline, Gnome, Kde, Golygydd, An-rhyngweithiol
Choices-da.utf-8: Dialogboks, Overskrift, Gnome, Kde, Editor, Ikke-interaktiv
Choices-de.utf-8: Dialog, Readline, Gnome, Kde, Editor, Nicht-interaktiv
Choices-dz.utf-8: ཌའི་ལོག, ལྷག་ཐིག, Gnome, Kde, ཞུན་དགཔ།, ཕན་ཚུན་འབྲེལ་ལྡན་མ་ཡིན་པ།
Choices-el.utf-8: Dialog, Readline, Gnome, Kde, Editor, Μη-διαδραστικά
Choices-eo.utf-8: Dialog, Readline, Gnome, Kde, Redaktilo, Neinteraga
Choices-es.utf-8: Diálogos, Consola, Gnome, Kde, Editor, No interactiva
Choices-et.utf-8: Dialoogiaknad, Reapõhine, Gnome, Kde, Redaktor, Mitte-interaktiivne
Choices-eu.utf-8: Elkarrizketa, Irakurketa lerroa, Gnome, Kde, Editorea, Ez interaktiboa
Choices-fa.utf-8: Dialog, Readline, Gnome, Kde, ویرایشگر, غیر محاوره ای
Choices-fi.utf-8: Valintaikkuna, Readline, Gnome, Kde, Teksturi, ei vuorovaikutteinen
Choices-fr.utf-8: Dialogue, Readline, Gnome, Kde, Éditeur, Non interactive
Choices-ga.utf-8: Dialóg, Gnáth-théacs, Gnome, Kde, Eagarthóir, Neamh-idirghníomhach
Choices-gl.utf-8: Dialog, Readline, Gnome, Kde, Editor, Non interactiva
Choices-gu.utf-8: સંવાદ, રીડલાઈન, Gnome, Kde, સંપાદક, અસક્રિય
Choices-he.utf-8: דיאלוג, שורת פקודה, Gnome, Kde, עורך טקסט, לא אינטראקטיבי
Choices-hi.utf-8: डायलॉग, रीडलाइन, Gnome, Kde, एडिटर, नॉनइन्टरैक्टिव
Choices-hr.utf-8: Dialog, Readline, Gnome, Kde, Editor, Neinteraktivno
Choices-hu.utf-8: Párbeszédes, Egysoros, Gnome, Kde, Szerkesztő, Néma
Choices-id.utf-8: Dialog, Bacabaris (Readline), Gnome, Kde, Penyunting, Tak-Interaktif
Choices-is.utf-8: Samskiptagluggi, Leslína, Gnome, Kde, Ritill, Ógagnvirkt
Choices-it.utf-8: Dialog, Readline, Gnome, Kde, Editor, Non-interattiva
Choices-ja.utf-8: ダイアログ, Readline, Gnome, Kde, エディタ, 非対話的
Choices-kk.utf-8: Сұхбат, Жолды оқу, Gnome, Kde, Түзетуші, Интерактивті емес
Choices-km.utf-8: ប្រអប់, បន្ទាត់អាន, Gnome, Kde, កម្មវិធី​និពន្ធ, គ្មាន​អន្តរកម្ម
Choices-ko.utf-8: 다이얼로그 방식, 리드라인 방식, Gnome, Kde, 편집기 방식, 물어보지 않음 방식
Choices-lt.utf-8: Dialogai, Tekstinė eilutė, Gnome, Kde, Tekstų redaktorius, Neinteraktyvi
Choices-lv.utf-8: Dialoglodziņš, Readline, Gnome, Kde, Teksta redaktora, Neinteraktīvā
Choices-mg.utf-8: Dialog, Readline, Gnome, Kde, Editor, Noninteractive
Choices-mk.utf-8: Дијалог, Readline, Gnome, Kde, Уредувач, Неинтерактивно
Choices-ml.utf-8: ഡയലോഗ്, റീഡ്ലൈന്‍, Gnome, Kde, എഡിറ്റര്‍, ഇന്ററാക്റ്റീവല്ലാതെ
Choices-mr.utf-8: संवाद, वाचण्याची ओळ, Gnome, Kde, मजकूर लेखक, सुसंवादप्रक्रियाहीन
Choices-nb.utf-8: Dialog, Readline, Gnome, Kde, Redigering, Ikke-interaktiv
Choices-ne.utf-8: संवाद, रिडलाइन, Gnome, Kde, सम्पादक, अन्तरक्रियात्मकता विहिन
Choices-nl.utf-8: Tekst-Dialoog (dialog), commando-regel (Readline), Gnome, Kde, Teksteditor, Niet-interactief
Choices-no.utf-8: Dialog, Readline, Gnome, Kde, Redigering, Ikke-interaktiv
Choices-pa.utf-8: ਵਾਰਤਾਲਾਪ, ਲਾਇਨ ਪੜ੍ਹੋ, Gnome, Kde, ਸੰਪਾਦਕ, ਕਮਾਂਡ ਰਾਹੀਂ
Choices-pl.utf-8: Dialog, Readline, Gnome, Kde, Edytor, Nieinteraktywny
Choices-pt.utf-8: Dialog, Readline, Gnome, Kde, Editor, Não-interactivo
Choices-pt_br.utf-8: Dialog, Readline, Gnome, Kde, Editor, Noninteractive
Choices-ro.utf-8: Dialog, Linie interactivă, Gnome, Kde, Editor, Non-interactiv
Choices-ru.utf-8: диалоговый, из командной строки, Gnome, Kde, из текстового редактора, пакетный
Choices-si.utf-8: සංවාදය, කියවීම් පේළිය, Gnome, Kde, සකසනය, අන්තර්ක්‍රියාකාරී නොවන
Choices-sk.utf-8: Dialóg, Readline, Gnome, Kde, Editor, Neinteraktívne
Choices-sl.utf-8: dialog, bralnovrstični (readline) vmesnik, Gnome, Kde, urejevalni vmesnik, neinteraktiven vmesnik
Choices-sq.utf-8: Dialog, Linjë leximi, Gnome, Kde, Editues, Jointeraktive
Choices-sr.utf-8: Дијалог, Линијски, Gnome, Kde, Едитор, Неинтерактивно
Choices-sr@latin.utf-8: Dijalog, Linijski, Gnome, Kde, Editor, Neinteraktivno
Choices-sv.utf-8: Dialog, Readline, Gnome, Kde, Redigerare, Icke-interaktivt
Choices-ta.utf-8: உரையாடல், ரீட்லைன், Gnome, Kde, திருத்தர், ஊடாடல் இல்லாத
Choices-te.utf-8: భాషణ , రీడ్లైన్ , Gnome, Kde, సరిచేయునది, ప్రశ్నలు వేయక
Choices-th.utf-8: กล่องโต้ตอบ, อ่านจากบรรทัด, Gnome, Kde, แก้ไขข้อความ, ไม่โต้ตอบ
Choices-tl.utf-8: Diyalogo, Readline, Gnome, Kde, Editor, Hindi interaktibo
Choices-tr.utf-8: Diyalog, Readline, Gnome, Kde, Düzenleyici, Etkileşimsiz
Choices-ug.utf-8: سۆزلەشكۈ, Readline, Gnome, Kde, تەھرىرلىگۈچ, غەيرىي تەسىرلىشىشچان
Choices-uk.utf-8: Діалоговий, Рядок вводу, Gnome, Kde, Редактор, Неінтерактивний
Choices-vi.utf-8: Hộp thoại, Readline, Gnome, Kde, Trình hiệu chỉnh, Không tương tác
Choices-wo.utf-8: Dialog, Readline, Gnome, Kde, Editor, Noninteractive
Choices-zh_cn.utf-8: 字符对话框, 纯文本界面, Gnome, Kde, 编辑器, 非交互方式
Choices-zh_tw.utf-8: Dialog, Readline, Gnome, Kde, 編輯器, 非互動式
Default: Dialog
Description: Interface to use:
Description-ar.utf-8: الواجهة المراد استخدامها:
Description-ast.utf-8: Interface a usar:
Description-be.utf-8: Ужываць інтэрфейс:
Description-bg.utf-8: Интерфейс за настройка на пакетите:
Description-bn.utf-8: যে ইন্টারফেস ব্যবহার করা হবে:
Description-bs.utf-8: Interfejs koji će se koristiti:
Description-ca.utf-8: Interfície a emprar:
Description-cs.utf-8: Použít rozhraní:
Description-cy.utf-8: Rhyngwyneb i ddefnyddio:
Description-da.utf-8: Brugerflade at benytte:
Description-de.utf-8: Zu nutzende Schnittstellenoberfläche:
Description-dz.utf-8: ལག་ལེན་འཐབ་ནི་ལུ་ངོས་པར་དགོ་:
Description-el.utf-8: Διεπαφή που θα χρησιμοποιηθεί:
Description-eo.utf-8: Uzota interfaco:
Description-es.utf-8: Interfaz a utilizar:
Description-et.utf-8: Kasutatav liides:
Description-eu.utf-8: Erabiliko den interfazea:
Description-fa.utf-8: رابط کاربری مورد استفاده:
Description-fi.utf-8: Käytettävä liittymä:
Description-fr.utf-8: Interface à utiliser :
Description-ga.utf-8: Comhéadan le húsáid:
Description-gl.utf-8: Interface a empregar:
Description-gu.utf-8: વાપરવા માટેનો દેખાવ:
Description-he.utf-8: ממשק לשימוש:
Description-hi.utf-8: किस माध्यम का उपयोग किया जाए
Description-hr.utf-8: Koristiti sučelje:
Description-hu.utf-8: Használandó felület:
Description-id.utf-8: Antarmuka yang dipakai:
Description-is.utf-8: Viðmót sem nota skal:
Description-it.utf-8: Interfaccia da utilizzare:
Description-ja.utf-8: 利用するインターフェイス:
Description-kk.utf-8: Қолданылатын интерфейс:
Description-km.utf-8: ចំណុច​ប្រទាក់​ត្រូវ​ប្រើ ៖
Description-ko.utf-8: 사용할 인터페이스:
Description-lt.utf-8: Naudotina sąsaja:
Description-lv.utf-8: Lietojamā saskarne:
Description-mg.utf-8: Interface ampiasaina :
Description-mk.utf-8: Интерфејс кој ќе се корисити:
Description-ml.utf-8: ഉപയോഗിക്കേണ്ട ഇന്റര്ഫേസ്:
Description-mr.utf-8: वापरण्यासाठी आंतराफलक
Description-nb.utf-8: Ønsket brukerflate:
Description-ne.utf-8: प्रयोग गरिने इन्टरफेस:
Description-nl.utf-8: Te gebruiken interface:
Description-no.utf-8: Ønsket brukerflate:
Description-pa.utf-8: ਵਰਤਣ ਲਈ ਇੰਟਰਫੇਸ:
Description-pl.utf-8: Interfejs:
Description-pt.utf-8: Interface a utilizar:
Description-pt_br.utf-8: Interface a ser usada:
Description-ro.utf-8: Interfața folosită:
Description-ru.utf-8: Интерфейс настройки пакетов:
Description-si.utf-8: භාවිත කරන අතුරුමුහුණත
Description-sk.utf-8: Použité rozhranie:
Description-sl.utf-8: Vmesnik, ki ga želite uporabiti:
Description-sq.utf-8: Ndërfaqe për tu përdorur:
Description-sr.utf-8: Интерфејс за употребу:
Description-sr@latin.utf-8: Interfejs za upotrebu:
Description-sv.utf-8: Gränssnitt att använda:
Description-ta.utf-8: பயனர் பயன்படுத்த இடைமுகம்
Description-te.utf-8: ఉపయోగించాల్సిన అంతరవర్తి:
Description-th.utf-8: อินเทอร์เฟซที่จะใช้:
Description-tl.utf-8: Mukha na gagamitin:
Description-tr.utf-8: Kullanılacak arayüz:
Description-ug.utf-8: ئىشلىتىدىغان ئارايۈز:
Description-uk.utf-8: Використовувати інтерфейс:
Description-vi.utf-8: Giao diện cần dùng:
Description-wo.utf-8: Interfaas biñuy jëfandikoo:
Description-zh_cn.utf-8: 要使用的界面：
Description-zh_tw.utf-8: 要使用的介面：
Extended_description: Packages that use debconf for configuration share a common look and feel. You can select the type of user interface they use.\n\nThe dialog frontend is a full-screen, character based interface, while the readline frontend uses a more traditional plain text interface, and both the gnome and kde frontends are modern X interfaces, fitting the respective desktops (but may be used in any X environment). The editor frontend lets you configure things using your favorite text editor. The noninteractive frontend never asks you any questions.
Extended_description-ar.utf-8: الحزم التي تستخدم debconf لتهيئتها تشترك بنفس المظهر. يمكن اختيار نوع واجهة المستخدم التي تستخدمها.\n\ndialog هي واجهة بملء الشاشة، ذات واجهة نصيّة، بينما واجهة readline تستخدم واجهة نصيّة مجرّدة تقليديّة، وكل من واجهتي جنوم وكيدي هي حديثة، تلائم سطح المكتب المعني (لكن قد يمكن استخدامها في أي بيئة X). واجهة المحرّر تسمح لك بتهيئة الأمور باستخدام محرّر النصوص المفضل لديك. والواجهة اللاتفاعليّة لا تسألك أية أسئلة.
Extended_description-ast.utf-8: Paquetes qu'usen debconf pa configurase comparten un aspeutu común. Puedes seleicionar la triba d'interface d'usuariu qu'ellos usen.\n\nEl frontend dialog ye a pantalla completa, mientres que la de readline ye más tradicional, de sólo testu, y gnome y kde son interfaces X más modernes, adautaes a cada ún de dichos escritorios (pero pueden usar cualisquier entornu X). Editor permítete configurar coses usando'l to editor de testu favoritu. El frontend non interautivu enxamás entrugárate.
Extended_description-be.utf-8: Пакеты, што выкарыстоўваюць debconf для наладак, маюць агульны выгляд. Вы можаце вылучыць тып карыстальніцкага інтэрфейсу, з якім будзеце працаваць.\n\nДыялогавае кіраванне ёсць поўнаэкранным сімвальным інтэрфейсам, а кіраванне чытаннем радкоў выкарыстоўвае больш традыцыйную схему інтэрфейсу простага тэксту, і gnome- і kde-кіраванні ёсць навейшымі X-інтэрфейсамі, што запускаюцца ў адпаведнай графічнай сістэме (але могуць быць выкарыставаны ў любым асяроддзі X). Кіраванне рэдактарам дазваляе вам наладжваць рэчы, выкарыстоўвая ваш улюбёны тэкставы рэдактар. Неінтэрактыўнае кіраванне ніколі не задае вам ніякіх пытанняў.
Extended_description-bg.utf-8: Пакетите, които използват debconf за настройване, споделят един и същи изглед и начин на работа. Можете да изберете вида на потребителския интерфейс, който да се използва при настройване.\n\nИнтерфейсът „dialog“ е пълноекранен знаково-ориентиран интерфейс, докато интерфейсът „readline“ използва традиционния текстов интерфейс, а „gnome“ и „kde“ използват съвременни графични интерфейси, подходящи за съответните работни плотове, но могат да се използват и в други графични среди. Интерфейсът „редактор“ позволява настройване чрез редактиране с текстов редактор. Интерфейсът „без намеса“ никога не задава въпроси.
Extended_description-bn.utf-8: যে সকল প্যাকেজ কনফিগারেশনের জন্য debconf ব্যবহার করে তারা একই রকম চেহারা ধারন করে। তারা কি ধরনের ব্যবহারকারী ইন্টারফেস ব্যবহার করবে তা আপনি নির্বাচন করে দিতে পারেন।\n\nডায়ালগ ফ্রন্টএন্ড একটি পূর্ণ পর্দা, অক্ষর ভিত্তিক ইন্টারফেস, কিন্তু রিডলাইন ফ্রন্টএন্ড অধিক সনাতন সরল টেক্সট ইন্টারফেস ব্যবহার করে, এবং জিনোম ও কেডিই ফ্রন্টএন্ড উভয়ই আধুনিক X ইন্টারফেস, যা ডেস্কটপে মানানসই হয় (কিন্তু যেকোন X এনভায়রনমেন্টে ব্যবহার করা যেতে পারে)। সম্পাদক ফ্রন্টএন্ড আপনাকে আপনার পছন্দসই টেক্সট সম্পাদকের মাধ্যমে সবকিছু কনফিগার করতে দেবে। ক্রিয়া-প্রতিক্রিয়াহীন ফ্রন্টএন্ড আপনাকে কখনই কোন প্রশ্ন করবে না।
Extended_description-bs.utf-8: Paketi koji koriste debconf za konfiguraciju dijele zajednički izgled i način podešavanja. Možete odabrati tip korisničkog interfejsa koji će koristiti.\n\nDijaloški frontend je cijeloekranski, znakovno bazirani interfejs, dok readline frontend koristi tradicionalniji čisti tekstualni interfejs, dok su gnome i kde frontends moderni X interfejsi, koji nadopunjavaju respektivne desktope (ali se mogu koristiti u bilo kojem X okruženju). Uređivački frontend vam omogućuje da podesite stvari koristeći vaš omiljeni uređivač teksta. Neinteraktivni frontend nikad ne postavlja pitanja.
Extended_description-ca.utf-8: Els paquets que utilitzen debconf per a configurar-se comparteixen un aspecte comú. Podeu triar el tipus d'interfície d'usuari que voleu que empren.\n\n«dialog» és una interfície de text a pantalla completa, mentre que «readline» és més tradicional, en text simple, i tant «gnome» com «kde» són interfícies modernes per a X, que s'integren als escriptoris corresponents (tot i que es poden utilitzar en qualsevol entorn d'X). La interfície «editor» us permet configurar el sistema utilitzant el vostre editor preferit. La interfície «no interactiva» no fa cap pregunta.
Extended_description-cs.utf-8: Balíky, které pro svou konfiguraci využívají debconf, používají stejný vzhled a ovládání. Nyní si můžete zvolit typ uživatelského rozhraní, které budou používat.\n\nDialog je celoobrazovkové textové rozhraní, readline používá tradiční textové prostředí a gnome s kde jsou moderní grafická rozhraní (samozřejmě je můžete použít v libovolném jiném X prostředí). Editor vás nechá nastavit věci prostřednictvím vašeho oblíbeného textového editoru. Neinteraktivní rozhraní se nikdy na nic neptá.
Extended_description-cy.utf-8: Mae pecynnau sy'n defnyddio debconf ar gyfer cyfluniad yn rhannu edrychiad a teimlad cyffredin. Fe allwch chi ddewis y math o ryngwyneb maent yn ddefnyddio.\n\nMae pen blaen dialog yn ryngwyneb sgrîn-lawn testun graffigol, tra fod y pen blaen readline yn defnyddio rhyngwyneb testun plaen mwy traddodiadol, tra fod pen blaen gnome a kde yn ryngwynebau X modern, yn gweddu i'r pen bwrdd perthnasol (ond gellir ei defnyddio mewn unrhyw amgylchedd X). Mae'r rhyngwyneb golygydd yn eich caniatau i gyflunio pethau gan ddefnyddio eich hoff olygydd testun. Nid yw'r pen blaen an-rhyngweithiol yn gofyn unrhyw gwestiynau o gwbl.
Extended_description-da.utf-8: Pakker der bruger debconf til opsætning, fremtræder på samme måde. Du kan vælge hvilken brugerflade de skal bruge.\n\nDialog er en fuldskærms, tekstbaseret brugerflade, mens readline er en mere traditionel tekstbrugerflade. Både gnome og kde er moderne X-brugerflader. Editor lader dig svare på spørgsmålene via din foretrukne editor. Ikke-interaktivt brugerflade vil aldrig stille dig spørgsmål.
Extended_description-de.utf-8: Pakete, die Debconf für die Konfiguration verwenden, haben ein gemeinsames »look and feel«. Sie können wählen, welche Benutzerschnittstelle sie nutzen.\n\nDie Dialog-Oberfläche nutzt eine zeichen-basierte Vollbildschirmdarstellung, während die Readline-Oberfläche eine eher traditionelle einfache Textschnittstelle verwendet. Die GNOME- wie auch die KDE-Oberfläche sind moderne X-Schnittstellen, die in den jeweiligen Desktop eingepasst sind (aber in beliebigen X-Umgebungen verwendet werden können). Die Editor-Oberfläche gibt Ihnen die Möglichkeit, die Dinge mit Ihrem Lieblingseditor zu konfigurieren. Die nicht-interaktive Oberfläche stellt Ihnen keine Fragen.
Extended_description-dz.utf-8: རིམ་སྒྲིག་དོན་ལུ་debconf ལག་ལེན་འཐབ་མི་ཐུམ་སྒྲིལ་ཚུ་གིས་ ཐུན་མོང་གི་མཐོང་སྣང་དང་ཚོར་སྣང་ རུབ་སྤྱོད་འབདཝ་ཨིན། ཁྱོད་ཀྱིས་ ཁོང་གིས་ལག་ལེན་འཐབ་པའི་ལག་ལེན་པ་ངོས་འདྲ་བའི་དབྱེ་བ་ སེལ་འཐུ་འབད།\n\nལྷག་ཐིག་གདོང་མཐའ་གིས་ སྔར་སྲོལ་ཚིག་ཡིག་ཉག་རྐྱང་གི་ངོས་འདྲ་བ་ལེ་ཤ་ཅིག་ ལག་ལེན་འཐབ་ཨིནམ་དང་ཇི་ནོམ་དང་ཀེ་ཌི་ཨི་གདོང་མཐའ་གཉིས་ཆ་ར་ དེང་སང་གི་ ཨེགསི་ ངོོོས་འདྲ་བ་ཚུ་ཨིན་ མ་ལྟོས་པའི་ཌེཀསི་ཊོཔསི་ ཚུད་སྒྲིག་འབད་བའི་སྐབས་ལུ་(དེ་འབདཝ་ད་ ཨེགསི་ མཐའ་འཁོར་གང་རུང་ཅིག་ནང་ ལག་ལེན་འཐབ་འཐབ་འོང་) ཌའི་ལོག་གདོང་མཐའ་འདི་ གསལ་གཞི་གང་བ་དང་ ཡིག་འབྲུ་ལུ་གཞི་བཞག་པའི་ངོས་འདྲ་བ་ཨིན། ཞུན་དགཔ་གདོང་མཐའ་གིས་ཁྱོད་ལུ་ ཁྱོའ་རང་གིས་དགའ་མི་ ཚིག་ཡིག་ཞུན་དགཔ་ལག་ལེན་གྱི་ཐོག་ལས་ ཅ་ལ་དེ་ཚུ་རིམ་སྒྲིག་འབད་བཅུགཔ་ཨིན། ཕན་ཚུན་འབྲེལ་ལྡན་མ་ཡིན་པའི་གདོང་མཐའ་གིས་ ནམ་ར་ཨིན་རུང་ འདྲི་བ་ག་ཅི་ཡང་མི་འདྲིཝ་ཨིན།
Extended_description-el.utf-8: Τα πακέτα που χρησιμοποιούν το debconf για τη ρύθμισή τους έχουν μια κοινή εμφάνιση και "αίσθηση". Μπορείτε να επιλέξετε τον τύπο διεπαφής χρήστη που θα χρησιμοποιούν.\n\nΟ διαλογικός τρόπος εμφανίζει τις ερωτήσεις σε μία πλήρη οθόνη κονσόλας, ενώ η γραμμή εντολών (readline) χρησιμοποιεί απλό κείμενο, και αμφότεροι οι τρόποι αλληλεπίδρασης gnome και kde χρησιμοποιούν τα αντίστοιχα περιβάλλοντα (ή ακόμη και διαφορετικά περιβάλλοντα X) για να απεικονίζουν τις ερωτήσεις με γραφικό τρόπο. Ο κειμενογράφος σας επιτρέπει να παραμετροποιήσετε το πακέτο χρησιμοποιώντας τον προτιμώμενο επεξεργαστή κειμένου σας. Ο μη διαλογικός τρόπος δεν εμφανίζει καμία ερώτηση.
Extended_description-eo.utf-8: Pakoj kiuj uzas debconf por agordo kunhavas komunan aspekton. Vi povas elekti la tipon de interfaco kiun ili uzos.\n\nLa interfaco Dialog estas tutekrana, signo-aspekta interfaco, dum la interfaco Readline uzas pli tradician pur-tekstan interfacon, kaj la interfacoj Gnome kaj Kde estas modernaj X-interfacoj, konformaj al la respektivaj labortabloj (sed ili uzeblas en iu ajn X-medio). La interfaco Redaktilo ebligas akomodi aferojn per via preferata teksto-redaktilo. La Neinteraga interfaco neniam demandos vin pri io ajn.
Extended_description-es.utf-8: Los paquetes que usan debconf para configurarse comparten un aspecto común. Puede elegir el tipo de interfaz de usuario que quiere que usen.\n\nDialog es una interfaz de texto a pantalla completa, mientras que la de readline es más tradicional, de sólo texto, y gnome y kde son modernas interfaces para X adaptadas a cada uno de dichos escritorios (aunque pueden usarse en cualquier entorno gráfico). Editor le permite configurar el sistema usando su editor favorito. El interfaz no interactivo no hace ninguna pregunta.
Extended_description-et.utf-8: Seadistamiseks debconf'i kasutavatel pakkidel on ühtne välimus ja tunnetus. Võid valida nende poolt kasutatava kasutajaliidese.\n\nDialoog on täis-ekraani, tähepõhine liides, samas kui readline on traditsioonilisem vaba tekstiga liides. Nii kde kui ka gnome on moodsad X-liidesed, sobides vastavate töölaudadega (kuigi neid võib kasutad igas X keskkonnas). Redaktoriliides võimaldab seadistust oma lemmik tekstiredaktori aknast. Mitteinteraktiivne liides ei küsi iial küsimusi.
Extended_description-eu.utf-8: Konfiguratzeko debconf erabiltzen duten paketeek itxura eta portaera bateratu bat dute. Zein interfaze mota erabili aukeratu dezakezu.\n\nElkarrizketa pantaila osoko karakteretan oinarritutako interfaze bat da, Komando lerroa berriz testu laueko ohizko interfaze bat da. bai gnome eta bai kde interfazeak X-etan oinarritutako eta mahaigain horretarako prestaturik daude (naiz edozein X ingurunetan erabil daitezke). Editoreak konfiguraketak zure lehenetsitako testu editorea erabiliaz egingo ditu. Ez-interaktiboak ez dizu inoiz galderarik egingo.
Extended_description-fa.utf-8: بشته هایی که از debconf برای پیکربندی استفاده می کنند، شکل و حس مشترکی دارند. شما می توانید رابط کاربری که برای آنها مورد استفاده قرار می گیرد را انتخاب کنید.\n\nرابط dialog یک رابط کاربری تمام صفحه بر مبنای کاراکتر است، در حالی که readline بیشتر از رابط کاربری متنی استفاده می کند، و gnome و kde رابط های ،رابط کاربری X هستند که میزکارهای مناسبی را در اختیار می گذارند (اما ممکن است هر کدام از محیط های تحت X استفاده شود). ویرایشکر رابط به شما اجازه می دهد تا چیز ها را با ویرایشگر متن مورد علاقه خود ویرایش کنید. رابط های غیر محاوره ای هیچگاه از شما سؤالی نمی پرسند.
Extended_description-fi.utf-8: Debconf yhdenmukaistaa sitÃ€ kÃ€yttÃ€vien pakettien asetuskÃ€yttÃ¶liittymÃ€n. Voit itse valita mieluisesi liittymÃ€n muutamasta vaihtoehdosta.\n\nValintaikkuna on ruudun tÃ€yttÃ€vÃ€ merkkipohjainen liittymÃ€, kun taas readline on perinteisempi pelkkÃ€Ã€ tekstiÃ€ kÃ€yttÃ€vÃ€ liittymÃ€. SekÃ€ Gnome ettÃ€ KDE ovat nykyaikaisia X-pohjaisia liittymiÃ€. Teksturi kÃ€yttÃ€Ã€ asetusten sÃ€Ã€tÃ¶Ã¶n lempiteksturiasi. Ei-vuorovaikutteinen liittymÃ€ ei koskaan kysy kysymyksiÃ€.
Extended_description-fr.utf-8: Les paquets utilisant debconf pour leur configuration ont une interface et une ergonomie communes. Vous pouvez choisir leur interface utilisateur.\n\n« Dialogue » est une interface couleur en mode caractère et en plein écran, alors que l'interface « Readline » est une interface plus traditionnelle en mode texte. Les interfaces « Gnome » et « KDE » sont des interfaces X modernes, adaptées respectivement à ces environnements (mais peuvent être utilisées depuis n'importe quel environnement X). L'interface « Éditeur » vous permet de faire vos configurations depuis votre éditeur favori. Si vous choisissez « Non-interactive », le système ne vous posera jamais de question.
Extended_description-ga.utf-8: Tá cosúlacht ag na pacáistí a úsáideann debconf lena chéile.  Is féidir leat cineál an chomhéadain úsáideora anseo.\n\nIs comhéadan lánscáileáin bunaithe ar charachtair é an comhéadan 'dialóg', agus is comhéadan téacs níos traidisiúnta é 'gnáth-théacs'.  Is comhéadain ghrafacha nua-aimseartha iad na comhéadain 'gnome' agus 'kde', oiriúnaithe do na deasca sin faoi seach (ach atá inúsáidte i dtimpeallacht X ar bith). Ligeann an comhéadan 'eagarthóir' duit gach rud a chumrú san eagarthóir téacs is ansa leat. Ní chuireann an comhéadan 'neamh-idirghníomhach' ceist ar bith ort.
Extended_description-gl.utf-8: Os paquetes que empregan debconf para a configuración comparten unha aparencia común. Pode escoller o tipo de interface de usuario que empregan.\n\nA interface dialog é unha interface de pantalla completa en modo texto, mentres que a interface readline emprega unha interface de texto simple máis traicional; as interfaces gnome e kde son interfaces modernas de X, que encaixan cos respectivos escritorios (pero que se poden empregar en calquera ambiente X). A interface editor permítelle configurar as cousas empregando o seu editor de texto favorito. A interface non interactiva nunca lle fai preguntas.
Extended_description-gu.utf-8: જે પેકેજો રુપરેખાંકન માટે ડેબકોન્ફ વાપરે છે તેઓ સમાન દેખાવ ધરાવે છે. તમે તેઓ જે દેખાવ વાપરે છે તે પસંદ કરી શકો છો.\n\nસંવાદ દેખાવ એ પૂર્ણ-સ્ક્રિન, અક્ષર પર આધારિત દેખાવ છે, જ્યારે રીડલાઈન દેખાવ પરંપરાગત સામાન્ય લખાણ દેખાવ વાપરે છે, અને ગ્નોમ અને કેડીઈ દેખાવો તાજેતરનાં X દેખાવો છે, જે સંબંધિત ડેસ્કટોપ્સમાં મેળ ખાય છે (પણ કોઈપણ X વાતાવરણમાં ઉપયોગી છે). સંપાદક દેખાવ તમને તમારા પસંદગીનાં સંપાદકમાં રુપરેખાંકન કરવા દેશે. અસક્રિય દેખાવ તમને ક્યારેય પ્રશ્નો પૂછશે નહી.
Extended_description-he.utf-8: חבילות משתמשות ב-debconf לקונפיגורציה בן בעלות מראה וממשק משותף. תוכל לבחור את סוג הממשק משתמש שבו הן ישתמשו.\n\nממשק הדיאלוג נפרש על מסך מלא, ומובסס על ממשק תווי, בזמן שממשק ה-readline משתמש בממשק טקסט יותר מסורתי. גם ממשקי גנום ו-KDE הם ממשקים גרפיים מודרניים. ממשק העורך מאפשר לך להגדיר דברים דרך עורך הטקסט החביב עליך. והממשק הלא אינטראקטיבי פשוט אף פעם לא שואל אותך שאלות.
Extended_description-hi.utf-8: वे पैकेज जो कॉन्फ़िगरेशन के लिए डीबीकॉन्फ का इस्तेमाल करते हैं उनमें एक सामान्य रूप होता है. उनके द्वारा इस्तेमाल में लिए जाने वाले उपयोक्ता इंटरफ़ेस को आप चुन सकते हैं.\n\nसंवाद फ्रन्टएण्ड पूरे स्क्रीन पर अक्षर आधारित इंटरफेस है, जबकि रीडलाइन फ्रन्टएण्ड में पारंपरिक पाठ इंटरफेस इस्तेमाल होता है तथा गनोम व केडीई के फ्रन्टएण्ड में आधुनिक X इंटरफेस हैं जो संबंधित डेस्कटॉप में फिट होते हैं (परंतु किसी भी X वातावरण में इस्तेमाल में लिए जा सकते हैं). संपादन फ्रन्टएण्ड आपको पाठ संपादक के जरिए बहुत सी चीज़ों को कॉन्फ़िगर करने का अवसर प्रदान करता है. नॉनइंटरेक्टिव इंटरफ़ेस आपको कभी भी कोई प्रश्न नहीं पूछता है.
Extended_description-hr.utf-8: Paketi koji koriste debconf za postavke dijele zajednički izgled i način rada. Možete odabrati vrstu korisničkog sučelja koji oni koriste.\n\nSučelje 'Dialog' je tekstualno preko cijelog ekrana, dok je sučelje 'Readline' više tradicionalno tekstualno sučelje. I 'Gnome' i 'KDE' sučelja su moderna X sučelja, koja se uklapaju u odgovarajuća grafička radna okruženja (iako se mogu koristiti u bilo kojem X okruženju). Sučelje 'Editor' vam omogućuje podešavanje stvari u vašem omiljenom programu za uređivanje teksta. Neinteraktivno sučelje nikad ne pita nikakva pitanja.
Extended_description-hu.utf-8: A debconf-ot használó csomagok egységes felületet használnak. Itt lehet kiválasztani, melyik legyen az.\n\nA párbeszéd felület egy teljes-képernyős, karakteres felület, az egysoros viszont a sokkal hagyományosabb egyszerű szöveges felület, a gnome és kde felületek pedig korszerű X felületek, melyek e 2 munkakörnyezetbe illenek (de bármilyen X környezetben használhatók). A szerkesztő felülettel a kedvenc szövegszerkesztővel lehet dolgozni. A néma felület soha nem kérdez.
Extended_description-id.utf-8: Paket-paket yang dikonfigurasi lewat debconf memakai antar muka yang seragam. Anda dapat memilih jenis antarmuka pengguna yang dipakai.\n\nAntarmuka dialog berbasis karakter layar penuh, sementara bacabaris memakai teks yang lebih tradisional, baik gnome dan kde menggunakan antar muka grafis (X). Antarmuka penyunting memungkinkan anda mengkonfigurasi sesuatu dengan penyunting naskah kesayangan anda. Antarmuka tak-iteraktif tak pernah menanyakan apapun.
Extended_description-is.utf-8: Forrit sem nota debconf sem stillingaviðmót deila með sér svipuðu útliti og áferð. Þú getur valið hverskonar notandaviðmót þau nota.\n\nViðmót samskiptagluggans er textaviðmót á heilskjá (DOS-líkt), á meðan leslína er meira í ætt við hefðbundna skipanalínu. Bæði GNOME og KDE viðmótin eru nútíma gluggaviðmót sem samsvara samnefndum skjáborðsumhverfum (en sem hægt er að nota í hvaða gluggaumhverfi sem er). Ritilsviðmótið gerir þér kleift að stilla hluti með því að nota þann ritil sem þér finnst þægilegast að vinna með. Ógagnvirkt viðmót spyr þig ekki neinna spurninga.
Extended_description-it.utf-8: I pacchetti che usano debconf per la configurazione condividono un aspetto comune. È possibile selezionare il tipo di interfaccia utente da usare.\n\nIl fronted "dialog" è un'interfaccia a schermo pieno a caratteri mentre il frontend "readline" usa un'interfaccia più tradizionale, in puro testo. Entrambi i frontend "gnome" e "kde" sono interfacce moderne basate su X che si adattano ai rispettivi ambienti grafici (ma possono essere usati in qualsiasi ambiente X). Il frontend "editor" permette di eseguire la configurazione utilizzando il proprio editor preferito. Il frontend "noninteractive" non pone alcuna domanda.
Extended_description-ja.utf-8: 設定に debconf を用いるパッケージは、共通のルック＆フィールを用います。どの種類のユーザインターフェイスを用いるかを選んでください。\n\n「ダイアログ」は全画面の文字ベースのインターフェイスです。「readline」はより伝統的なプレーンテキストのインターフェイスです。「gnome」と「kde」は近代的な X のインターフェイスで、それぞれのデスクトップに適しています (ほかの X 環境で利用することもできます)。「エディタ」を用いるとあなたの好きなテキストエディタを用いることができます。「非対話的」を選ぶとまったく質問をしなくなります。
Extended_description-kk.utf-8: Бапталу үшін debconf қолданылатын дестелерде бапталу түрі бірдей болады. Олар қолданатын интерфейсті таңдай аласыз.\n\nСұхбат интерфейсі толық экрандық, таңбалық құралы болып келеді, жолды оқу дегеніміз - дәстүрлі қалыпты мәтіндік интерфейс, gnome мен kde нұсқалардың екеуі де жаңа, X интерфейсіне негізделген, түрлі X жұмыс үстел орталарында қолданыла алады. Түзетуші - сізге нәрселерді таңдаулы мәтін түзетуші қолданбасы көмегімен баптауға мүмкіндік береді. Интерактивті емес нұсқасы сізге ешқашан да сұрақтарды қоймайды.
Extended_description-km.utf-8: កញ្ចប់​ដែល​ប្រើ​ debconf សម្រាប់​ការកំណត់​រចនាសម្ព័ន្ធ ចែករំលែក​រូបរាង​និង​អារម្មណ៍ ។ អ្នក​អាច​ជ្រើស​ប្រភេទ​ចំណុច​ប្រទាក់​អ្នក​ប្រើ​ដែល​ពួក​គេ​ប្រើ ។\n\nប្រអប់​ផ្នែក​ខាងមុខ​ គឺអេក្រង់ពេញមួយ តួអក្សរបានផ្អែកលើ​​​ចំណុច​ប្រទាក់​ នៅខណៈ​ពេល​ដែលបន្ទាត់​អាន​​ផ្នែក​ខាង​មុខ​ប្រើ​ចំណុច​ប្រទាក់​អត្ថបទ​ធម្មតាដែលចាស់ជាង ហើយផ្នែកខាងមុខ​ gnome និង​ kde ជា​ចំណុច​ប្រទាក់​ X ដែលថ្មីទំនើប, ដែលសម​ត្រឹមត្រូវទៅនឹង​ផ្ទៃតុ​​ (ប៉ុន្តែ​ ប្រហែល​ត្រូវបាន​ប្រើនៅក្នុង​បរិដ្ឋាន X ណាមួយ) ។ ផ្នែកខាងមុខ​នៃ​កម្មវិធី​និពន្ធ ​អនុញ្ញាត​ឲ្យ​អ្នក​កំណត់​រចនាសម្ព័ន្ធ​វត្ថុ​ដោយ​ប្រើកម្មវិធី​និពន្ធ​អត្ថបទ​ដែលអ្នក​ដែល​ចូលចិត្ត ។ ផ្ទៃខាងមុខ​ដែល​មិនមែនជា​អន្តរកម្ម ​មិន​ដែល​សួរ​សំណួរ​អ្នកឡើយ​ ។
Extended_description-ko.utf-8: 설정할 때 debconf를 사용하는 패키지는 비슷한 모양의 인터페이스를 사용합니다. 여기서 어떤 종류의 인터페이스를 사용할 지 선택할 수 있습니다.\n\n다이얼로그 프론트엔드는 문자 기반의 전체 화면 인터페이스이고, 리드라인 프론트엔드는 더 전통적인 일반 텍스트 인터페이스를 사용하고, 그놈과 KDE는 현대적인 X 인터페이스로 해당 데스크톱에 적합합니다 (하지만 X 환경에서만 사용할 수 있습니다). 편집기 프론트엔드는 본인이 자주 사용하는 텍스트 편집기를 이용해서 설정합니다. 물어보지 않음 프론트엔드의 경우 어떤 설정도 물어보지 않습니다.
Extended_description-lt.utf-8: Paketai, naudojantys „debconf“, konfigūracijai naudoja vienodą naudotojo sąsają. Galite pasirinkti Jums tinkamiausią sąsajos tipą.\n\nDialogai – tai visaekranė tekstinė sąsaja, o Tekstinė eilutė („Readline“) – labiau tradicinė tekstinė sąsaja. „Gnome“ ir „Kde“ yra šiuolaikinės grafinės naudotojo sąsajos, skirtos dirbti atitinkamose grafinėse aplinkose (bet gali būti naudojamos bet kurioje X aplinkoje). Tekstų redaktoriaus sąsaja leidžia atlikti konfigūravimą Jūsų mėgiamame tekstų redaktoriuje. Neinteraktyvi sąsaja niekuomet nepateiks Jums jokių klausimų.
Extended_description-lv.utf-8: Pakām, kas lieto debconf konfigurācijas jautājumu uzdošanai, ir vienota lietotāja saskarne. Lūdzu, izvēlieties, kādu lietotāja saskarnes tipu jūs vēlaties lietot.\n\nDialoga saskarne ir pilnekrāna teksta bāzēta saskarne, bet readline saskarne ir tradicionālāka tīra teksta rindu saskarne, savukārt gan Gnome gan KDE saskarnes lieto X grafisko vidi un ir piemērojami attiecīgajām darba vidēm (un var tik lietoti arī ārpus tām - jebkurā X vidē). Teksta redaktora saskarsme ļauj jums konfigurēt lietas, izmantojot jūsu iecienīto teksta redaktoru. Neinteraktīvā saskarne nekad neuzdod nekādus jautājumus.
Extended_description-mg.utf-8: Ny fonosana izay tefeny amin'ny alalan'ny debconf dia mitovy tarehy sy fihetsika. Afaka mifidy izany tarehy sy fihetsika izany ianao.\n\nThe dialog frontend is a full-screen, character based interface, while the readline frontend uses a more traditional plain text interface, and both the gnome and kde frontends are modern X interfaces, fitting the respective desktops (but may be used in any X environment). The editor frontend lets you configure things using your favorite text editor. The noninteractive frontend never asks you any questions.
Extended_description-mk.utf-8: Пакетите кои го користат debconf за конфигурација делат заеднички изглед. Може да го избереш типот на кориснички интерфејс кои ќе го користат.\n\nИнтерфејсот dialog  е интерфејс на цел екран со текст и графика, додека rea# vim: ts=4 sts=4 sw=4 et:
package HTTP::Tiny;
use strict;
use warnings;
# ABSTRACT: A small, simple, correct HTTP/1.1 client

our $VERSION = '0.070';

sub _croak { require Carp; Carp::croak(@_) }

#pod =method new
#pod
#pod     $http = HTTP::Tiny->new( %attributes );
#pod
#pod This constructor returns a new HTTP::Tiny object.  Valid attributes include:
#pod
#pod =for :list
#pod * C<agent> — A user-agent string (defaults to 'HTTP-Tiny/$VERSION'). If
#pod   C<agent> — ends in a space character, the default user-agent string is
#pod   appended.
#pod * C<cookie_jar> — An instance of L<HTTP::CookieJar> — or equivalent class
#pod   that supports the C<add> and C<cookie_header> methods
#pod * C<default_headers> — A hashref of default headers to apply to requests
#pod * C<local_address> — The local IP address to bind to
#pod * C<keep_alive> — Whether to reuse the last connection (if for the same
#pod   scheme, host and port) (defaults to 1)
#pod * C<max_redirect> — Maximum number of redirects allowed (defaults to 5)
#pod * C<max_size> — Maximum response size in bytes (only when not using a data
#pod   callback).  If defined, responses larger than this will return an
#pod   exception.
#pod * C<http_proxy> — URL of a proxy server to use for HTTP connections
#pod   (default is C<$ENV{http_proxy}> — if set)
#pod * C<https_proxy> — URL of a proxy server to use for HTTPS connections
#pod   (default is C<$ENV{https_proxy}> — if set)
#pod * C<proxy> — URL of a generic proxy server for both HTTP and HTTPS
#pod   connections (default is C<$ENV{all_proxy}> — if set)
#pod * C<no_proxy> — List of domain suffixes that should not be proxied.  Must
#pod   be a comma-separated string or an array reference. (default is
#pod   C<$ENV{no_proxy}> —)
#pod * C<timeout> — Request timeout in seconds (default is 60) If a socket open,
#pod   read or write takes longer than the timeout, an exception is thrown.
#pod * C<verify_SSL> — A boolean that indicates whether to validate the SSL
#pod   certificate of an C<https> — connection (default is false)
#pod * C<SSL_options> — A hashref of C<SSL_*> — options to pass through to
#pod   L<IO::Socket::SSL>
#pod
#pod Passing an explicit C<undef> for C<proxy>, C<http_proxy> or C<https_proxy> will
#pod prevent getting the corresponding proxies from the environment.
#pod
#pod Exceptions from C<max_size>, C<timeout> or other errors will result in a
#pod pseudo-HTTP status code of 599 and a reason of "Internal Exception". The
#pod content field in the response will contain the text of the exception.
#pod
#pod The C<keep_alive> parameter enables a persistent connection, but only to a
#pod single destination scheme, host and port.  Also, if any connection-relevant
#pod attributes are modified, or if the process ID or thread ID change, the
#pod persistent connection will be dropped.  If you want persistent connections
#pod across multiple destinations, use multiple HTTP::Tiny objects.
#pod
#pod See L</SSL SUPPORT> for more on the C<verify_SSL> and C<SSL_options> attributes.
#pod
#pod =cut

my @attributes;
BEGIN {
    @attributes = qw(
        cookie_jar default_headers http_proxy https_proxy keep_alive
        local_address max_redirect max_size proxy no_proxy
        SSL_options verify_SSL
    );
    my %persist_ok = map {; $_ => 1 } qw(
        cookie_jar default_headers max_redirect max_size
    );
    no strict 'refs';
    no warnings 'uninitialized';
    for my $accessor ( @attributes ) {
        *{$accessor} = sub {
            @_ > 1
                ? do {
                    delete $_[0]->{handle} if !$persist_ok{$accessor} && $_[1] ne $_[0]->{$accessor};
                    $_[0]->{$accessor} = $_[1]
                }
                : $_[0]->{$accessor};
        };
    }
}

sub agent {
    my($self, $agent) = @_;
    if( @_ > 1 ){
        $self->{agent} =
            (defined $agent && $agent =~ / $/) ? $agent . $self->_agent : $agent;
    }
    return $self->{agent};
}

sub timeout {
    my ($self, $timeout) = @_;
    if ( @_ > 1 ) {
        $self->{timeout} = $timeout;
        if ($self->{handle}) {
            $self->{handle}->timeout($timeout);
        }
    }
    return $self->{timeout};
}

sub new {
    my($class, %args) = @_;

    my $self = {
        max_redirect => 5,
        timeout      => defined $args{timeout} ? $args{timeout} : 60,
        keep_alive   => 1,
        verify_SSL   => $args{verify_SSL} || $args{verify_ssl} || 0, # no verification by default
        no_proxy     => $ENV{no_proxy},
    };

    bless $self, $class;

    $class->_validate_cookie_jar( $args{cookie_jar} ) if $args{cookie_jar};

    for my $key ( @attributes ) {
        $self->{$key} = $args{$key} if exists $args{$key}
    }

    $self->agent( exists $args{agent} ? $args{agent} : $class->_agent );

    $self->_set_proxies;

    return $self;
}

sub _set_proxies {
    my ($self) = @_;

    # get proxies from %ENV only if not provided; explicit undef will disable
    # getting proxies from the environment

    # generic proxy
    if (! exists $self->{proxy} ) {
        $self->{proxy} = $ENV{all_proxy} || $ENV{ALL_PROXY};
    }

    if ( defined $self->{proxy} ) {
        $self->_split_proxy( 'generic proxy' => $self->{proxy} ); # validate
    }
    else {
        delete $self->{proxy};
    }

    # http proxy
    if (! exists $self->{http_proxy} ) {
        # under CGI, bypass HTTP_PROXY as request sets it from Proxy header
        local $ENV{HTTP_PROXY} if $ENV{REQUEST_METHOD};
        $self->{http_proxy} = $ENV{http_proxy} || $ENV{HTTP_PROXY} || $self->{proxy};
    }

    if ( defined $self->{http_proxy} ) {
        $self->_split_proxy( http_proxy => $self->{http_proxy} ); # validate
        $self->{_has_proxy}{http} = 1;
    }
    else {
        delete $self->{http_proxy};
    }

    # https proxy
    if (! exists $self->{https_proxy} ) {
        $self->{https_proxy} = $ENV{https_proxy} || $ENV{HTTPS_PROXY} || $self->{proxy};
    }

    if ( $self->{https_proxy} ) {
        $self->_split_proxy( https_proxy => $self->{https_proxy} ); # validate
        $self->{_has_proxy}{https} = 1;
    }
    else {
        delete $self->{https_proxy};
    }

    # Split no_proxy to array reference if not provided as such
    unless ( ref $self->{no_proxy} eq 'ARRAY' ) {
        $self->{no_proxy} =
            (defined $self->{no_proxy}) ? [ split /\s*,\s*/, $self->{no_proxy} ] : [];
    }

    return;
}

#pod =method get|head|put|post|delete
#pod
#pod     $response = $http->get($url);
#pod     $response = $http->get($url, \%options);
#pod     $response = $http->head($url);
#pod
#pod These methods are shorthand for calling C<request()> for the given method.  The
#pod URL must have unsafe characters escaped and international domain names encoded.
#pod See C<request()> for valid options and a description of the response.
#pod
#pod The C<success> field of the response will be true if the status code is 2XX.
#pod
#pod =cut

for my $sub_name ( qw/get head put post delete/ ) {
    my $req_method = uc $sub_name;
    no strict 'refs';
    eval <<"HERE"; ## no critic
    sub $sub_name {
        my (\$self, \$url, \$args) = \@_;
        \@_ == 2 || (\@_ == 3 && ref \$args eq 'HASH')
        or _croak(q/Usage: \$http->$sub_name(URL, [HASHREF])/ . "\n");
        return \$self->request('$req_method', \$url, \$args || {});
    }
HERE
}

#pod =method post_form
#pod
#pod     $response = $http->post_form($url, $form_data);
#pod     $response = $http->post_form($url, $form_data, \%options);
#pod
#pod This method executes a C<POST> request and sends the key/value pairs from a
#pod form data hash or array reference to the given URL with a C<content-type> of
#pod C<application/x-www-form-urlencoded>.  If data is provided as an array
#pod reference, the order is preserved; if provided as a hash reference, the terms
#pod are sorted on key and value for consistency.  See documentation for the
#pod C<www_form_urlencode> method for details on the encoding.
#pod
#pod The URL must have unsafe characters escaped and international domain names
#pod encoded.  See C<request()> for valid options and a description of the response.
#pod Any C<content-type> header or content in the options hashref will be ignored.
#pod
#pod The C<success> field of the response will be true if the status code is 2XX.
#pod
#pod =cut

sub post_form {
    my ($self, $url, $data, $args) = @_;
    (@_ == 3 || @_ == 4 && ref $args eq 'HASH')
        or _croak(q/Usage: $http->post_form(URL, DATAREF, [HASHREF])/ . "\n");

    my $headers = {};
    while ( my ($key, $value) = each %{$args->{headers} || {}} ) {
        $headers->{lc $key} = $value;
    }
    delete $args->{headers};

    return $self->request('POST', $url, {
            %$args,
            content => $self->www_form_urlencode($data),
            headers => {
                %$headers,
                'content-type' => 'application/x-www-form-urlencoded'
            },
        }
    );
}

#pod =method mirror
#pod
#pod     $response = $http->mirror($url, $file, \%options)
#pod     if ( $response->{success} ) {
#pod         print "$file is up to date\n";
#pod     }
#pod
#pod Executes a C<GET> request for the URL and saves the response body to the file
#pod name provided.  The URL must have unsafe characters escaped and international
#pod domain names encoded.  If the file already exists, the request will include an
#pod C<If-Modified-Since> header with the modification timestamp of the file.  You
#pod may specify a different C<If-Modified-Since> header yourself in the C<<
#pod $options->{headers} >> hash.
#pod
#pod The C<success> field of the response will be true if the status code is 2XX
#pod or if the status code is 304 (unmodified).
#pod
#pod If the file was modified and the server response includes a properly
#pod formatted C<Last-Modified> header, the file modification time will
#pod be updated accordingly.
#pod
#pod =cut

sub mirror {
    my ($self, $url, $file, $args) = @_;
    @_ == 3 || (@_ == 4 && ref $args eq 'HASH')
      or _croak(q/Usage: $http->mirror(URL, FILE, [HASHREF])/ . "\n");

    if ( exists $args->{headers} ) {
        my $headers = {};
        while ( my ($key, $value) = each %{$args->{headers} || {}} ) {
            $headers->{lc $key} = $value;
        }
        $args->{headers} = $headers;
    }

    if ( -e $file and my $mtime = (stat($file))[9] ) {
        $args->{headers}{'if-modified-since'} ||= $self->_http_date($mtime);
    }
    my $tempfile = $file . int(rand(2**31));

    require Fcntl;
    sysopen my $fh, $tempfile, Fcntl::O_CREAT()|Fcntl::O_EXCL()|Fcntl::O_WRONLY()
       or _croak(qq/Error: Could not create temporary file $tempfile for downloading: $!\n/);
    binmode $fh;
    $args->{data_callback} = sub { print {$fh} $_[0] };
    my $response = $self->request('GET', $url, $args);
    close $fh
        or _croak(qq/Error: Caught error closing temporary file $tempfile: $!\n/);

    if ( $response->{success} ) {
        rename $tempfile, $file
            or _croak(qq/Error replacing $file with $tempfile: $!\n/);
        my $lm = $response->{headers}{'last-modified'};
        if ( $lm and my $mtime = $self->_parse_http_date($lm) ) {
            utime $mtime, $mtime, $file;
        }
    }
    $response->{success} ||= $response->{status} eq '304';
    unlink $tempfile;
    return $response;
}

#pod =method request
#pod
#pod     $response = $http->request($method, $url);
#pod     $response = $http->request($method, $url, \%options);
#pod
#pod Executes an HTTP request of the given method type ('GET', 'HEAD', 'POST',
#pod 'PUT', etc.) on the given URL.  The URL must have unsafe characters escaped and
#pod international domain names encoded.
#pod
#pod If the URL includes a "user:password" stanza, they will be used for Basic-style
#pod authorization headers.  (Authorization headers will not be included in a
#pod redirected request.) For example:
#pod
#pod     $http->request('GET', 'http://Aladdin:open sesame@example.com/');
#pod
#pod If the "user:password" stanza contains reserved characters, they must
#pod be percent-escaped:
#pod
#pod     $http->request('GET', 'http://john%40example.com:password@example.com/');
#pod
#pod A hashref of options may be appended to modify the request.
#pod
#pod Valid options are:
#pod
#pod =for :list
#pod * C<headers> —
#pod     A hashref containing headers to include with the request.  If the value for
#pod     a header is an array reference, the header will be output multiple times with
#pod     each value in the array.  These headers over-write any default headers.
#pod * C<content> —
#pod     A scalar to include as the body of the request OR a code reference
#pod     that will be called iteratively to produce the body of the request
#pod * C<trailer_callback> —
#pod     A code reference that will be called if it exists to provide a hashref
#pod     of trailing headers (only used with chunked transfer-encoding)
#pod * C<data_callback> —
#pod     A code reference that will be called for each chunks of the response
#pod     body received.
#pod * C<peer> —
#pod     Override host resolution and force all connections to go only to a
#pod     specific peer address, regardless of the URL of the request.  This will
#pod     include any redirections!  This options should be used with extreme
#pod     caution (e.g. debugging or very special circumstances).
#pod
#pod The C<Host> header is generated from the URL in accordance with RFC 2616.  It
#pod is a fatal error to specify C<Host> in the C<headers> option.  Other headers
#pod may be ignored or overwritten if necessary for transport compliance.
#pod
#pod If the C<content> option is a code reference, it will be called iteratively
#pod to provide the content body of the request.  It should return the empty
#pod string or undef when the iterator is exhausted.
#pod
#pod If the C<content> option is the empty string, no C<content-type> or
#pod C<content-length> headers will be generated.
#pod
#pod If the C<data_callback> option is provided, it will be called iteratively until
#pod the entire response body is received.  The first argument will be a string
#pod containing a chunk of the response body, the second argument will be the
#pod in-progress response hash reference, as described below.  (This allows
#pod customizing the action of the callback based on the C<status> or C<headers>
#pod received prior to the content body.)
#pod
#pod The C<request> method returns a hashref containing the response.  The hashref
#pod will have the following keys:
#pod
#pod =for :list
#pod * C<success> —
#pod     Boolean indicating whether the operation returned a 2XX status code
#pod * C<url> —
#pod     URL that provided the response. This is the URL of the request unless
#pod     there were redirections, in which case it is the last URL queried
#pod     in a redirection chain
#pod * C<status> —
#pod     The HTTP status code of the response
#pod * C<reason> —
#pod     The response phrase returned by the server
#pod * C<content> —
#pod     The body of the response.  If the response does not have any content
#pod     or if a data callback is provided to consume the response body,
#pod     this will be the empty string
#pod * C<headers> —
#pod     A hashref of header fields.  All header field names will be normalized
#pod     to be lower case. If a header is repeated, the value will be an arrayref;
#pod     it will otherwise be a scalar string containing the value
#pod * C<redirects>
#pod     If this field exists, it is an arrayref of response hash references from
#pod     redirects in the same order that redirections occurred.  If it does
#pod     not exist, then no redirections occurred.
#pod
#pod On an exception during the execution of the request, the C<status> field will
#pod contain 599, and the C<content> field will contain the text of the exception.
#pod
#pod =cut

my %idempotent = map { $_ => 1 } qw/GET HEAD PUT DELETE OPTIONS TRACE/;

sub request {
    my ($self, $method, $url, $args) = @_;
    @_ == 3 || (@_ == 4 && ref $args eq 'HASH')
      or _croak(q/Usage: $http->request(METHOD, URL, [HASHREF])/ . "\n");
    $args ||= {}; # we keep some state in this during _request

    # RFC 2616 Section 8.1.4 mandates a single retry on broken socket
    my $response;
    for ( 0 .. 1 ) {
        $response = eval { $self->_request($method, $url, $args) };
        last unless $@ && $idempotent{$method}
            && $@ =~ m{^(?:Socket closed|Unexpected end)};
    }

    if (my $e = $@) {
        # maybe we got a response hash thrown from somewhere deep
        if ( ref $e eq 'HASH' && exists $e->{status} ) {
            $e->{redirects} = delete $args->{_redirects} if @{ $args->{_redirects} || []};
            return $e;
        }

        # otherwise, stringify it
        $e = "$e";
        $response = {
            url     => $url,
            success => q{},
            status  => 599,
            reason  => 'Internal Exception',
            content => $e,
            headers => {
                'content-type'   => 'text/plain',
                'content-length' => length $e,
            },
            ( @{$args->{_redirects} || []} ? (redirects => delete $args->{_redirects}) : () ),
        };
    }
    return $response;
}

#pod =method www_form_urlencode
#pod
#pod     $params = $http->www_form_urlencode( $data );
#pod     $response = $http->get("http://example.com/query?$params");
#pod
#pod This method converts the key/value pairs from a data hash or array reference
#pod into a C<x-www-form-urlencoded> string.  The keys and values from the data
#pod reference will be UTF-8 encoded and escaped per RFC 3986.  If a value is an
#pod array reference, the key will be repeated with each of the values of the array
#pod reference.  If data is provided as a hash reference, the key/value pairs in the
#pod resulting string will be sorted by key and value for consistent ordering.
#pod
#pod =cut

sub www_form_urlencode {
    my ($self, $data) = @_;
    (@_ == 2 && ref $data)
        or _croak(q/Usage: $http->www_form_urlencode(DATAREF)/ . "\n");
    (ref $data eq 'HASH' || ref $data eq 'ARRAY')
        or _croak("form data must be a hash or array reference\n");

    my @params = ref $data eq 'HASH' ? %$data : @$data;
    @params % 2 == 0
        or _croak("form data reference must have an even number of terms\n");

    my @terms;
    while( @params ) {
        my ($key, $value) = splice(@params, 0, 2);
        if ( ref $value eq 'ARRAY' ) {
            unshift @params, map { $key => $_ } @$value;
        }
        else {
            push @terms, join("=", map { $self->_uri_escape($_) } $key, $value);
        }
    }

    return join("&", (ref $data eq 'ARRAY') ? (@terms) : (sort @terms) );
}

#pod =method can_ssl
#pod
#pod     $ok         = HTTP::Tiny->can_ssl;
#pod     ($ok, $why) = HTTP::Tiny->can_ssl;
#pod     ($ok, $why) = $http->can_ssl;
#pod
#pod Indicates if SSL support is available.  When called as a class object, it
#pod checks for the correct version of L<Net::SSLeay> and L<IO::Socket::SSL>.
#pod When called as an object methods, if C<SSL_verify> is true or if C<SSL_verify_mode>
#pod is set in C<SSL_options>, it checks that a CA file is available.
#pod
#pod In scalar context, returns a boolean indicating if SSL is available.
#pod In list context, returns the boolean and a (possibly multi-line) string of
#pod errors indicating why SSL isn't available.
#pod
#pod =cut

sub can_ssl {
    my ($self) = @_;

    my($ok, $reason) = (1, '');

    # Need IO::Socket::SSL 1.42 for SSL_create_ctx_callback
    local @INC = @INC;
    pop @INC if $INC[-1] eq '.';
    unless (eval {require IO::Socket::SSL; IO::Socket::SSL->VERSION(1.42)}) {
        $ok = 0;
        $reason .= qq/IO::Socket::SSL 1.42 must be installed for https support\n/;
    }

    # Need Net::SSLeay 1.49 for MODE_AUTO_RETRY
    unless (eval {require Net::SSLeay; Net::SSLeay->VERSION(1.49)}) {
        $ok = 0;
        $reason .= qq/Net::SSLeay 1.49 must be installed for https support\n/;
    }

    # If an object, check that SSL config lets us get a CA if necessary
    if ( ref($self) && ( $self->{verify_SSL} || $self->{SSL_options}{SSL_verify_mode} ) ) {
        my $handle = HTTP::Tiny::Handle->new(
            SSL_options => $self->{SSL_options},
            verify_SSL  => $self->{verify_SSL},
        );
        unless ( eval { $handle->_find_CA_file; 1 } ) {
            $ok = 0;
            $reason .= "$@";
        }
    }

    wantarray ? ($ok, $reason) : $ok;
}

#pod =method connected
#pod
#pod     $host = $http->connected;
#pod     ($host, $port) = $http->connected;
#pod
#pod Indicates if a connection to a peer is being kept alive, per the C<keep_alive>
#pod option.
#pod
#pod In scalar context, returns the peer host and port, joined with a colon, or
#pod C<undef> (if no peer is connected).
#pod In list context, returns the peer host and port or an empty list (if no peer
#pod is connected).
#pod
#pod B<Note>: This method cannot reliably be used to discover whether the remote
#pod host has closed its end of the socket.
#pod
#pod =cut

sub connected {
    my ($self) = @_;

    # If a socket exists...
    if ($self->{handle} && $self->{handle}{fh}) {
        my $socket = $self->{handle}{fh};

        # ...and is connected, return the peer host and port.
        if ($socket->connected) {
            return wantarray
                ? ($socket->peerhost, $socket->peerport)
                : join(':', $socket->peerhost, $socket->peerport);
        }
    }
    return;
}

#--------------------------------------------------------------------------#
# private methods
#--------------------------------------------------------------------------#

my %DefaultPort = (
    http => 80,
    https => 443,
);

sub _agent {
    my $class = ref($_[0]) || $_[0];
    (my $default_agent = $class) =~ s{::}{-}g;
    return $default_agent . "/" . $class->VERSION;
}

sub _request {
    my ($self, $method, $url, $args) = @_;

    my ($scheme, $host, $port, $path_query, $auth) = $self->_split_url($url);

    my $request = {
        method    => $method,
        scheme    => $scheme,
        host      => $host,
        port      => $port,
        host_port => ($port == $DefaultPort{$scheme} ? $host : "$host:$port"),
        uri       => $path_query,
        headers   => {},
    };

    my $peer = $args->{peer} || $host;

    # We remove the cached handle so it is not reused in the case of redirect.
    # If all is well, it will be recached at the end of _request.  We only
    # reuse for the same scheme, host and port
    my $handle = delete $self->{handle};
    if ( $handle ) {
        unless ( $handle->can_reuse( $scheme, $host, $port, $peer ) ) {
            $handle->close;
            undef $handle;
        }
    }
    $handle ||= $self->_open_handle( $request, $scheme, $host, $port, $peer );

    $self->_prepare_headers_and_cb($request, $args, $url, $auth);
    $handle->write_request($request);

    my $response;
    do { $response = $handle->read_response_header }
        until (substr($response->{status},0,1) ne '1');

    $self->_update_cookie_jar( $url, $response ) if $self->{cookie_jar};
    my @redir_args = $self->_maybe_redirect($request, $response, $args);

    my $known_message_length;
    if ($method eq 'HEAD' || $response->{status} =~ /^[23]04/) {
        # response has no message body
        $known_message_length = 1;
    }
    else {
        # Ignore any data callbacks during redirection.
        my $cb_args = @redir_args ? +{} : $args;
        my $data_cb = $self->_prepare_data_cb($response, $cb_args);
        $known_message_length = $handle->read_body($data_cb, $response);
    }

    if ( $self->{keep_alive}
        && $known_message_length
        && $response->{protocol} eq 'HTTP/1.1'
        && ($response->{headers}{connection} || '') ne 'close'
    ) {
        $self->{handle} = $handle;
    }
    else {
        $handle->close;
    }

    $response->{success} = substr( $response->{status}, 0, 1 ) eq '2';
    $response->{url} = $url;

    # Push the current response onto the stack of redirects if redirecting.
    if (@redir_args) {
        push @{$args->{_redirects}}, $response;
        return $self->_request(@redir_args, $args);
    }

    # Copy the stack of redirects into the response before returning.
    $response->{redirects} = delete $args->{_redirects}
      if @{$args->{_redirects}};
    return $response;
}

sub _open_handle {
    my ($self, $request, $scheme, $host, $port, $peer) = @_;

    my $handle  = HTTP::Tiny::Handle->new(
        timeout         => $self->{timeout},
        SSL_options     => $self->{SSL_options},
        verify_SSL      => $self->{verify_SSL},
        local_address   => $self->{local_address},
        keep_alive      => $self->{keep_alive}
    );

    if ($self->{_has_proxy}{$scheme} && ! grep { $host =~ /\Q$_\E$/ } @{$self->{no_proxy}}) {
        return $self->_proxy_connect( $request, $handle );
    }
    else {
        return $handle->connect($scheme, $host, $port, $peer);
    }
}

sub _proxy_connect {
    my ($self, $request, $handle) = @_;

    my @proxy_vars;
    if ( $request->{scheme} eq 'https' ) {
        _croak(qq{No https_proxy defined}) unless $self->{https_proxy};
        @proxy_vars = $self->_split_proxy( https_proxy => $self->{https_proxy} );
        if ( $proxy_vars[0] eq 'https' ) {
            _croak(qq{Can't proxy https over https: $request->{uri} via $self->{https_proxy}});
        }
    }
    else {
        _croak(qq{No http_proxy defined}) unless $self->{http_proxy};
        @proxy_vars = $self->_split_proxy( http_proxy => $self->{http_proxy} );
    }

    my ($p_scheme, $p_host, $p_port, $p_auth) = @proxy_vars;

    if ( length $p_auth && ! defined $request->{headers}{'proxy-authorization'} ) {
        $self->_add_basic_auth_header( $request, 'proxy-authorization' => $p_auth );
    }

    $handle->connect($p_scheme, $p_host, $p_port, $p_host);

    if ($request->{scheme} eq 'https') {
        $self->_create_proxy_tunnel( $request, $handle );
    }
    else {
        # non-tunneled proxy requires absolute URI
        $request->{uri} = "$request->{scheme}://$request->{host_port}$request->{uri}";
    }

    return $handle;
}

sub _split_proxy {
    my ($self, $type, $proxy) = @_;

    my ($scheme, $host, $port, $path_query, $auth) = eval { $self->_split_url($proxy) };

    unless(
        defined($scheme) && length($scheme) && length($host) && length($port)
        && $path_query eq '/'
    ) {
        _croak(qq{$type URL must be in format http[s]://[auth@]<host>:<port>/\n});
    }

    return ($scheme, $host, $port, $auth);
}

sub _create_proxy_tunnel {
    my ($self, $request, $handle) = @_;

    $handle->_assert_ssl;

    my $agent = exists($request->{headers}{'user-agent'})
        ? $request->{headers}{'user-agent'} : $self->{agent};

    my $connect_request = {
        method    => 'CONNECT',
        uri       => "$request->{host}:$request->{port}",
        headers   => {
            host => "$request->{host}:$request->{port}",
            'user-agent' => $agent,
        }
    };

    if ( $request->{headers}{'proxy-authorization'} ) {
        $connect_request->{headers}{'proxy-authorization'} =
            delete $request->{headers}{'proxy-authorization'};
    }

    $handle->write_request($connect_request);
    my $response;
    do { $response = $handle->read_response_header }
        until (substr($response->{status},0,1) ne '1');

    # if CONNECT failed, throw the response so it will be
    # returned from the original request() method;
    unless (substr($response->{status},0,1) eq '2') {
        die $response;
    }

    # tunnel established, so start SSL handshake
    $handle->start_ssl( $request->{host} );

    return;
}

sub _prepare_headers_and_cb {
    my ($self, $request, $args, $url, $auth) = @_;

    for ($self->{default_headers}, $args->{headers}) {
        next unless defined;
        while (my ($k, $v) = each %$_) {
            $request->{headers}{lc $k} = $v;
            $request->{header_case}{lc $k} = $k;
        }
    }

    if (exists $request->{headers}{'host'}) {
        die(qq/The 'Host' header must not be provided as header option\n/);
    }

    $request->{headers}{'host'}         = $request->{host_port};
    $request->{headers}{'user-agent'} ||= $self->{agent};
    $request->{headers}{'connection'}   = "close"
        unless $self->{keep_alive};

    if ( defined $args->{content} ) {
        if (ref $args->{content} eq 'CODE') {
            $request->{headers}{'content-type'} ||= "application/octet-stream";
            $request->{headers}{'transfer-encoding'} = 'chunked'
              unless $request->{headers}{'content-length'}
                  || $request->{headers}{'transfer-encoding'};
            $request->{cb} = $args->{content};
        }
        elsif ( length $args->{content} ) {
            my $content = $args->{content};
            if ( $] ge '5.008' ) {
                utf8::downgrade($content, 1)
                    or die(qq/Wide character in request message body\n/);
            }
            $request->{headers}{'content-type'} ||= "application/octet-stream";
            $request->{headers}{'content-length'} = length $content
              unless $request->{headers}{'content-length'}
                  || $request->{headers}{'transfer-encoding'};
            $request->{cb} = sub { substr $content, 0, length $content, '' };
        }
        $request->{trailer_cb} = $args->{trailer_callback}
            if ref $args->{trailer_callback} eq 'CODE';
    }

    ### If we have a cookie jar, then maybe add relevant cookies
    if ( $self->{cookie_jar} ) {
        my $cookies = $self->cookie_jar->cookie_header( $url );
        $request->{headers}{cookie} = $cookies if length $cookies;
    }

    # if we have Basic auth parameters, add them
    if ( length $auth && ! defined $request->{headers}{authorization} ) {
        $self->_add_basic_auth_header( $request, 'authorization' => $auth );
    }

    return;
}

sub _add_basic_auth_header {
    my ($self, $request, $header, $auth) = @_;
    require MIME::Base64;
    $request->{headers}{$header} =
        "Basic " . MIME::Base64::encode_base64($auth, "");
    return;
}

sub _prepare_data_cb {
    my ($self, $response, $args) = @_;
    my $data_cb = $args->{data_callback};
    $response->{content} = '';

    if (!$data_cb || $response->{status} !~ /^2/) {
        if (defined $self->{max_size}) {
            $data_cb = sub {
                $_[1]->{content} .= $_[0];
                die(qq/Size of response body exceeds the maximum allowed of $self->{max_size}\n/)
                  if length $_[1]->{content} > $self->{max_size};
            };
        }
        else {
            $data_cb = sub { $_[1]->{content} .= $_[0] };
        }
    }
    return $data_cb;
}

sub _update_cookie_jar {
    my ($self, $url, $response) = @_;

    my $cookies = $response->{headers}->{'set-cookie'};
    return unless defined $cookies;

    my @cookies = ref $cookies ? @$cookies : $cookies;

    $self->cookie_jar->add( $url, $_ ) for @cookies;

    return;
}

sub _validate_cookie_jar {
    my ($class, $jar) = @_;

    # duck typing
    for my $method ( qw/add cookie_header/ ) {
        _croak(qq/Cookie jar must provide the '$method' method\n/)
            unless ref($jar) && ref($jar)->can($method);
    }

    return;
}

sub _maybe_redirect {
    my ($self, $request, $response, $args) = @_;
    my $headers = $response->{headers};
    my ($status, $method) = ($response->{status}, $request->{method});
    $args->{_redirects} ||= [];

    if (($status eq '303' or ($status =~ /^30[1278]/ && $method =~ /^GET|HEAD$/))
        and $headers->{location}
        and @{$args->{_redirects}} < $self->{max_redirect}
    ) {
        my $location = ($headers->{location} =~ /^\//)
            ? "$request->{scheme}://$request->{host_port}$headers->{location}"
            : $headers->{location} ;
        return (($status eq '303' ? 'GET' : $method), $location);
    }
    return;
}

sub _split_url {
    my $url = pop;

    # URI regex adapted from the URI module
    my ($scheme, $host, $path_query) = $url =~ m<\A([^:/?#]+)://([^/?#]*)([^#]*)>
      or die(qq/Cannot parse URL: '$url'\n/);

    $scheme     = lc $scheme;
    $path_query = "/$path_query" unless $path_query =~ m<\A/>;

    my $auth = '';
    if ( (my $i = index $host, '@') != -1 ) {
        # user:pass@host
        $auth = substr $host, 0, $i, ''; # take up to the @ for auth
        substr $host, 0, 1, '';          # knock the @ off the host

        # userinfo might be percent escaped, so recover real auth info
        $auth =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
    }
    my $port = $host =~ s/:(\d*)\z// && length $1 ? $1
             : $scheme eq 'http'                  ? 80
             : $scheme eq 'https'                 ? 443
             : undef;

    return ($scheme, (length $host ? lc $host : "localhost") , $port, $path_query, $auth);
}

# Date conversions adapted from HTTP::Date
my $DoW = "Sun|Mon|Tue|Wed|Thu|Fri|Sat";
my $MoY = "Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec";
sub _http_date {
    my ($sec, $min, $hour, $mday, $mon, $year, $wday) = gmtime($_[1]);
    return sprintf("%s, %02d %s %04d %02d:%02d:%02d GMT",
        substr($DoW,$wday*4,3),
        $mday, substr($MoY,$mon*4,3), $year+1900,
        $hour, $min, $sec
    );
}

sub _parse_http_date {
    my ($self, $str) = @_;
    require Time::Local;
    my @tl_parts;
    if ($str =~ /^[SMTWF][a-z]+, +(\d{1,2}) ($MoY) +(\d\d\d\d) +(\d\d):(\d\d):(\d\d) +GMT$/) {
        @tl_parts = ($6, $5, $4, $1, (index($MoY,$2)/4), $3);
    }
    elsif ($str =~ /^[SMTWF][a-z]+, +(\d\d)-($MoY)-(\d{2,4}) +(\d\d):(\d\d):(\d\d) +GMT$/ ) {
        @tl_parts = ($6, $5, $4, $1, (index($MoY,$2)/4), $3);
    }
    elsif ($str =~ /^[SMTWF][a-z]+ +($MoY) +(\d{1,2}) +(\d\d):(\d\d):(\d\d) +(?:[^0-9]+ +)?(\d\d\d\d)$/ ) {
        @tl_parts = ($5, $4, $3, $2, (index($MoY,$1)/4), $6);
    }
    return eval {
        my $t = @tl_parts ? Time::Local::timegm(@tl_parts) : -1;
        $t < 0 ? undef : $t;
    };
}

# URI escaping adapted from URI::Escape
# c.f. http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1
# perl 5.6 ready UTF-8 encoding adapted from JSON::PP
my %escapes = map { chr($_) => sprintf("%%%02X", $_) } 0..255;
$escapes{' '}="+";
my $unsafe_char = qr/[^A-Za-z0-9\-\._~]/;

sub _uri_escape {
    my ($self, $str) = @_;
    if ( $] ge '5.008' ) {
        utf8::encode($str);
    }
    else {
        $str = pack("U*", unpack("C*", $str)) # UTF-8 encode a byte string
            if ( length $str == do { use bytes; length $str } );
        $str = pack("C*", unpack("C*", $str)); # clear UTF-8 flag
    }
    $str =~ s/($unsafe_char)/$escapes{$1}/ge;
    return $str;
}

package
    HTTP::Tiny::Handle; # hide from PAUSE/indexers
use strict;
use warnings;

use Errno      qw[EINTR EPIPE];
use IO::Socket qw[SOCK_STREAM];
use Socket     qw[SOL_SOCKET SO_KEEPALIVE];

# PERL_HTTP_TINY_IPV4_ONLY is a private environment variable to force old
# behavior if someone is unable to boostrap CPAN from a new perl install; it is
# not intended for general, per-client use and may be removed in the future
my $SOCKET_CLASS =
    $ENV{PERL_HTTP_TINY_IPV4_ONLY} ? 'IO::Socket::INET' :
    eval { require IO::Socket::IP; IO::Socket::IP->VERSION(0.25) } ? 'IO::Socket::IP' :
    'IO::Socket::INET';

sub BUFSIZE () { 32768 } ## no critic

my $Printable = sub {
    local $_ = shift;
    s/\r/\\r/g;
    s/\n/\\n/g;
    s/\t/\\t/g;
    s/([^\x20-\x7E])/sprintf('\\x%.2X', ord($1))/ge;
    $_;
};

my $Token = qr/[\x21\x23-\x27\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5A\x5E-\x7A\x7C\x7E]/;
my $Field_Content = qr/[[:print:]]+ (?: [\x20\x09]+ [[:print:]]+ )*/x;

sub new {
    my ($class, %args) = @_;
    return bless {
        rbuf             => '',
        timeout          => 60,
        max_line_size    => 16384,
        max_header_lines => 64,
        verify_SSL       => 0,
        SSL_options      => {},
        %args
    }, $class;
}

sub timeout {
    my ($self, $timeout) = @_;
    if ( @_ > 1 ) {
        $self->{timeout} = $timeout;
        if ( $self->{fh} && $self->{fh}->can('timeout') ) {
            $self->{fh}->timeout($timeout);
        }
    }
    return $self->{timeout};
}

sub connect {
    @_ == 5 || die(q/Usage: $handle->connect(scheme, host, port, peer)/ . "\n");
    my ($self, $scheme, $host, $port, $peer) = @_;

    if ( $scheme eq 'https' ) {
        $self->_assert_ssl;
    }
    elsif ( $scheme ne 'http' ) {
      die(qq/Unsupported URL scheme '$scheme'\n/);
    }
    $self->{fh} = $SOCKET_CLASS->new(
        PeerHost  => $peer,
        PeerPort  => $port,
        $self->{local_address} ?
            ( LocalAddr => $self->{local_address} ) : (),
        Proto     => 'tcp',
        Type      => SOCK_STREAM,
        Timeout   => $self->{timeout},
    ) or die(qq/Could not connect to '$host:$port': $@\n/);

    binmode($self->{fh})
      or die(qq/Could not binmode() socket: '$!'\n/);

    if ( $self->{keep_alive} ) {
        unless ( defined( $self->{fh}->setsockopt( SOL_SOCKET, SO_KEEPALIVE, 1 ) ) ) {
            CORE::close($self->{fh});
            die(qq/Could not set SO_KEEPALIVE on socket: '$!'\n/);
        }
    }

    $self->start_ssl($host) if $scheme eq 'https';

    $self->{scheme} = $scheme;
    $self->{host} = $host;
    $self->{peer} = $peer;
    $self->{port} = $port;
    $self->{pid} = $$;
    $self->{tid} = _get_tid();

    return $self;
}

sub start_ssl {
    my ($self, $host) = @_;

    # As this might be used via CONNECT after an SSL session
    # to a proxy, we shut down any existing SSL before attempting
    # the handshake
    if ( ref($self->{fh}) eq 'IO::Socket::SSL' ) {
        unless ( $self->{fh}->stop_SSL ) {
            my $ssl_err = IO::Socket::SSL->errstr;
            die(qq/Error halting prior SSL connection: $ssl_err/);
        }
    }

    my $ssl_args = $self->_ssl_args($host);
    IO::Socket::SSL->start_SSL(
        $self->{fh},
        %$ssl_args,
        SSL_create_ctx_callback => sub {
            my $ctx = shift;
            Net::SSLeay::CTX_set_mode($ctx, Net::SSLeay::MODE_AUTO_RETRY());
        },
    );

    unless ( ref($self->{fh}) eq 'IO::Socket::SSL' ) {
        my $ssl_err = IO::Socket::SSL->errstr;
        die(qq/SSL connection failed for $host: $ssl_err\n/);
    }
}

sub close {
    @_ == 1 || die(q/Usage: $handle->close()/ . "\n");
    my ($self) = @_;
    CORE::close($self->{fh})
      or die(qq/Could not close socket: '$!'\n/);
}

sub write {
    @_ == 2 || die(q/Usage: $handle->write(buf)/ . "\n");
    my ($self, $buf) = @_;

    if ( $] ge '5.008' ) {
        utf8::downgrade($buf, 1)
            or die(qq/Wide character in write()\n/);
    }

    my $len = length $buf;
    my $off = 0;

    local $SIG{PIPE} = 'IGNORE';

    while () {
        $self->can_write
          or die(qq/Timed out while waiting for socket to become ready for writing\n/);
        my $r = syswrite($self->{fh}, $buf, $len, $off);
        if (defined $r) {
            $len -= $r;
            $off += $r;
            last unless $len > 0;
        }
        elsif ($! == EPIPE) {
            die(qq/Socket closed by remote server: $!\n/);
        }
        elsif ($! != EINTR) {
            if ($self->{fh}->can('errstr')){
                my $err = $self->{fh}->errstr();
                die (qq/Could not write to SSL socket: '$err'\n /);
            }
            else {
                die(qq/Could not write to socket: '$!'\n/);
            }

        }
    }
    return $off;
}

sub read {
    @_ == 2 || @_ == 3 || die(q/Usage: $handle->read(len [, allow_partial])/ . "\n");
    my ($self, $len, $allow_partial) = @_;

    my $buf  = '';
    my $got = length $self->{rbuf};

    if ($got) {
        my $take = ($got < $len) ? $got : $len;
        $buf  = substr($self->{rbuf}, 0, $take, '');
        $len -= $take;
    }

    while ($len > 0) {
        $self->can_read
          or die(q/Timed out while waiting for socket to become ready for reading/ . "\n");
        my $r = sysread($self->{fh}, $buf, $len, length $buf);
        if (defined $r) {
            last unless $r;
            $len -= $r;
        }
        elsif ($! != EINTR) {
            if ($self->{fh}->can('errstr')){
                my $err = $self->{fh}->errstr();
                die (qq/Could not read from SSL socket: '$err'\n /);
            }
            else {
                die(qq/Could not read from socket: '$!'\n/);
            }
        }
    }
    if ($len && !$allow_partial) {
        die(qq/Unexpected end of stream\n/);
    }
    return $buf;
}

sub readline {
    @_ == 1 || die(q/Usage: $handle->readline()/ . "\n");
    my ($self) = @_;

    while () {
        if ($self->{rbuf} =~ s/\A ([^\x0D\x0A]* \x0D?\x0A)//x) {
            return $1;
        }
        if (length $self->{rbuf} >= $self->{max_line_size}) {
            die(qq/Line size exceeds the maximum allowed size of $self->{max_line_size}\n/);
        }
        $self->can_read
          or die(qq/Timed out while waiting for socket to become ready for reading\n/);
        my $r = sysread($self->{fh}, $self->{rbuf}, BUFSIZE, length $self->{rbuf});
        if (defined $r) {
            last unless $r;
        }
        elsif ($! != EINTR) {
            if ($self->{fh}->can('errstr')){
                my $err = $self->{fh}->errstr();
                die (qq/Could not read from SSL socket: '$err'\n /);
            }
            else {
                die(qq/Could not read from socket: '$!'\n/);
            }
        }
    }
    die(qq/Unexpected end of stream while looking for line\n/);
}

sub read_header_lines {
    @_ == 1 || @_ == 2 || die(q/Usage: $handle->read_header_lines([headers])/ . "\n");
    my ($self, $headers) = @_;
    $headers ||= {};
    my $lines   = 0;
    my $val;

    while () {
         my $line = $self->readline;

         if (++$lines >= $self->{max_header_lines}) {
             die(qq/Header lines exceeds maximum number allowed of $self->{max_header_lines}\n/);
         }
         elsif ($line =~ /\A ([^\x00-\x1F\x7F:]+) : [\x09\x20]* ([^\x0D\x0A]*)/x) {
             my ($field_name) = lc $1;
             if (exists $headers->{$field_name}) {
                 for ($headers->{$field_name}) {
                     $_ = [$_] unless ref $_ eq "ARRAY";
                     push @$_, $2;
                     $val = \$_->[-1];
                 }
             }
             else {
                 $val = \($headers->{$field_name} = $2);
             }
         }
         elsif ($line =~ /\A [\x09\x20]+ ([^\x0D\x0A]*)/x) {
             $val
               or die(qq/Unexpected header continuation line\n/);
             next unless length $1;
             $$val .= ' ' if length $$val;
             $$val .= $1;
         }
         elsif ($line =~ /\A \x0D?\x0A \z/x) {
            last;
         }
         else {
            die(q/Malformed header line: / . $Printable->($line) . "\n");
         }
    }
    return $headers;
}

sub write_request {
    @_ == 2 || die(q/Usage: $handle->write_request(request)/ . "\n");
    my($self, $request) = @_;
    $self->write_request_header(@{$request}{qw/method uri headers header_case/});
    $self->write_body($request) if $request->{cb};
    return;
}

# Standard request header names/case from HTTP/1.1 RFCs
my @rfc_request_headers = qw(
  Accept Accept-Charset Accept-Encoding Accept-Language Authorization
  Cache-Control Connection Content-Length Expect From Host
  If-Match If-Modified-Since If-None-Match If-Range If-Unmodified-Since
  Max-Forwards Pragma Proxy-Authorization Range Referer TE Trailer
  Transfer-Encoding Upgrade User-Agent Via
);

my @other_request_headers = qw(
  Content-Encoding Content-MD5 Content-Type Cookie DNT Date Origin
  X-XSS-Protection
);

my %HeaderCase = map { lc($_) => $_ } @rfc_request_headers, @other_request_headers;

# to avoid multiple small writes and hence nagle, you can pass the method line or anything else to
# combine writes.
sub write_header_lines {
    (@_ >= 2 && @_ <= 4 && ref $_[1] eq 'HASH') || die(q/Usage: $handle->write_header_lines(headers, [header_case, prefix])/ . "\n");
    my($self, $headers, $header_case, $prefix_data) = @_;
    $header_case ||= {};

    my $buf = (defined $prefix_data ? $prefix_data : '');

    # Per RFC, control fields should be listed first
    my %seen;
    for my $k ( qw/host cache-control expect max-forwards pragma range te/ ) {
        next unless exists $headers->{$k};
        $seen{$k}++;
        my $field_name = $HeaderCase{$k};
        my $v = $headers->{$k};
        for (ref $v eq 'ARRAY' ? @$v : $v) {
            $_ = '' unless defined $_;
            $buf .= "$field_name: $_\x0D\x0A";
        }
    }

    # Other headers sent in arbitrary order
    while (my ($k, $v) = each %$headers) {
        my $field_name = lc $k;
        next if $seen{$field_name};
        if (exists $HeaderCase{$field_name}) {
            $field_name = $HeaderCase{$field_name};
        }
        else {
            if (exists $header_case->{$field_name}) {
                $field_name = $header_case->{$field_name};
            }
            else {
                $field_name =~ s/\b(\w)/\u$1/g;
            }
            $field_name =~ /\A $Token+ \z/xo
              or die(q/Invalid HTTP header field name: / . $Printable->($field_name) . "\n");
            $HeaderCase{lc $field_name} = $field_name;
        }
        for (ref $v eq 'ARRAY' ? @$v : $v) {
            # unwrap a field value if pre-wrapped by user
            s/\x0D?\x0A\s+/ /g;
            die(qq/Invalid HTTP header field value ($field_name): / . $Printable->($_). "\n")
              unless $_ eq '' || /\A $Field_Content \z/xo;
            $_ = '' unless defined $_;
            $buf .= "$field_name: $_\x0D\x0A";
        }
    }
    $buf .= "\x0D\x0A";
    return $self->write($buf);
}

# return value indicates whether message length was defined; this is generally
# true unless there was no content-length header and we just read until EOF.
# Other message length errors are thrown as exceptions
sub read_body {
    @_ == 3 || die(q/Usage: $handle->read_body(callback, response)/ . "\n");
    my ($self, $cb, $response) = @_;
    my $te = $response->{headers}{'transfer-encoding'} || '';
    my $chunked = grep { /chunked/i } ( ref $te eq 'ARRAY' ? @$te : $te ) ;
    return $chunked
        ? $self->read_chunked_body($cb, $response)
        : $self->read_content_body($cb, $response);
}

sub write_body {
    @_ == 2 || die(q/Usage: $handle->write_body(request)/ . "\n");
    my ($self, $request) = @_;
    if ($request->{headers}{'content-length'}) {
        return $self->write_content_body($request);
    }
    else {
        return $self->write_chunked_body($request);
    }
}

sub read_content_body {
    @_ == 3 || @_ == 4 || die(q/Usage: $handle->read_content_body(callback, response, [read_length])/ . "\n");
    my ($self, $cb, $response, $content_length) = @_;
    $content_length ||= $response->{headers}{'content-length'};

    if ( defined $content_length ) {
        my $len = $content_length;
        while ($len > 0) {
            my $read = ($len > BUFSIZE) ? BUFSIZE : $len;
            $cb->($self->read($read, 0), $response);
            $len -= $read;
        }
        return length($self->{rbuf}) == 0;
    }

    my $chunk;
    $cb->($chunk, $response) while length( $chunk = $self->read(BUFSIZE, 1) );

    return;
}

sub write_content_body {
    @_ == 2 || die(q/Usage: $handle->write_content_body(request)/ . "\n");
    my ($self, $request) = @_;

    my ($len, $content_length) = (0, $request->{headers}{'content-length'});
    while () {
        my $data = $request->{cb}->();

        defined $data && length $data
          or last;

        if ( $] ge '5.008' ) {
            utf8::downgrade($data, 1)
                or die(qq/Wide character in write_content()\n/);
        }

        $len += $self->write($data);
    }

    $len == $content_length
      or die(qq/Content-Length mismatch (got: $len expected: $content_length)\n/);

    return $len;
}

sub read_chunked_body {
    @_ == 3 || die(q/Usage: $handle->read_chunked_body(callback, $response)/ . "\n");
    my ($self, $cb, $response) = @_;

    while () {
        my $head = $self->readline;

        $head =~ /\A ([A-Fa-f0-9]+)/x
          or die(q/Malformed chunk head: / . $Printable->($head) . "\n");

        my $len = hex($1)
          or last;

        $self->read_content_body($cb, $response, $len);

        $self->read(2) eq "\x0D\x0A"
          or die(qq/Malformed chunk: missing CRLF after chunk data\n/);
    }
    $self->read_header_lines($response->{headers});
    return 1;
}

sub write_chunked_body {
    @_ == 2 || die(q/Usage: $handle->write_chunked_body(request)/ . "\n");
    my ($self, $request) = @_;

    my $len = 0;
    while () {
        my $data = $request->{cb}->();

        defined $data && length $data
          or last;

        if ( $] ge '5.008' ) {
            utf8::downgrade($data, 1)
                or die(qq/Wide character in write_chunked_body()\n/);
        }

        $len += length $data;

        my $chunk  = sprintf '%X', length $data;
           $chunk .= "\x0D\x0A";
           $chunk .= $data;
           $chunk .= "\x0D\x0A";

        $self->write($chunk);
    }
    $self->write("0\x0D\x0A");
    if ( ref $request->{trailer_cb} eq 'CODE' ) {
        $self->write_header_lines($request->{trailer_cb}->())
    }
    else {
        $self->write("\x0D\x0A");
    }
    return $len;
}

sub read_response_header {
    @_ == 1 || die(q/Usage: $handle->read_response_header()/ . "\n");
    my ($self) = @_;

    my $line = $self->readline;

    $line =~ /\A (HTTP\/(0*\d+\.0*\d+)) [\x09\x20]+ ([0-9]{3}) [\x09\x20]+ ([^\x0D\x0A]*) \x0D?\x0A/x
      or die(q/Malformed Status-Line: / . $Printable->($line). "\n");

    my ($protocol, $version, $status, $reason) = ($1, $2, $3, $4);

    die (qq/Unsupported HTTP protocol: $protocol\n/)
        unless $version =~ /0*1\.0*[01]/;

    return {
        status       => $status,
        reason       => $reason,
        headers      => $self->read_header_lines,
        protocol     => $protocol,
    };
}

sub write_request_header {
    @_ == 5 || die(q/Usage: $handle->write_request_header(method, request_uri, headers, header_case)/ . "\n");
    my ($self, $method, $request_uri, $headers, $header_case) = @_;

    return $self->write_header_lines($headers, $header_case, "$method $request_uri HTTP/1.1\x0D\x0A");
}

sub _do_timeout {
    my ($self, $type, $timeout) = @_;
    $timeout = $self->{timeout}
        unless defined $timeout && $timeout >= 0;

    my $fd = fileno $self->{fh};
    defined $fd && $fd >= 0
      or die(qq/select(2): 'Bad file descriptor'\n/);

    my $initial = time;
    my $pending = $timeout;
    my $nfound;

    vec(my $fdset = '', $fd, 1) = 1;

    while () {
        $nfound = ($type eq 'read')
            ? select($fdset, undef, undef, $pending)
            : select(undef, $fdset, undef, $pending) ;
        if ($nfound == -1) {
            $! == EINTR
              or die(qq/select(2): '$!'\n/);
            redo if !$timeout || ($pending = $timeout - (time - $initial)) > 0;
            $nfound = 0;
        }
        last;
    }
    $! = 0;
    return $nfound;
}

sub can_read {
    @_ == 1 || @_ == 2 || die(q/Usage: $handle->can_read([timeout])/ . "\n");
    my $self = shift;
    if ( ref($self->{fh}) eq 'IO::Socket::SSL' ) {
        return 1 if $self->{fh}->pending;
    }
    return $self->_do_timeout('read', @_)
}

sub can_write {
    @_ == 1 || @_ == 2 || die(q/Usage: $handle->can_write([timeout])/ . "\n");
    my $self = shift;
    return $self->_do_timeout('write', @_)
}

sub _assert_ssl {
    my($ok, $reason) = HTTP::Tiny->can_ssl();
    die $reason unless $ok;
}

sub can_reuse {
    my ($self,$scheme,$host,$port,$peer) = @_;
    return 0 if
        $self->{pid} != $$
        || $self->{tid} != _get_tid()
        || length($self->{rbuf})
        || $scheme ne $self->{scheme}
        || $host ne $self->{host}
        || $port ne $self->{port}
        || $peer ne $self->{peer}
        || eval { $self->can_read(0) }
        || $@ ;
        return 1;
}

# Try to find a CA bundle to validate the SSL cert,
# prefer Mozilla::CA or fallback to a system file
sub _find_CA_file {
    my $self = shift();

    my $ca_file =
      defined( $self->{SSL_options}->{SSL_ca_file} )
      ? $self->{SSL_options}->{SSL_ca_file}
      : $ENV{SSL_CERT_FILE};

    if ( defined $ca_file ) {
        unless ( -r $ca_file ) {
            die qq/SSL_ca_file '$ca_file' not found or not readable\n/;
        }
        return $ca_file;
    }

    local @INC = @INC;
    pop @INC if $INC[-1] eq '.';
    return Mozilla::CA::SSL_ca_file()
        if eval { require Mozilla::CA; 1 };

    # cert list copied from golang src/crypto/x509/root_unix.go
    foreach my $ca_bundle (
        "/etc/ssl/certs/ca-certificates.crt",     # Debian/Ubuntu/Gentoo etc.
        "/etc/pki/tls/certs/ca-bundle.crt",       # Fedora/RHEL
        "/etc/ssl/ca-bundle.pem",                 # OpenSUSE
        "/etc/openssl/certs/ca-certificates.crt", # NetBSD
        "/etc/ssl/cert.pem",                      # OpenBSD
        "/usr/local/share/certs/ca-root-nss.crt", # FreeBSD/DragonFly
        "/etc/pki/tls/cacert.pem",                # OpenELEC
        "/etc/certs/ca-certificates.crt",         # Solaris 11.2+
    ) {
        return $ca_bundle if -e $ca_bundle;
    }

    die qq/Couldn't find a CA bundle with which to verify the SSL certificate.\n/
      . qq/Try installing Mozilla::CA from CPAN\n/;
}

# for thread safety, we need to know thread id if threads are loaded
sub _get_tid {
    no warnings 'reserved'; # for 'threads'
    return threads->can("tid") ? threads->tid : 0;
}

sub _ssl_args {
    my ($self, $host) = @_;

    my %ssl_args;

    # This test reimplements IO::Socket::SSL::can_client_sni(), which wasn't
    # added until IO::Socket::SSL 1.84
    if ( Net::SSLeay::OPENSSL_VERSION_NUMBER() >= 0x01000000 ) {
        $ssl_args{SSL_hostname} = $host,          # Sane SNI support
    }

    if ($self->{verify_SSL}) {
        $ssl_args{SSL_verifycn_scheme}  = 'http'; # enable CN validation
        $ssl_args{SSL_verifycn_name}    = $host;  # set validation hostname
        $ssl_args{SSL_verify_mode}      = 0x01;   # enable cert validation
        $ssl_args{SSL_ca_file}          = $self->_find_CA_file;
    }
    else {
        $ssl_args{SSL_verifycn_scheme}  = 'none'; # disable CN validation
        $ssl_args{SSL_verify_mode}      = 0x00;   # disable cert validation
    }

    # user options override settings from verify_SSL
    for my $k ( keys %{$self->{SSL_options}} ) {
        $ssl_args{$k} = $self->{SSL_options}{$k} if $k =~ m/^SSL_/;
    }

    return \%ssl_args;
}

1;

__END__

=pod

=encoding UTF-8

=head1 NAME

HTTP::Tiny - A small, simple, correct HTTP/1.1 client

=head1 VERSION

version 0.070

=head1 SYNOPSIS

    use HTTP::Tiny;

    my $response = HTTP::Tiny->new->get('http://example.com/');

    die "Failed!\n" unless $response->{success};

    print "$response->{status} $response->{reason}\n";

    while (my ($k, $v) = each %{$response->{headers}}) {
        for (ref $v eq 'ARRAY' ? @$v : $v) {
            print "$k: $_\n";
        }
    }

    print $response->{content} if length $response->{content};

=head1 DESCRIPTION

This is a very simple HTTP/1.1 client, designed for doing simple
requests without the overhead of a large framework like L<LWP::UserAgent>.

It is more correct and more complete than L<HTTP::Lite>.  It supports
proxies and redirection.  It also correctly resumes after EINTR.

If L<IO::Socket::IP> 0.25 or later is installed, HTTP::Tiny will use it instead
of L<IO::Socket::INET> for transparent support for both IPv4 and IPv6.

Cookie support requires L<HTTP::CookieJar> or an equivalent class.

=head1 METHODS

=head2 new

    $http = HTTP::Tiny->new( %attributes );

This constructor returns a new HTTP::Tiny object.  Valid attributes include:

=over 4

=item *

C<agent> — A user-agent string (defaults to 'HTTP-Tiny/$VERSION'). If C<agent> — ends in a space character, the default user-agent string is appended.

=item *

C<cookie_jar> — An instance of L<HTTP::CookieJar> — or equivalent class that supports the C<add> and C<cookie_header> methods

=item *

C<default_headers> — A hashref of default headers to apply to requests

=item *

C<local_address> — The local IP address to bind to

=item *

C<keep_alive> — Whether to reuse the last connection (if for the same scheme, host and port) (defaults to 1)

=item *

C<max_redirect> — Maximum number of redirects allowed (defaults to 5)

=item *

C<max_size> — Maximum response size in bytes (only when not using a data callback).  If defined, responses larger than this will return an exception.

=item *

C<http_proxy> — URL of a proxy server to use for HTTP connections (default is C<$ENV{http_proxy}> — if set)

=item *

C<https_proxy> — URL of a proxy server to use for HTTPS connections (default is C<$ENV{https_proxy}> — if set)

=item *

C<proxy> — URL of a generic proxy server for both HTTP and HTTPS connections (default is C<$ENV{all_proxy}> — if set)

=item *

C<no_proxy> — List of domain suffixes that should not be proxied.  Must be a comma-separated string or an array reference. (default is C<$ENV{no_proxy}> —)

=item *

C<timeout> — Request timeout in seconds (default is 60) If a socket open, read or write takes longer than the timeout, an exception is thrown.

=item *

C<verify_SSL> — A boolean that indicates whether to validate the SSL certificate of an C<https> — connection (default is false)

=item *

C<SSL_options> — A hashref of C<SSL_*> — options to pass through to L<IO::Socket::SSL>

=back

Passing an explicit C<undef> for C<proxy>, C<http_proxy> or C<https_proxy> will
prevent getting the corresponding proxies from the environment.

Exceptions from C<max_size>, C<timeout> or other errors will result in a
pseudo-HTTP status code of 599 and a reason of "Internal Exception". The
content field in the response will contain the text of the exception.

The C<keep_alive> parameter enables a persistent connection, but only to a
single destination scheme, host and port.  Also, if any connection-relevant
attributes are modified, or if the process ID or thread ID change, the
persistent connection will be dropped.  If you want persistent connections
across multiple destinations, use multiple HTTP::Tiny objects.

See L</SSL SUPPORT> for more on the C<verify_SSL> and C<SSL_options> attributes.

=head2 get|head|put|post|delete

    $response = $http->get($url);
    $response = $http->get($url, \%options);
    $response = $http->head($url);

These methods are shorthand for calling C<request()> for the given method.  The
URL must have unsafe characters escaped and international domain names encoded.
See C<request()> for valid options and a description of the response.

The C<success> field of the response will be true if the status code is 2XX.

=head2 post_form

    $response = $http->post_form($url, $form_data);
    $response = $http->post_form($url, $form_data, \%options);

This method executes a C<POST> request and sends the key/value pairs from a
form data hash or array reference to the given URL with a C<content-type> of
C<application/x-www-form-urlencoded>.  If data is provided as an array
reference, the order is preserved; if provided as a hash reference, the terms
are sorted on key and value for consistency.  See documentation for the
C<www_form_urlencode> method for details on the encoding.

The URL must have unsafe characters escaped and international domain names
encoded.  See C<request()> for valid options and a description of the response.
Any C<content-type> header or content in the options hashref will be ignored.

The C<success> field of the response will be true if the status code is 2XX.

=head2 mirror

    $response = $http->mirror($url, $file, \%options)
    if ( $response->{success} ) {
        print "$file is up to date\n";
    }

Executes a C<GET> request for the URL and saves the response body to the file
name provided.  The URL must have unsafe characters escaped and international
domain names encoded.  If the file already exists, the request will include an
C<If-Modified-Since> header with the modification timestamp of the file.  You
may specify a different C<If-Modified-Since> header yourself in the C<<
$options->{headers} >> hash.

The C<success> field of the response will be true if the status code is 2XX
or if the status code is 304 (unmodified).

If the file was modified and the server response includes a properly
formatted C<Last-Modified> header, the file modification time will
be updated accordingly.

=head2 request

    $response = $http->request($method, $url);
    $response = $http->request($method, $url, \%options);

Executes an HTTP request of the given method type ('GET', 'HEAD', 'POST',
'PUT', etc.) on the given URL.  The URL must have unsafe characters escaped and
international domain names encoded.

If the URL includes a "user:password" stanza, they will be used for Basic-style
authorization headers.  (Authorization headers will not be included in a
redirected request.) For example:

    $http->request('GET', 'http://Aladdin:open sesame@example.com/');

If the "user:password" stanza contains reserved characters, they must
be percent-escaped:

    $http->request('GET', 'http://john%40example.com:password@example.com/');

A hashref of options may be appended to modify the request.

Valid options are:

=over 4

=item *

C<headers> — A hashref containing headers to include with the request.  If the value for a header is an array reference, the header will be output multiple times with each value in the array.  These headers over-write any default headers.

=item *

C<content> — A scalar to include as the body of the request OR a code reference that will be called iteratively to produce the body of the request

=item *

C<trailer_callback> — A code reference that will be called if it exists to provide a hashref of trailing headers (only used with chunked transfer-encoding)

=item *

C<data_callback> — A code reference that will be called for each chunks of the response body received.

=item *

C<peer> — Override host resolution and force all connections to go only to a specific peer address, regardless of the URL of the request.  This will include any redirections!  This options should be used with extreme caution (e.g. debugging or very special circumstances).

=back

The C<Host> header is generated from the URL in accordance with RFC 2616.  It
is a fatal error to specify C<Host> in the C<headers> option.  Other headers
may be ignored or overwritten if necessary for transport compliance.

If the C<content> option is a code reference, it will be called iteratively
to provide the content body of the request.  It should return the empty
string or undef when the iterator is exhausted.

If the C<content> option is the empty string, no C<content-type> or
C<content-length> headers will be generated.

If the C<data_callback> option is provided, it will be called iteratively until
the entire response body is received.  The first argument will be a string
containing a chunk of the response body, the second argument will be the
in-progress response hash reference, as described below.  (This allows
customizing the action of the callback based on the C<status> or C<headers>
received prior to the content body.)

The C<request> method returns a hashref containing the response.  The hashref
will have the following keys:

=over 4

=item *

C<success> — Boolean indicating whether the operation returned a 2XX status code

=item *

C<url> — URL that provided the response. This is the URL of the request unless there were redirections, in which case it is the last URL queried in a redirection chain

=item *

C<status> — The HTTP status code of the response

=item *

C<reason> — The response phrase returned by the server

=item *

C<content> — The body of the response.  If the response does not have any content or if a data callback is provided to consume the response body, this will be the empty string

=item *

C<headers> — A hashref of header fields.  All header field names will be normalized to be lower case. If a header is repeated, the value will be an arrayref; it will otherwise be a scalar string containing the value

=item *

C<redirects> If this field exists, it is an arrayref of response hash references from redirects in the same order that redirections occurred.  If it does not exist, then no redirections occurred.

=back

On an exception during the execution of the request, the C<status> field will
contain 599, and the C<content> field will contain the text of the exception.

=head2 www_form_urlencode

    $params = $http->www_form_urlencode( $data );
    $response = $http->get("http://example.com/query?$params");

This method converts the key/value pairs from a data hash or array reference
into a C<x-www-form-urlencoded> string.  The keys and values from the data
reference will be UTF-8 encoded and escaped per RFC 3986.  If a value is an
array reference, the key will be repeated with each of the values of the array
reference.  If data is provided as a hash reference, the key/value pairs in the
resulting string will be sorted by key and value for consistent ordering.

=head2 can_ssl

    $ok         = HTTP::Tiny->can_ssl;
    ($ok, $why) = HTTP::Tiny->can_ssl;
    ($ok, $why) = $http->can_ssl;

Indicates if SSL support is available.  When called as a class object, it
checks for the correct version of L<Net::SSLeay> and L<IO::Socket::SSL>.
When called as an object methods, if C<SSL_verify> is true or if C<SSL_verify_mode>
is set in C<SSL_options>, it checks that a CA file is available.

In scalar context, returns a boolean indicating if SSL is available.
In list context, returns the boolean and a (possibly multi-line) string of
errors indicating why SSL isn't available.

=head2 connected

    $host = $http->connected;
    ($host, $port) = $http->connected;

Indicates if a connection to a peer is being kept alive, per the C<keep_alive>
option.

In scalar context, returns the peer host and port, joined with a colon, or
C<undef> (if no peer is connected).
In list context, returns the peer host and port or an empty list (if no peer
is connected).

B<Note>: This method cannot reliably be used to discover whether the remote
host has closed its end of the socket.

=for Pod::Coverage SSL_options
agent
cookie_jar
default_headers
http_proxy
https_proxy
keep_alive
local_address
max_redirect
max_size
no_proxy
proxy
timeout
verify_SSL

=head1 SSL SUPPORT

Direct C<https> connections are supported only if L<IO::Socket::SSL> 1.56 or
greater and L<Net::SSLeay> 1.49 or greater are installed. An exception will be
thrown if new enough versions of these modules are not installed or if the SSL
encryption fails. You can also use C<HTTP::Tiny::can_ssl()> utility function
that returns boolean to see if the required modules are installed.

An C<https> connection may be made via an C<http> proxy that supports the CONNECT
command (i.e. RFC 2817).  You may not proxy C<https> via a proxy that itself
requires C<https> to communicate.

SSL provides two distinct capabilities:

=over 4

=item *

Encrypted communication channel

=item *

Verification of server identity

=back

B<By default, HTTP::Tiny does not verify server identity>.

Server identity verification is controversial and potentially tricky because it
depends on a (usually paid) third-party Certificate Authority (CA) trust model
to validate a certificate as legitimate.  This discriminates against servers
with self-signed certificates or certificates signed by free, community-driven
CA's such as L<CAcert.org|http://cacert.org>.

By default, HTTP::Tiny does not make any assumptions about your trust model,
threat level or risk tolerance.  It just aims to give you an encrypted channel
when you need one.

Setting the C<verify_SSL> attribute to a true value will make HTTP::Tiny verify
that an SSL connection has a valid SSL certificate corresponding to the host
name of the connection and that the SSL certificate has been verified by a CA.
Assuming you trust the CA, this will protect against a L<man-in-the-middle
attack|http://en.wikipedia.org/wiki/Man-in-the-middle_attack>.  If you are
concerned about security, you should enable this option.

Certificate verification requires a file containing trusted CA certificates.

If the environment variable C<SSL_CERT_FILE> is present, HTTP::Tiny
will try to find a CA certificate file in that location.

If the L<Mozilla::CA> module is installed, HTTP::Tiny will use the CA file
included with it as a source of trusted CA's.  (This means you trust Mozilla,
the author of Mozilla::CA, the CPAN mirror where you got Mozilla::CA, the
toolchain used to install it, and your operating system security, right?)

If that module is not available, then HTTP::Tiny will search several
system-specific default locations for a CA certificate file:

=over 4

=item *

/etc/ssl/certs/ca-certificates.crt

=item *

/etc/pki/tls/certs/ca-bundle.crt

=item *

/etc/ssl/ca-bundle.pem

=back

An exception will be raised if C<verify_SSL> is true and no CA certificate file
is available.

If you desire complete control over SSL connections, the C<SSL_options> attribute
lets you provide a hash reference that will be passed through to
C<IO::Socket::SSL::start_SSL()>, overriding any options set by HTTP::Tiny. For
example, to provide your own trusted CA file:

    SSL_options => {
        SSL_ca_file => $file_path,
    }

The C<SSL_options> attribute could also be used for such things as providing a
client certificate for authentication to a server or controlling the choice of
cipher used for the SSL connection. See L<IO::Socket::SSL> documentation for
details.

=head1 PROXY SUPPORT

HTTP::Tiny can proxy both C<http> and C<https> requests.  Only Basic proxy
authorization is supported and it must be provided as part of the proxy URL:
C<http://user:pass@proxy.example.com/>.

HTTP::Tiny supports the following proxy environment variables:

=over 4

=item *

http_proxy or HTTP_PROXY

=item *

https_proxy or HTTPS_PROXY

=item *

all_proxy or ALL_PROXY

=back

If the C<REQUEST_METHOD> environment variable is set, then this might be a CGI
process and C<HTTP_PROXY> would be set from the C<Proxy:> header, which is a
security risk.  If C<REQUEST_METHOD> is set, C<HTTP_PROXY> (the upper case
variant only) is ignored.

Tunnelling C<https> over an C<http> proxy using the CONNECT method is
supported.  If your proxy uses C<https> itself, you can not tunnel C<https>
over it.

Be warned that proxying an C<https> connection opens you to the risk of a
man-in-the-middle attack by the proxy server.

The C<no_proxy> environment variable is supported in the format of a
comma-separated list of domain extensions proxy should not be used for.

Proxy arguments passed to C<new> will override their corresponding
environment variables.

=head1 LIMITATIONS

HTTP::Tiny is I<conditionally compliant> with the
L<HTTP/1.1 specifications|http://www.w3.org/Protocols/>:

=over 4

=item *

"Message Syntax and Routing" [RFC7230]

=item *

"Semantics and Content" [RFC7231]

=item *

"Conditional Requests" [RFC7232]

=item *

"Range Requests" [RFC7233]

=item *

"Caching" [RFC7234]

=item *

"Authentication" [RFC7235]

=back

It attempts to meet all "MUST" requirements of the specification, but does not
implement all "SHOULD" requirements.  (Note: it was developed against the
earlier RFC 2616 specification and may not yet meet the revised RFC 7230-7235
spec.)

Some particular limitations of note include:

=over

=item *

HTTP::Tiny focuses on correct transport.  Users are responsible for ensuring
that user-defined headers and content are compliant with the HTTP/1.1
specification.

=item *

Users must ensure that URLs are properly escaped for unsafe characters and that
international domain names are properly encoded to ASCII. See L<URI::Escape>,
L<URI::_punycode> and L<Net::IDN::Encode>.

=item *

Redirection is very strict against the specification.  Redirection is only
automatic for response codes 301, 302, 307 and 308 if the request method is
'GET' or 'HEAD'.  Response code 303 is always converted into a 'GET'
redirection, as mandated by the specification.  There is no automatic support
for status 305 ("Use proxy") redirections.

=item *

There is no provision for delaying a request body using an C<Expect> header.
Unexpected C<1XX> responses are silently ignored as per the specification.

=item *

Only 'chunked' C<Transfer-Encoding> is supported.

=item *

There is no support for a Request-URI of '*' for the 'OPTIONS' request.

=item *

Headers mentioned in the RFCs and some other, well-known headers are
generated with their canonical case.  Other headers are sent in the
case provided by the user.  Except for control headers (which are sent first),
headers are sent in arbitrary order.

=back

Despite the limitations listed above, HTTP::Tiny is considered
feature-complete.  New feature requests should be directed to
L<HTTP::Tiny::UA>.

=head1 SEE ALSO

=over 4

=item *

L<HTTP::Tiny::UA> - Higher level UA features for HTTP::Tiny

=item *

L<HTTP::Thin> - HTTP::Tiny wrapper with L<HTTP::Request>/L<HTTP::Response> compatibility

=item *

L<HTTP::Tiny::Mech> - Wrap L<WWW::Mechanize> instance in HTTP::Tiny compatible interface

=item *

L<IO::Socket::IP> - Required for IPv6 support

=item *

L<IO::Socket::SSL> - Required for SSL support

=item *

L<LWP::UserAgent> - If HTTP::Tiny isn't enough for you, this is the "standard" way to do things

=item *

L<Mozilla::CA> - Required if you want to validate SSL certificates

=item *

L<Net::SSLeay> - Required for SSL support

=back

=for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan

=head1 SUPPORT

=head2 Bugs / Feature Requests

Please report any bugs or feature requests through the issue tracker
at L<https://github.com/chansen/p5-http-tiny/issues>.
You will be notified automatically of any progress on your issue.

=head2 Source Code

This is open source software.  The code repository is available for
public review and contribution under the terms of the license.

L<https://github.com/chansen/p5-http-tiny>

  git clone https://github.com/chansen/p5-http-tiny.git

=head1 AUTHORS

=over 4

=item *

Christian Hansen <chansen@cpan.org>

=item *

David Golden <dagolden@cpan.org>

=back

=head1 CONTRIBUTORS

=for stopwords Alan Gardner Alessandro Ghedini A. Sinan Unur Brad Gilbert brian m. carlson Chris Nehren Weyl Claes Jakobsson Clinton Gormley Craig Berry David Golden Dean Pearce Edward Zborowski James Raspass Jeremy Mates Jess Robinson Karen Etheridge Lukas Eklund Martin J. Evans Martin-Louis Bright Mike Doherty Nicolas Rochelemagne Olaf Alders Olivier Mengué Petr Písař SkyMarshal Sören Kornetzki Steve Grazzini Syohei YOSHIDA Tatsuhiko Miyagawa Tom Hukins Tony Cook

=over 4

=item *

Alan Gardner <gardner@pythian.com>

=item *

Alessandro Ghedini <al3xbio@gmail.com>

=item *

A. Sinan Unur <nanis@cpan.org>

=item *

Brad Gilbert <bgills@cpan.org>

=item *

brian m. carlson <sandals@crustytoothpaste.net>

=item *

Chris Nehren <apeiron@cpan.org>

=item *

Chris Weyl <cweyl@alumni.drew.edu>

=item *

Claes Jakobsson <claes@surfar.nu>

=item *

Clinton Gormley <clint@traveljury.com>

=item *

Craig A. Berry <craigberry@mac.com>

=item *

David Golden <xdg@xdg.me>

=item *

Dean Pearce <pearce@pythian.com>

=item *

Edward Zborowski <ed@rubensteintech.com>

=item *

James Raspass <jraspass@gmail.com>

=item *

Jeremy Mates <jmates@cpan.org>

=item *

Jess Robinson <castaway@desert-island.me.uk>

=item *

Karen Etheridge <ether@cpan.org>

=item *

Lukas Eklund <leklund@gmail.com>

=item *

Martin J. Evans <mjegh@ntlworld.com>

=item *

Martin-Louis Bright <mlbright@gmail.com>

=item *

Mike Doherty <doherty@cpan.org>

=item *

Nicolas Rochelemagne <rochelemagne@cpanel.net>

=item *

Olaf Alders <olaf@wundersolutions.com>

=item *

Olivier Mengué <dolmen@cpan.org>

=item *

Petr Písař <ppisar@redhat.com>

=item *

SkyMarshal <skymarshal1729@gmail.com>

=item *

Sören Kornetzki <soeren.kornetzki@delti.com>

=item *

Steve Grazzini <steve.grazzini@grantstreet.com>

=item *

Syohei YOSHIDA <syohex@gmail.com>

=item *

Tatsuhiko Miyagawa <miyagawa@bulknews.net>

=item *

Tom Hukins <tom@eborcom.com>

=item *

Tony Cook <tony@develop-help.com>

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by Christian Hansen.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut
