[OpenSIPS/opensips] 3a566f: rest_client: Explicitly set retcode_pv to 0 on error

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[OpenSIPS/opensips] 3a566f: rest_client: Explicitly set retcode_pv to 0 on error

Bogdan Andrei IANCU
  Branch: refs/heads/2.4
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 3a566f156b1eab5d4e74bc60522fe94a781ee6f2
      https://github.com/OpenSIPS/opensips/commit/3a566f156b1eab5d4e74bc60522fe94a781ee6f2
  Author: Liviu Chircu <[hidden email]>
  Date:   2019-03-14 (Thu, 14 Mar 2019)

  Changed paths:
    M modules/rest_client/rest_client.c

  Log Message:
  -----------
  rest_client: Explicitly set retcode_pv to 0 on error

This avoids any scripting mistakes where:

    * the user does not init $var(http_rc) to 0 prior to rest_get()
    * rest_get() fails (e.g. connection timeout -- web server is down)
    * $var(http_rc) is untouched, yet mistakenly holds 200 from a
      previous (successful) run of the same process

(cherry picked from commit 9e842178d6c3d96143f4d1881bb57cdd180153f6)



_______________________________________________
Devel mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel