don't print the status code if it is 204 (so users are not confused)
This commit is contained in:
parent
77008d6526
commit
aa54ecd557
11
src/soap.c
11
src/soap.c
|
@ -74,14 +74,23 @@ char* soap_request(char *url, char *body, char *content_type)
|
|||
if (rc) {
|
||||
fprintf(stderr, "ne_request_dispatch failed, %d\n", rc);
|
||||
fprintf(stderr, "Error was: %s\n", ne_get_error(sess));
|
||||
ne_buffer_destroy(buf);
|
||||
ne_request_destroy(req);
|
||||
ne_session_destroy(sess);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
status = ne_get_status(req);
|
||||
if (status->code == 204) { /* OK; no content */
|
||||
ne_buffer_destroy(buf);
|
||||
ne_request_destroy(req);
|
||||
ne_session_destroy(sess);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (status->code != 200) {
|
||||
fprintf(stderr, "status->code = %d\n", status->code);
|
||||
ne_buffer_destroy(buf);
|
||||
ne_request_destroy(req);
|
||||
ne_session_destroy(sess);
|
||||
return NULL;
|
||||
|
@ -89,6 +98,8 @@ char* soap_request(char *url, char *body, char *content_type)
|
|||
|
||||
answer = strdup(buf->data);
|
||||
ne_buffer_destroy(buf);
|
||||
ne_request_destroy(req);
|
||||
ne_session_destroy(sess);
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
|
Reference in New Issue