123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>Migrating to GoAhead 3</title>
- <!-- Copyright Embedthis Software. All Rights Reserved. -->
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta charset="utf-8" />
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
- <meta name="description" content="Simple, fast, secure embedded web server" />
- <link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Open+Sans:300italic,400,300,700'
- rel='stylesheet' type='text/css'>
- <link href='https://fonts.googleapis.com/css?family=Julius+Sans+One' rel='stylesheet' type='text/css'>
-
- <link href="../images/favicon.ico" rel="shortcut icon" />
- <link href="../lib/semantic-ui/semantic.min.css" rel="stylesheet" type="text/css" />
- <link href="../css/all.min.css" rel="stylesheet" type="text/css" />
- <link href="../css/api.min.css" rel="stylesheet" type="text/css" />
-
- </head>
- <body class="show-sidebar">
- <div class="sidebar">
- <div class="ui large left vertical inverted labeled menu">
- <div class="item">
- <a href="../" class="logo">GoAhead Docs</a>
- </div>
- <div class="item">
- <a href="../">
- <b>General</b>
- </a>
- <div class="menu">
- <a class="item" href="../">GoAhead Overview</a>
- <a class="item" href="../users/features.html">GoAhead Features</a>
- <a class="item" href="https://embedthis.com/goahead/download.html">Download</a>
- <a class="item" href="../licensing/">Licensing</a>
- </div>
- </div>
- <div class="item">
- <a href="../start/">
- <b>Getting Started</b>
- </a>
- <div class="menu">
- <a class="item" href="../start/quick.html">Quick Start</a>
- <a class="item" href="../start/installing.html">Installing GoAhead</a>
- <a class="item" href="../start/running.html">Running GoAhead</a>
- <a class="item" href="../start/releaseNotes.html">Release Notes</a>
- <a class="item" href="../start/faq.html">GoAhead FAQ</a>
- <a class="item" href="../start/source.html">Building from Source</a>
- </div>
- </div>
- <div class="item">
- <a href="../users/"><b>User's Guide</b></a>
- <div class="menu">
- <a class="item" href="../users/ports.html">Ports and Binding</a>
- <a class="item" href="../users/routing.html">Routing Requests</a>
- <a class="item" href="../users/handlers.html">Request Handlers</a>
- <a class="item" href="../users/js.html">Embedded Javascript</a>
- <a class="item" href="../users/jst.html">Javascript Templates</a>
- <a class="item" href="../users/goactions.html">GoActions</a>
- <a class="item" href="../users/cgi.html">CGI Programs</a>
- <a class="item" href="../users/authentication.html">User Authentication</a>
- <a class="item" href="../users/logFiles.html">Log Files</a>
- <a class="item" href="../users/ssl.html">Secure Sockets (SSL)</a>
- <a class="item" href="../users/security.html">Security Considerations</a>
- <a class="item" href="../users/man.html">Man Pages</a>
- </div>
- </div>
- <div class="item">
- <a href="../developers/">Developer's Guide</a>
- <div class="menu">
- <a class="item" href="../developers/embedding.html">Embedding GoAhead</a>
- <a class="item" href="../developers/handlers.html">Creating GoAhead Handlers</a>
- <a class="item" href="../developers/authstore.html">Creating Password Verifiers</a>
- <a class="item" href="../developers/migrating.html">Migrating to GoAhead 3</a>
- <a class="item" href="../developers/rom.html">Serving Pages from ROM</a>
- </div>
- </div>
- <div class="item">
- <a href="../ref/">Reference Guide</a>
- <div class="menu">
- <a class="item" href="../ref/compatibility.html">Compatibility</a>
- <a class="item" href="../ref/native.html">API Library</a>
- <a class="item" href="../ref/architecture.html">GoAhead Architecture</a>
- <a class="item" href="../standards/http.html">HTTP References</a>
- </div>
- </div>
- <div class="item">
- <a href="../developers/project.html">Project Resources</a>
- <div class="menu">
- <a class="item" href="http://goo.gl/IGbiio">Official GoAhead News</a>
- <a class="item" href="https://embedthis.com/goahead/">GoAhead Web Site</a>
- <a class="item" href="https://github.com/embedthis/goahead">Source Code Repository</a>
- <a class="item" href="https://github.com/embedthis/goahead/issues/99">GoAhead Security Alerts</a>
- <a class="item" href="https://github.com/embedthis/goahead/issues">Project Issue Database</a>
- <a class="item" href="https://github.com/embedthis/goahead/releases">Change Log</a>
- <a class="item" href="https://github.com/embedthis/goahead/milestones">Roadmap</a>
- <a class="item" href="https://embedthis.com/developers/contributors.html">Contributors Agreement</a>
- </div>
- </div>
- <div class="item">
- <b>Links</b>
- <div class="menu">
- <a class="item" href="https://embedthis.com/">Embedthis Web Site</a>
- <a class="item" href="https://embedthis.com/blog/">Embedthis Blog</a>
- <a class="item" href="http://twitter.com/embedthat">Twitter</a>
- </div>
- </div>
- </div>
- </div>
- <div class="ui inverted masthead">
- <div class="ui fixed inverted menu">
- <div class="ui sidebar-launch button">
- <i class="icon list layout"></i>
- </div>
- <div class="right menu">
- <a class="item" href="https://embedthis.com/">Embedthis</a>
- <a class="item" href="https://embedthis.com/goahead/">GoAhead Site</a>
- <span class="desktop-only">
- <a class="item" href="http://goo.gl/9bL9rM">GoAhead News</a>
- <a class="item" href="https://github.com/embedthis/goahead">Repository</a>
- <a class="item" href="https://embedthis.com/blog/">Blog</a>
- <a class="item" href="https://twitter.com/embedthat">Twitter</a>
- </span>
- </div>
- </div>
-
- <div class="ui breadcrumb">
- <a class="section" href="../">Home</a>
-
- <div class="divider">/</div>
- <a class="section" href="../developers/">
- Developer's Guide
- </a>
-
-
- <div class="divider">/</div>
- <a class="active section" href="migrating.html">Migrating to GoAhead 3</a>
-
- </div>
-
- <iframe class="version desktop-only" src="../version.html"></iframe>
- </div>
- <div class="content">
- <h1>Migrating to GoAhead 3</h1>
- <p>GoAhead 3 is a major upgrade from GoAhead 2. It incorporates new features and upgrades
- to existing capabilities. It also changes many APIs and interfaces.</p>
-
- <a id="compatibility"></a>
- <h2 >Compatibility with GoAhead 3</h2>
- <p>We make every effort to preserve compatibility, but with GoAhead 3, we needed to make some important
- improvements that necessitated breaking compatibility with GoAhead 2. Rather than make several ongoing
- compatibility breaks we decided to make all the changes in one release. In this way we can ensure
- that GoAhead 3 quickly becomes a stable platform going forward. Please see our <a href=
- "../ref/compatibility.html">Compatibility Policy</a>.</p>
- <a name="legacy"></a>
- <h3>Legacy Support</h3>
- <p>To aid migrating existing GoAhead 2.X applications, GoAhead 3.X can be built to support the old
- GoAhead 2.X APIs. This is called legacy mode. In this mode, the old APIs are mapped to new APIs via
- compiler defines and shim APIs. For full details of the API mappings, see the ME_GOAHEAD_LEGACY
- section in src/goahead.h.</p>
- <p>GoAhead 3.X is built by default without legacy mode. You can enable legacy mode by configuring via:
- <pre class="ui code segment">configure --set goahead.legacy=true</pre>
- or if building via make:
- <pre class="ui code segment">make ME_GOAHEAD_LEGACY=1</pre>
- <p>This will enable the legacy APIs and type names. However, You are <span class="warn">strongly
- encouraged to fully migrate your application to the GoAhead 3.X APIs</span>
- and to transition off the old GoAhead 2.X APIs. Note: GoAhead 2 is now officially "end-of-life".</p>
-
- <a id="changes"></a>
- <h2 >Changes in GoAhead 3</h2>
- <p>GoAhead 3 provides equivalent or greater functionality to that in GoAhead 2.
- While GoAhead 3 may have a different interface or API, the capabilities of GoAhead 2 have been continued
- in GoAhead 3, and in many cases, the features have been enhanced.</p>
- <h3>New Capabilities</h3>
- <p>The following new capabilities have been added to GoAhead 3 for which there is no equivalent in GoAhead 2.
- These additions should not require adjustment for applications developed under GoAhead 2.</p>
- <ul>
- <li>HTTP 1.1 chunking</li>
- <li>IPv6</li>
- <li>PUT, DELETE, OPTIONS and TRACE HTTP methods</li>
- <li>Request routing</li>
- <li>New web form-based authentication</li>
- <li>Session state storage</li>
- <li>New User/Role/Ability authorization framework</li>
- <li>Extended security sandbox limits</li>
- <li>Flexible request tracing and logging</li>
- </ul>
- <h3>Changed Capabilities</h3>
- <p>The following capabilities have been changed and may impact your GoAhead 3 applications.</p>
- <ul>
- <li>The GoAhead 2.X User Management authentication has been upgrade to the User/Role/Ability framework</li>
- <li>The EMF database has been removed. The new authentication framework does not utilize it.</li>
- <li>The GoForm facility has been upgrade to the GoAction handler. The calling sequence for GoForms has
- been modified and simplified.</li>
- <li>POST request form data is only stored in the query field of the Webs structure if
- <a href="#legacy">Legacy</a> mode is enabled. Without legacy mode, query data and
- form body data are stored separately. Form data is stored in the 'input' field of the Webs structure.
- Code that accesses wp->query for GoForms will need to be modified.
- In legacy mode, the input is also copied to the wp->query field.
- </li>
- <li>Request parameter variables are only created for POST requests if the request Content-Type is set to
- application/x-www-form-urlencoded.</li>
- <li>The build system is upgraded and simplified. It now uses the MakeMe build system.
- New configure options and cross compiling capabilities have been added.</li>
- <li>In GoAhead 2, the websHeader routine was used to write a fixes set of HTTP response headers. This was
- inflexible and did not permit easy custom modification of headers. GoAhead 3 supports user-definable
- response headers via the new API
- <a href="../ref/api/goahead.html#group___webs_1ga506c041a3eb2dfeaab1e9d1f322eea0b">websWriteHeader</a>. Consequently,
- the websHeader and websFooter APIs are removed.</li>
- </ul>
- <h3>Changed APIs</h3>
- <p>The internal APIs in GoAhead 3 have been upgraded. Some have been renamed and others modified.
- GoAhead 3 APIs have been renamed/converted on a function by function
- basis to equivalent APIs in GoAhead 2. Often, the APIs have very similar names to the previous counterpart.</p>
- <p>Here is a partial list of changed APIs in GoAhead 3.X:
- <ul>
- <li>balloc memory allocation routines renamed to walloc</li>
- <li>g*() string routines mapped back to standard C library and Posix routines</li>
- <li>hAlloc*() handle allocation routines mapped to wallocHandle</li>
- <li>ASP renamed to JSP and websAsp* renamed to websJst*</li>
- <li>GoForms renamed to Actions, /goforms renamed to /action</li>
- <li>ringq*() renamed to buf*</li>
- <li>sym*() renamed to hash*</li>
- </ul>
- <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
- mappings. It is strongly recommended that you refactor your application to use the new API naming.</p>
- <h3>Routes</h3>
- <p>GoAhead 3 uses a flexible URI routing mechanism to direct client requests to the appropriate handler.
- In GoAhead 2, this was done by hard-coded handlers. The routing framework is controlled by the route.txt
- configuration file.
- The routing framework has more flexibility and allows URI parsing and routing.
- <p>See <a href="../users/routing.html">Request Routing</a> for more details.</p>
- </div>
- <div class="terms ui basic center aligned segment">
- <p>© Embedthis Software, 2003-2015. All rights reserved.</p>
- </div>
- <script src="../lib/jquery/jquery.min.js"></script>
- <script src="../lib/semantic-ui/semantic.min.js"></script>
- <script src="../scripts/sidebar.min.js"></script>
-
-
- </body>
- </html>
|