[sr-dev] git:master:afb5bb99: utils: safe wrapper in case http status code is returned 0

Daniel-Constantin Mierla miconda at gmail.com
Mon Jun 27 11:35:46 CEST 2016


Module: kamailio
Branch: master
Commit: afb5bb99960d951217c6c94465cda92b10394e1a
URL: https://github.com/kamailio/kamailio/commit/afb5bb99960d951217c6c94465cda92b10394e1a

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-06-27T11:35:34+02:00

utils: safe wrapper in case http status code is returned 0

- returning it will stop config processing, replace the return code with
  -1 in such case

---

Modified: modules/utils/functions.c

---

Diff:  https://github.com/kamailio/kamailio/commit/afb5bb99960d951217c6c94465cda92b10394e1a.diff
Patch: https://github.com/kamailio/kamailio/commit/afb5bb99960d951217c6c94465cda92b10394e1a.patch

---

diff --git a/modules/utils/functions.c b/modules/utils/functions.c
index 5de92ad..58f23cb 100644
--- a/modules/utils/functions.c
+++ b/modules/utils/functions.c
@@ -228,5 +228,5 @@ int http_query(struct sip_msg* _m, char* _url, char* _dst, char* _post, char* _h
 
 	curl_easy_cleanup(curl);
 	pkg_free(stream.buf);
-	return stat;
+	return (stat!=0)?stat:-1;
 }




More information about the sr-dev mailing list