Commit Graph

24 Commits

Author SHA1 Message Date
Omar Polo e8b2d8e3f0 gg: prepend "Server says" to the reply code 2023-10-18 17:15:03 +00:00
Omar Polo 7980a5d2a8 gg: print the response header for non-2x replies to standard error 2023-10-18 17:13:51 +00:00
Omar Polo c7bcd4a8a9 gg: exit with the gemini response code
0 is still used for 2X replies, and "external" failures (e.g.
network, tls, ...) are still using exit code 1.  Gemini non-2x
replies now get their response code reported as-is as status code.
2023-10-15 15:06:34 +00:00
Omar Polo 6e4ba8184d copyright# 2023-10-14 18:52:12 +00:00
Omar Polo 88c03474f8 revert previous
Somehow the compat for __dead is not working properly on macos
(cirrus ci) since it complains that parse_debug() does not return
a value in all control paths when it uses usage() (marked as __dead)
to catch a wrong usage.
2023-07-23 14:13:23 +00:00
Omar Polo 67ae3d8e03 use __dead instead of __attribute__((noreturn)) 2023-07-22 16:08:21 +00:00
Omar Polo 800aa93c05 gg: warn when the TLS layer is not closed properly
various servers are not handling correctly the close notify so for
the moment don't turn this into an hard error but just warn.
Hopefully, given some time, most servers will be fixed.

while here, drop the gotos and just use a break to exit the main
loop.
2023-07-22 15:47:07 +00:00
Omar Polo 10cc819309 avoid arithmetic on void pointers (GNU extension)
not really sold on this one, I don't see what other interpretation could
be given, but it's not standard so...
2023-06-13 16:36:06 +00:00
Omar Polo 0046c1fe9c call setlocale() 2023-06-06 08:11:30 +00:00
Omar Polo 6130e0eeac always cast is*() arguments to unsigned char 2022-11-17 09:21:38 +00:00
Omar Polo 21cf735f37 remove -v from gg
undocumented flag to dump to stdout the request before doing it.  Not
useful, it's debugging leftover.
2022-10-30 08:26:22 +00:00
Omar Polo c5b4db930e specify custom version strings for the various cmds 2022-09-10 14:29:40 +00:00
Omar Polo e89f473904 s/whole/all 2022-01-27 10:37:28 +00:00
Omar Polo b3602923d0 shuffle the code a bit to improve readability 2022-01-13 10:34:55 +00:00
Omar Polo febfcde82b fix and sync gg usage 2022-01-13 10:13:32 +00:00
Omar Polo 5c7abf0151 reimplement gg
This is a better version of gg.  Initially it grew with flags directly
needed to the specific test cases I wanted to write, so it's ugly to use
but handy for tests.

This is a new and re-thought implementation that it is (hopefully)
easier to use both and "curl-like for gemini" but also for scripts and
tests cases.

One completely new feature is the proxying support with -P to send the
request to the given host.
2021-12-29 18:01:08 +00:00
Omar Polo f48e3b85a9 move gg to regress 2021-05-24 13:48:55 +00:00
Omar Polo 52418c8d82 fix various compilation errors
Include gmid.h as first header in every file, as it then includes
config.h (that defines _GNU_SOURCE for instance).

Fix also a warning about unsigned vs signed const char pointers in
openssl.
2021-02-12 12:47:20 +00:00
Omar Polo 31b3662c54 gg: add support for client certs 2021-02-09 15:01:12 +00:00
Omar Polo 58173ca20e customizable servname & verbose + misc tweaks
* add -H for explicit servname (for SNI)
* add -v to print also the request
* misc tweaks: move *flag variables to global scope (initialisation to
  0 for free!) and explicit handshake.
2021-01-27 14:48:23 +00:00
Omar Polo 9adde3d8b2 reuse the same buffer for the request and response 2021-01-23 17:45:56 +00:00
Omar Polo f62aab517d handle TLS_WANT_POLL{IN,OUT}
libtls doesn't seem to return when doing blocking I/O, but libretls
does every single time.
2021-01-23 17:43:04 +00:00
Omar Polo d760973a5b don't alter the struct iri 2021-01-23 17:07:52 +00:00
Omar Polo 497977d501 add gg, a barebones Gemini client 2021-01-23 16:56:24 +00:00