migrating.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>Migrating to GoAhead 3</title>
  5. <!-- Copyright Embedthis Software. All Rights Reserved. -->
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7. <meta charset="utf-8" />
  8. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  9. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  10. <meta name="description" content="Simple, fast, secure embedded web server" />
  11. <link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Open+Sans:300italic,400,300,700'
  12. rel='stylesheet' type='text/css'>
  13. <link href='https://fonts.googleapis.com/css?family=Julius+Sans+One' rel='stylesheet' type='text/css'>
  14. <link href="../images/favicon.ico" rel="shortcut icon" />
  15. <link href="../lib/semantic-ui/semantic.min.css" rel="stylesheet" type="text/css" />
  16. <link href="../css/all.min.css" rel="stylesheet" type="text/css" />
  17. <link href="../css/api.min.css" rel="stylesheet" type="text/css" />
  18. </head>
  19. <body class="show-sidebar">
  20. <div class="sidebar">
  21. <div class="ui large left vertical inverted labeled menu">
  22. <div class="item">
  23. <a href="../" class="logo">GoAhead Docs</a>
  24. </div>
  25. <div class="item">
  26. <a href="../">
  27. <b>General</b>
  28. </a>
  29. <div class="menu">
  30. <a class="item" href="../">GoAhead Overview</a>
  31. <a class="item" href="../users/features.html">GoAhead Features</a>
  32. <a class="item" href="https://embedthis.com/goahead/download.html">Download</a>
  33. <a class="item" href="../licensing/">Licensing</a>
  34. </div>
  35. </div>
  36. <div class="item">
  37. <a href="../start/">
  38. <b>Getting Started</b>
  39. </a>
  40. <div class="menu">
  41. <a class="item" href="../start/quick.html">Quick Start</a>
  42. <a class="item" href="../start/installing.html">Installing GoAhead</a>
  43. <a class="item" href="../start/running.html">Running GoAhead</a>
  44. <a class="item" href="../start/releaseNotes.html">Release Notes</a>
  45. <a class="item" href="../start/faq.html">GoAhead FAQ</a>
  46. <a class="item" href="../start/source.html">Building from Source</a>
  47. </div>
  48. </div>
  49. <div class="item">
  50. <a href="../users/"><b>User's Guide</b></a>
  51. <div class="menu">
  52. <a class="item" href="../users/ports.html">Ports and Binding</a>
  53. <a class="item" href="../users/routing.html">Routing Requests</a>
  54. <a class="item" href="../users/handlers.html">Request Handlers</a>
  55. <a class="item" href="../users/js.html">Embedded Javascript</a>
  56. <a class="item" href="../users/jst.html">Javascript Templates</a>
  57. <a class="item" href="../users/goactions.html">GoActions</a>
  58. <a class="item" href="../users/cgi.html">CGI Programs</a>
  59. <a class="item" href="../users/authentication.html">User Authentication</a>
  60. <a class="item" href="../users/logFiles.html">Log Files</a>
  61. <a class="item" href="../users/ssl.html">Secure Sockets (SSL)</a>
  62. <a class="item" href="../users/security.html">Security Considerations</a>
  63. <a class="item" href="../users/man.html">Man Pages</a>
  64. </div>
  65. </div>
  66. <div class="item">
  67. <a href="../developers/">Developer's Guide</a>
  68. <div class="menu">
  69. <a class="item" href="../developers/embedding.html">Embedding GoAhead</a>
  70. <a class="item" href="../developers/handlers.html">Creating GoAhead Handlers</a>
  71. <a class="item" href="../developers/authstore.html">Creating Password Verifiers</a>
  72. <a class="item" href="../developers/migrating.html">Migrating to GoAhead 3</a>
  73. <a class="item" href="../developers/rom.html">Serving Pages from ROM</a>
  74. </div>
  75. </div>
  76. <div class="item">
  77. <a href="../ref/">Reference Guide</a>
  78. <div class="menu">
  79. <a class="item" href="../ref/compatibility.html">Compatibility</a>
  80. <a class="item" href="../ref/native.html">API Library</a>
  81. <a class="item" href="../ref/architecture.html">GoAhead Architecture</a>
  82. <a class="item" href="../standards/http.html">HTTP References</a>
  83. </div>
  84. </div>
  85. <div class="item">
  86. <a href="../developers/project.html">Project Resources</a>
  87. <div class="menu">
  88. <a class="item" href="http://goo.gl/IGbiio">Official GoAhead News</a>
  89. <a class="item" href="https://embedthis.com/goahead/">GoAhead Web Site</a>
  90. <a class="item" href="https://github.com/embedthis/goahead">Source Code Repository</a>
  91. <a class="item" href="https://github.com/embedthis/goahead/issues/99">GoAhead Security Alerts</a>
  92. <a class="item" href="https://github.com/embedthis/goahead/issues">Project Issue Database</a>
  93. <a class="item" href="https://github.com/embedthis/goahead/releases">Change Log</a>
  94. <a class="item" href="https://github.com/embedthis/goahead/milestones">Roadmap</a>
  95. <a class="item" href="https://embedthis.com/developers/contributors.html">Contributors Agreement</a>
  96. </div>
  97. </div>
  98. <div class="item">
  99. <b>Links</b>
  100. <div class="menu">
  101. <a class="item" href="https://embedthis.com/">Embedthis Web Site</a>
  102. <a class="item" href="https://embedthis.com/blog/">Embedthis Blog</a>
  103. <a class="item" href="http://twitter.com/embedthat">Twitter</a>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. <div class="ui inverted masthead">
  109. <div class="ui fixed inverted menu">
  110. <div class="ui sidebar-launch button">
  111. <i class="icon list layout"></i>
  112. </div>
  113. <div class="right menu">
  114. <a class="item" href="https://embedthis.com/">Embedthis</a>
  115. <a class="item" href="https://embedthis.com/goahead/">GoAhead Site</a>
  116. <span class="desktop-only">
  117. <a class="item" href="http://goo.gl/9bL9rM">GoAhead News</a>
  118. <a class="item" href="https://github.com/embedthis/goahead">Repository</a>
  119. <a class="item" href="https://embedthis.com/blog/">Blog</a>
  120. <a class="item" href="https://twitter.com/embedthat">Twitter</a>
  121. </span>
  122. </div>
  123. </div>
  124. <div class="ui breadcrumb">
  125. <a class="section" href="../">Home</a>
  126. <div class="divider">/</div>
  127. <a class="section" href="../developers/">
  128. Developer's Guide
  129. </a>
  130. <div class="divider">/</div>
  131. <a class="active section" href="migrating.html">Migrating to GoAhead 3</a>
  132. </div>
  133. <iframe class="version desktop-only" src="../version.html"></iframe>
  134. </div>
  135. <div class="content">
  136. <h1>Migrating to GoAhead 3</h1>
  137. <p>GoAhead 3 is a major upgrade from GoAhead 2. It incorporates new features and upgrades
  138. to existing capabilities. It also changes many APIs and interfaces.</p>
  139. <a id="compatibility"></a>
  140. <h2 >Compatibility with GoAhead 3</h2>
  141. <p>We make every effort to preserve compatibility, but with GoAhead 3, we needed to make some important
  142. improvements that necessitated breaking compatibility with GoAhead 2. Rather than make several ongoing
  143. compatibility breaks we decided to make all the changes in one release. In this way we can ensure
  144. that GoAhead 3 quickly becomes a stable platform going forward. Please see our <a href=
  145. "../ref/compatibility.html">Compatibility Policy</a>.</p>
  146. <a name="legacy"></a>
  147. <h3>Legacy Support</h3>
  148. <p>To aid migrating existing GoAhead 2.X applications, GoAhead 3.X can be built to support the old
  149. GoAhead 2.X APIs. This is called legacy mode. In this mode, the old APIs are mapped to new APIs via
  150. compiler defines and shim APIs. For full details of the API mappings, see the ME_GOAHEAD_LEGACY
  151. section in src/goahead.h.</p>
  152. <p>GoAhead 3.X is built by default without legacy mode. You can enable legacy mode by configuring via:
  153. <pre class="ui code segment">configure --set goahead.legacy=true</pre>
  154. or if building via make:
  155. <pre class="ui code segment">make ME_GOAHEAD_LEGACY=1</pre>
  156. <p>This will enable the legacy APIs and type names. However, You are <span class="warn">strongly
  157. encouraged to fully migrate your application to the GoAhead 3.X APIs</span>
  158. and to transition off the old GoAhead 2.X APIs. Note: GoAhead 2 is now officially "end-of-life".</p>
  159. <a id="changes"></a>
  160. <h2 >Changes in GoAhead 3</h2>
  161. <p>GoAhead 3 provides equivalent or greater functionality to that in GoAhead 2.
  162. While GoAhead 3 may have a different interface or API, the capabilities of GoAhead 2 have been continued
  163. in GoAhead 3, and in many cases, the features have been enhanced.</p>
  164. <h3>New Capabilities</h3>
  165. <p>The following new capabilities have been added to GoAhead 3 for which there is no equivalent in GoAhead 2.
  166. These additions should not require adjustment for applications developed under GoAhead 2.</p>
  167. <ul>
  168. <li>HTTP 1.1 chunking</li>
  169. <li>IPv6</li>
  170. <li>PUT, DELETE, OPTIONS and TRACE HTTP methods</li>
  171. <li>Request routing</li>
  172. <li>New web form-based authentication</li>
  173. <li>Session state storage</li>
  174. <li>New User/Role/Ability authorization framework</li>
  175. <li>Extended security sandbox limits</li>
  176. <li>Flexible request tracing and logging</li>
  177. </ul>
  178. <h3>Changed Capabilities</h3>
  179. <p>The following capabilities have been changed and may impact your GoAhead 3 applications.</p>
  180. <ul>
  181. <li>The GoAhead 2.X User Management authentication has been upgrade to the User/Role/Ability framework</li>
  182. <li>The EMF database has been removed. The new authentication framework does not utilize it.</li>
  183. <li>The GoForm facility has been upgrade to the GoAction handler. The calling sequence for GoForms has
  184. been modified and simplified.</li>
  185. <li>POST request form data is only stored in the query field of the Webs structure if
  186. <a href="#legacy">Legacy</a> mode is enabled. Without legacy mode, query data and
  187. form body data are stored separately. Form data is stored in the 'input' field of the Webs structure.
  188. Code that accesses wp-&gt;query for GoForms will need to be modified.
  189. In legacy mode, the input is also copied to the wp-&gt;query field.
  190. </li>
  191. <li>Request parameter variables are only created for POST requests if the request Content-Type is set to
  192. application/x-www-form-urlencoded.</li>
  193. <li>The build system is upgraded and simplified. It now uses the MakeMe build system.
  194. New configure options and cross compiling capabilities have been added.</li>
  195. <li>In GoAhead 2, the websHeader routine was used to write a fixes set of HTTP response headers. This was
  196. inflexible and did not permit easy custom modification of headers. GoAhead 3 supports user-definable
  197. response headers via the new API
  198. <a href="../ref/api/goahead.html#group___webs_1ga506c041a3eb2dfeaab1e9d1f322eea0b">websWriteHeader</a>. Consequently,
  199. the websHeader and websFooter APIs are removed.</li>
  200. </ul>
  201. <h3>Changed APIs</h3>
  202. <p>The internal APIs in GoAhead 3 have been upgraded. Some have been renamed and others modified.
  203. GoAhead 3 APIs have been renamed/converted on a function by function
  204. basis to equivalent APIs in GoAhead 2. Often, the APIs have very similar names to the previous counterpart.</p>
  205. <p>Here is a partial list of changed APIs in GoAhead 3.X:
  206. <ul>
  207. <li>balloc memory allocation routines renamed to walloc</li>
  208. <li>g*() string routines mapped back to standard C library and Posix routines</li>
  209. <li>hAlloc*() handle allocation routines mapped to wallocHandle</li>
  210. <li>ASP renamed to JSP and websAsp* renamed to websJst*</li>
  211. <li>GoForms renamed to Actions, /goforms renamed to /action</li>
  212. <li>ringq*() renamed to buf*</li>
  213. <li>sym*() renamed to hash*</li>
  214. </ul>
  215. <p>For a complete list, see the ME_GOAHEAD_LEGACY section at the end of goahead.h for a list of all the API name
  216. mappings. It is strongly recommended that you refactor your application to use the new API naming.</p>
  217. <h3>Routes</h3>
  218. <p>GoAhead 3 uses a flexible URI routing mechanism to direct client requests to the appropriate handler.
  219. In GoAhead 2, this was done by hard-coded handlers. The routing framework is controlled by the route.txt
  220. configuration file.
  221. The routing framework has more flexibility and allows URI parsing and routing.
  222. <p>See <a href="../users/routing.html">Request Routing</a> for more details.</p>
  223. </div>
  224. <div class="terms ui basic center aligned segment">
  225. <p>&copy; Embedthis Software, 2003-2015. All rights reserved.</p>
  226. </div>
  227. <script src="../lib/jquery/jquery.min.js"></script>
  228. <script src="../lib/semantic-ui/semantic.min.js"></script>
  229. <script src="../scripts/sidebar.min.js"></script>
  230. </body>
  231. </html>