redir.xml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <refentry id="refred">
  2. <refmeta>
  3. <refentrytitle>ne_redirect_register</refentrytitle>
  4. <manvolnum>3</manvolnum>
  5. </refmeta>
  6. <refnamediv>
  7. <refname id="ne_redirect_register">ne_redirect_register</refname>
  8. <refname id="ne_redirect_location">ne_redirect_location</refname>
  9. <refpurpose>HTTP request redirect handling</refpurpose>
  10. </refnamediv>
  11. <refsynopsisdiv>
  12. <funcsynopsis>
  13. <funcsynopsisinfo>#include &lt;ne_redirect.h&gt;</funcsynopsisinfo>
  14. <funcprototype>
  15. <funcdef>void <function>ne_redirect_register</function></funcdef>
  16. <paramdef>ne_session *<parameter>sess</parameter></paramdef>
  17. </funcprototype>
  18. <funcprototype>
  19. <funcdef>const ne_uri *<function>ne_redirect_location</function></funcdef>
  20. <paramdef>ne_session *<parameter>sess</parameter></paramdef>
  21. </funcprototype>
  22. </funcsynopsis>
  23. </refsynopsisdiv>
  24. <refsect1>
  25. <title>Description</title>
  26. <para>The <type>ne_redirect_register</type> function registers
  27. redirect handling for the session. If a valid redirect (with
  28. status code 3xx) response is processed, the request will fail
  29. with the <literal>NE_REDIRECT</literal> error code. The
  30. destination of the redirect can then be retrieved using
  31. <function>ne_redirect_location</function>.</para>
  32. <para>If a redirect was processed, the
  33. <type>ne_redirect_location</type> function returns the
  34. destination URI of the redirect.</para>
  35. </refsect1>
  36. <refsect1>
  37. <title>Return value</title>
  38. <para><function>ne_redirect_location</function> returns
  39. <literal>NULL</literal> if no request has yet been processed,
  40. if the current request was not a redirect, or if the
  41. destination of the redirect could not be parsed or
  42. resolved. Otherwise it returns a pointer to an
  43. <type>ne_uri</type> object, which remains valid until another
  44. request is created for the session.</para>
  45. </refsect1>
  46. <refsect1>
  47. <title>See also</title>
  48. <para><xref linkend="ne_session_create"/>.</para>
  49. </refsect1>
  50. </refentry>