summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAge
...
| * Send the access token.tastytea2020-01-10
| |
| * Add vector fields to HTTP forms.tastytea2020-01-10
| |
| * Fix User-Agent.tastytea2020-01-10
| |
| * Implement HTTP POST in Connection.tastytea2020-01-10
| |
| * Implement HTTP POST in CURLWrapper.tastytea2020-01-10
| |
| * Add parameterpair.tastytea2020-01-10
| |
| * Add a message only constructor to CURLException.tastytea2020-01-10
| |
| * Document package generation switches.tastytea2020-01-09
| |
| * Add curl version to CMake config.tastytea2020-01-09
| |
| * Shorten the pkg-config file a bit.tastytea2020-01-09
| |
| * Shorten streaming example.tastytea2020-01-09
| |
| * Typo: typo → type. 😃tastytea2020-01-09
| |
* | Merge branch 'develop' into maintastytea2020-01-09
|\|
| * Fix RPM conflicts with pkg-config and cmake.tastytea2020-01-09
| |
| * CI: Fix cmake arguments.tastytea2020-01-09
| |
| * Enable cmake switches for packages.tastytea2020-01-09
| |
| * CI: Build packages for Debian buster and Ubuntu bionic.tastytea2020-01-09
| |
| * Add packages.cmake, to create DEB and RPM packages.tastytea2020-01-09
| |
| * Fix answer_type::get_header().tastytea2020-01-09
| | | | | | | | The previous implementation returned a reference to an out-of-scope string.
| * Escape keyword “API” in documentation.tastytea2020-01-09
| |
| * Add get_header() to answer_type.tastytea2020-01-09
| |
| * Clear buffers before making a request.tastytea2020-01-09
| |
| * Add baseurl to uri if endpoint is string_view.tastytea2020-01-09
| |
| * Add get_new_events().tastytea2020-01-09
| | | | | | | | A more comfortable way to consume stream events.
| * Expand section about thread safety in documentation.tastytea2020-01-09
| |
| * Move set_proxy() to Instance.tastytea2020-01-09
| |
| * Fix curl URI.tastytea2020-01-08
| |
| * Fix <code> markup.tastytea2020-01-08
| |
* | Merge branch 'develop' into maintastytea2020-01-08
|\|
| * Add introduction and an example to readme.tastytea2020-01-08
| |
| * Add streaming example to reference.tastytea2020-01-08
| |
| * Improve documentation for new_stream_contents().tastytea2020-01-08
| |
| * Add streaming example.tastytea2020-01-08
| |
| * Only check for libcurl return code if it could return an error.tastytea2020-01-08
| |
| * Add streaming support.tastytea2020-01-08
| |
| * Make curl writer non-satatic and add static wrapper.tastytea2020-01-08
| | | | | | | | We need to use the mutex, a class member, from within the writer function.
| * Move URI building for GET requets to add_parameters_to_uri().tastytea2020-01-08
| |
| * Replace append with +=.tastytea2020-01-08
| |
| * Fix / ignore some clang-tidy warnings.tastytea2020-01-08
| |
| * Improve documentation.tastytea2020-01-08
| |
| * Add set_proxy().tastytea2020-01-08
| |
| * Replace string with string_view where possible.tastytea2020-01-08
| |
* | Merge branch 'develop' into maintastytea2020-01-08
|\|
| * Replace arguments in URI.tastytea2020-01-08
| | | | | | | | id, nickname, nickname_or_id, hashtag, permission_group.
| * Add support for parameters (GET).tastytea2020-01-08
| |
| * Follow up to 10 HTTP redirects automatically.tastytea2020-01-08
| | | | | | | | This includes permanent redirects.
| * Make curlwrapper_instances explicitly atomic.tastytea2020-01-08
| |
| * Add sections about thread safety and text input to documentation.tastytea2020-01-08
| |
| * CI: Compile exmaples.tastytea2020-01-07
| |
| * CI: Test with clang.tastytea2020-01-07
| |
ss="w"> hextoint(*(txt+2)); if (d1<0 || d2<0) { strcpy(txt, txt+3); return txt-1; } else { *txt = d1 * 16 + d2; strcpy(txt+1, txt+3); return txt; } } int cgit_parse_query(char *txt, configfn fn) { char *t, *value = NULL, c; if (!txt) return 0; t = txt = xstrdup(txt); while((c=*t) != '\0') { if (c=='=') { *t = '\0'; value = t+1; } else if (c=='+') { *t = ' '; } else if (c=='%') { t = convert_query_hexchar(t); } else if (c=='&') { *t = '\0'; (*fn)(txt, value); txt = t+1; value = NULL; } t++; } if (t!=txt) (*fn)(txt, value); return 0; } char *substr(const char *head, const char *tail) { char *buf; buf = xmalloc(tail - head + 1); strncpy(buf, head, tail - head); buf[tail - head] = '\0'; return buf; } struct commitinfo *cgit_parse_commit(struct commit *commit) { struct commitinfo *ret; char *p = commit->buffer, *t = commit->buffer; ret = xmalloc(sizeof(*ret)); ret->commit = commit; if (strncmp(p, "tree ", 5)) die("Bad commit: %s", sha1_to_hex(commit->object.sha1)); else p += 46; // "tree " + hex[40] + "\n" while (!strncmp(p, "parent ", 7)) p += 48; // "parent " + hex[40] + "\n" if (!strncmp(p, "author ", 7)) { p += 7; t = strchr(p, '<') - 1; ret->author = substr(p, t); p = t; t = strchr(t, '>') + 1; ret->author_email = substr(p, t); ret->author_date = atol(++t); p = strchr(t, '\n') + 1; } if (!strncmp(p, "committer ", 9)) { p += 9; t = strchr(p, '<') - 1; ret->committer = substr(p, t); p = t; t = strchr(t, '>') + 1; ret->committer_email = substr(p, t); ret->committer_date = atol(++t); p = strchr(t, '\n') + 1; } while (*p == '\n') p = strchr(p, '\n') + 1; t = strchr(p, '\n'); ret->subject = substr(p, t); p = t + 1; while (*p == '\n') p = strchr(p, '\n') + 1; ret->msg = p; return ret; }