Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Dry run fix #8

Closed
wants to merge 1 commit into from

2 participants

@agimenez

Hi,

The following changes fix a bug reported to the Debian package (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=608608).

Regards,
L. Alberto Giménez

@agimenez agimenez Fix dry-run for posting actions.
Fix debian bug #608608. the dry-run option did only work for non-oauth actions.
Note that the fix aims to be manpage-compliant, so it will not retrieve data
from the servers either.

Signed-off-by: L. Alberto Giménez <agimenez@sysvalve.es>
f30ece7
@gregkh
Owner

This was already fixed, a bit differently, in the Debian package, and I took that patch into the main bti tree, so this one is no longer needed.

Thanks so much.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 9, 2011
  1. @agimenez

    Fix dry-run for posting actions.

    agimenez authored
    Fix debian bug #608608. the dry-run option did only work for non-oauth actions.
    Note that the fix aims to be manpage-compliant, so it will not retrieve data
    from the servers either.
    
    Signed-off-by: L. Alberto Giménez <agimenez@sysvalve.es>
This page is out of date. Refresh to see the latest.
Showing with 11 additions and 3 deletions.
  1. +11 −3 bti.c
View
14 bti.c
@@ -396,6 +396,9 @@ static void parse_timeline(char *document)
xmlDocPtr doc;
xmlNodePtr current;
+ if (!document)
+ return;
+
doc = xmlReadMemory(document, strlen(document), "timeline.xml",
NULL, XML_PARSE_NOERROR);
if (doc == NULL)
@@ -755,18 +758,23 @@ static int send_request(struct session *session)
session->consumer_secret,
session->access_token_key,
session->access_token_secret);
- reply = oauth_http_post(req_url, postarg);
+
+ if (!session->dry_run)
+ reply = oauth_http_post(req_url, postarg);
+
} else {
req_url = oauth_sign_url2(endpoint, NULL, OA_HMAC, NULL,
session->consumer_key,
session->consumer_secret,
session->access_token_key,
session->access_token_secret);
- reply = oauth_http_get(req_url, postarg);
+
+ if (!session->dry_run)
+ reply = oauth_http_get(req_url, postarg);
}
dbg("%s\n", req_url);
- dbg("%s\n", reply);
+ dbg("%s\n", reply ? reply : "(dry-run)");
if (req_url)
free(req_url);
Something went wrong with that request. Please try again.