diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2011-01-25 20:59:14 +0100 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2011-01-25 20:59:14 +0100 |
commit | 5eadc6530d76de846ec63ece738f425c9291941d (patch) | |
tree | 7f2cc053590805695b811d69da83f379657240df /src/plugins | |
parent | 5d3a66f0b6cc2e9fd6a5dc5815d65d6708050ccc (diff) | |
download | abrt-5eadc6530d76de846ec63ece738f425c9291941d.tar.gz abrt-5eadc6530d76de846ec63ece738f425c9291941d.tar.xz abrt-5eadc6530d76de846ec63ece738f425c9291941d.zip |
move block of code to eliminate a goto
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/abrt_rh_support.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/plugins/abrt_rh_support.c b/src/plugins/abrt_rh_support.c index 04e2c8ef..e9092023 100644 --- a/src/plugins/abrt_rh_support.c +++ b/src/plugins/abrt_rh_support.c @@ -391,6 +391,15 @@ send_report_to_new_case(const char* baseURL, char *case_location = find_header_in_abrt_post_state(case_state, "Location:"); switch (case_state->http_resp_code) { + case 404: + /* Not strictly necessary (default branch would deal with it too), + * but makes this typical error less cryptic: + * instead of returning html-encoded body, we show short concise message, + * and show offending URL (typos in which is a typical cause) */ + retval = xasprintf("error in case creation, " + "HTTP code: 404 (Not found), URL:'%s'", case_url); + break; + case 301: /* "301 Moved Permanently" (for example, used to move http:// to https://) */ case 302: /* "302 Found" (just in case) */ case 305: /* "305 Use Proxy" */ @@ -401,18 +410,9 @@ send_report_to_new_case(const char* baseURL, free_abrt_post_state(case_state); goto redirect_case; } - goto bad_resp_code; - - case 404: - /* Not strictly necessary, but makes this typical error less cryptic: - * instead of returning html-encoded body, we show short concise message, - * and show offending URL (typos in which is a typical cause) */ - retval = xasprintf("error in case creation, " - "HTTP code: 404 (Not found), URL:'%s'", case_url); - break; + /* fall through */ default: - bad_resp_code: errmsg = case_state->curl_error_msg; if (errmsg) retval = xasprintf("error in case creation: %s", errmsg); |