tinyblocks-socket, -ssl, -http e -archive: internet e arquivos compactados em blocos
socket: conexao TCP como TbStream (fluxo com classe read/write/close) e blocos para conectar, enviar, receber e resolver endereco. ssl: embrulha um TbStream TCP em TLS (OpenSSL), com SNI e certificado conferido pelo sistema e pelo nome do host. http: cliente HTTP/1.1 so sobre TbStream; https:// quando a ssl esta carregada; Content-Length, chunked e redirecionamentos; GET e POST de texto e download em segundo plano (.parte ate terminar) com progresso. archive: lista e extrai .tar e .tar.gz (zlib), nomes longos GNU/pax; recusa entradas com "../" ou caminho absoluto. As camadas se acham pelas tabelas no lib_userdata, sem linkar umas com as outras. test-http usa um servidor local (e a internet, se houver); test-archive cria os arquivos com tar e Python. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
05fdb094ed
commit
066bb295ed
20 files changed
+1689
-3
No files matched your search
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* TinyBlocks - tb_http.h
|
||||
* Library tinyblocks-http: cliente HTTP/1.1 sobre a interface TbStream.
|
||||
* Registra a categoria "HTTP".
|
||||
*
|
||||
* http:// usa a conexao TCP da tinyblocks-socket; https:// embrulha essa
|
||||
* conexao em TLS pela tinyblocks-ssl (se ela estiver carregada). As duas sao
|
||||
* achadas pelo runtime (tabelas no lib_userdata): esta library so conhece a
|
||||
* interface TbStream. Segue redirecionamentos (ate 8, inclusive de http
|
||||
* para https), entende Content-Length e "chunked".
|
||||
*
|
||||
* Baixar e ASSINCRONO: "baixe (url) para (arquivo)" comeca numa thread e
|
||||
* volta na hora; o programa espera com
|
||||
* repita ate que <download de (arquivo) terminou?>
|
||||
* O arquivo so ganha o nome final quando chega inteiro (antes:
|
||||
* <arquivo>.parte). "conteudo de (url)" busca um texto de uma vez.
|
||||
*/
|
||||
#ifndef TINYBLOCKS_HTTP_H
|
||||
#define TINYBLOCKS_HTTP_H
|
||||
|
||||
#include <tinyblocks/tinyblocks.h>
|
||||
|
||||
TB_API const TinyBlocks_LibraryDescriptor* tb_http_get_library(void);
|
||||
|
||||
#endif /* TINYBLOCKS_HTTP_H */
|
||||
Reference in new issue
Block a user