This file is indexed.

/usr/share/doc/libapache2-mod-perl2-doc/docs/2.0/devel/porting/porting.html is in libapache2-mod-perl2-doc 2.0.8+httpd24-r1449661-6ubuntu2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>

<body style="background-color: white">



<ul id="index">
  <li><a href="#NAME">NAME</a></li>
  <li><a href="#Description">Description</a></li>
  <li><a href="#Porting-Makefile.PL">Porting Makefile.PL</a></li>
  <li><a href="#Porting-XS-Code">Porting XS Code</a></li>
  <li><a href="#Thread-Safety">Thread Safety</a></li>
  <li><a href="#PerlIO">PerlIO</a></li>
  <li><a href="#make-test-Suite">&#39;make test&#39; Suite</a></li>
  <li><a href="#Apache-C-Code-Specific-Notes">Apache C Code Specific Notes</a>
    <ul>
      <li><a href="#ap_soft_timeout-ap_reset_timeout-ap_hard_timeout-and-ap_kill_timeout">ap_soft_timeout(), ap_reset_timeout(), ap_hard_timeout() and ap_kill_timeout()</a></li>
    </ul>
  </li>
  <li><a href="#Maintainers">Maintainers</a></li>
  <li><a href="#Authors">Authors</a></li>
</ul>

<h1 id="NAME">NAME</h1>

<p>Porting Apache:: XS Modules from mod_perl 1.0 to 2.0</p>

<h1 id="Description">Description</h1>

<p>This document talks mainly about porting modules using XS code. It&#39;s also helpful to those who start developing mod_perl 2.0 packages.</p>

<p>Also make sure to first read about <a>porting Apache:: Perl modules</a>.</p>

<h1 id="Porting-Makefile.PL">Porting Makefile.PL</h1>

<p>It&#39;s only an issue if it was using <code>Apache::src</code>. A new configuration system is in works. So watch this space for updates on this issue.</p>

<p>ModPerl::MM is the new replacement of Apache::src.</p>

<h1 id="Porting-XS-Code">Porting XS Code</h1>

<p>If your module&#39;s XS code relies on the Apache and mod_perl C APIs, it&#39;s very likely that you will have to adjust the XS code to the Apache 2.0 and mod_perl 2.0 C API.</p>

<p>The C API has changed a lot, so chances are that you are much better off not to mix the two APIs in the same XS file. However if you do want to mix the two you will have to use something like the following:</p>

<pre><code>  #include ap_mmn.h
  /* ... */
  #if AP_MODULE_MAGIC_AT_LEAST(20020903,4)
      /* 2.0 code */
  #else
      /* 1.0 code */
  #endif</code></pre>

<p>The <code>20020903,4</code> is the value of the magic version number matching Apache 2.0.47, the earliest Apache version supported by mod_perl 2.0.</p>

<h1 id="Thread-Safety">Thread Safety</h1>

<p>META: to be written</p>

<pre><code>  #ifdef MP_THREADED
      /* threads specific code goes here */
  #endif</code></pre>

<p>For now see: http://httpd.apache.org/docs-2.0/developer/thread_safety.html</p>

<h1 id="PerlIO">PerlIO</h1>

<p>PerlIO layer has become usable only in perl 5.8.0, so if you plan on working with PerlIO, you can use the <code>PERLIO_LAYERS</code> constant. e.g.:</p>

<pre><code>  #ifdef PERLIO_LAYERS
  #include &quot;perliol.h&quot;
  #else
  #include &quot;iperlsys.h&quot;
  #endif</code></pre>

<h1 id="make-test-Suite">&#39;make test&#39; Suite</h1>

<p>The <code>Apache::Test</code> testing framework that comes together with mod_perl 2.0 works with 1.0 and 2.0 mod_perl versions. Therefore you should consider porting your test suite to use <a>the Apache::Test Framework</a>.</p>

<h1 id="Apache-C-Code-Specific-Notes">Apache C Code Specific Notes</h1>

<p>Most of the documentation covering migration to Apache 2.0 can be found at: http://httpd.apache.org/docs-2.0/developer/</p>

<p>The Apache 2.0 API documentation now resides in the C header files, which can be conveniently browsed via http://docx.webperf.org/.</p>

<p>The APR API documentation can be found here http://apr.apache.org/.</p>

<p>The new Apache and APR APIs include many new functions. Though certain functions have been preserved, either as is or with a changed prototype (for example to work with pools), others have been renamed. So if you are porting your code and the function that you&#39;ve used doesn&#39;t seem to exist in Apache 2.0, first refer to the &quot;compat&quot; header files, such as: <i>include/ap_compat.h</i>, <i>srclib/apr/include/apr_compat.h</i>, and <i>srclib/apr-util/include/apu_compat.h</i>, which list functions whose names have changed but which are otherwise the same. If this fails, proceed to look in other headers files in the following directories:</p>

<ul>

<li><p><i>ap_</i> functions in <i>include/</i></p>

</li>
<li><p><i>apr_</i> functions in <i>srclib/apr/include/</i> and <i>srclib/apr-util/include/</i></p>

</li>
</ul>

<h2 id="ap_soft_timeout-ap_reset_timeout-ap_hard_timeout-and-ap_kill_timeout">ap_soft_timeout(), ap_reset_timeout(), ap_hard_timeout() and ap_kill_timeout()</h2>

<p>If the C part of the module in 1.0 includes <code>ap_soft_timeout()</code>, <code>ap_reset_timeout()</code>, <code>ap_hard_timeout()</code> and <code>ap_kill_timeout()</code> functions simply remove these in 2.0. There is no replacement for these functions because Apache 2.0 uses non-blocking I/O. As a side-effect of this change, Apache 2.0 no longer uses <code>SIGALRM</code>, which has caused conflicts in mod_perl 1.0.</p>

<h1 id="Maintainers">Maintainers</h1>

<p>Maintainer is the person(s) you should contact with updates, corrections and patches.</p>

<p>Stas Bekman [http://stason.org/]</p>

<h1 id="Authors">Authors</h1>

<ul>

<li><p>Stas Bekman [http://stason.org/]</p>

</li>
<li><p>Doug MacEachern &lt;dougm (at) covalent.net&gt;</p>

</li>
</ul>

<p>Only the major authors are listed above. For contributors see the Changes file.</p>


</body>

</html>