You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
322 lines
34 KiB
322 lines
34 KiB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<title>Server: src/http/worker/process.c Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript">
|
|
$(document).ready(initResizable);
|
|
</script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
|
|
</head>
|
|
<body onload='searchBox.OnSelectItem(0);'>
|
|
<!-- Generated by Doxygen 1.7.3 -->
|
|
<script type="text/javascript"><!--
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
--></script>
|
|
<div id="top">
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td style="padding-left: 0.5em;">
|
|
<div id="projectname">Server <span id="projectnumber">0.0.1</span></div>
|
|
<div id="projectbrief">HTTP/REST server implementation</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div id="navrow1" class="tabs">
|
|
<ul class="tablist">
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
|
<li><a href="annotated.html"><span>Data Structures</span></a></li>
|
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
|
<li id="searchli">
|
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
|
<span class="left">
|
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
alt=""/>
|
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
|
</span><span class="right">
|
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
|
</span>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div id="navrow2" class="tabs2">
|
|
<ul class="tablist">
|
|
<li><a href="files.html"><span>File List</span></a></li>
|
|
<li><a href="globals.html"><span>Globals</span></a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
initNavTree('process_8c.html','');
|
|
</script>
|
|
<div id="doc-content">
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<h1>src/http/worker/process.c</h1> </div>
|
|
</div>
|
|
<div class="contents">
|
|
<a href="process_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
|
|
<a name="l00023"></a>00023 <span class="preprocessor">#include <sys/types.h></span>
|
|
<a name="l00024"></a>00024 <span class="preprocessor">#include <stdio.h></span>
|
|
<a name="l00025"></a>00025 <span class="preprocessor">#include <stdlib.h></span>
|
|
<a name="l00026"></a>00026 <span class="preprocessor">#include <time.h></span>
|
|
<a name="l00027"></a>00027 <span class="preprocessor">#include <string.h></span>
|
|
<a name="l00028"></a>00028 <span class="preprocessor">#include <sys/time.h></span>
|
|
<a name="l00029"></a>00029
|
|
<a name="l00030"></a>00030 <span class="preprocessor">#include "class.h"</span>
|
|
<a name="l00031"></a>00031 <span class="preprocessor">#include "auth.h"</span>
|
|
<a name="l00032"></a>00032
|
|
<a name="l00033"></a>00033 <span class="preprocessor">#include "http/worker.h"</span>
|
|
<a name="l00034"></a>00034 <span class="preprocessor">#include "http/header.h"</span>
|
|
<a name="l00035"></a>00035 <span class="preprocessor">#include "http/message.h"</span>
|
|
<a name="l00036"></a>00036 <span class="preprocessor">#include "http/request.h"</span>
|
|
<a name="l00037"></a>00037 <span class="preprocessor">#include "http/response.h"</span>
|
|
<a name="l00038"></a>00038 <span class="preprocessor">#include "http/message/queue.h"</span>
|
|
<a name="l00039"></a>00039 <span class="preprocessor">#include "http/parser.h"</span>
|
|
<a name="l00040"></a>00040 <span class="preprocessor">#include "session.h"</span>
|
|
<a name="l00041"></a>00041 <span class="preprocessor">#include "stream.h"</span>
|
|
<a name="l00042"></a>00042 <span class="preprocessor">#include "hash.h"</span>
|
|
<a name="l00043"></a>00043
|
|
<a name="l00044"></a>00044 <span class="preprocessor">#include "utils/memory.h"</span>
|
|
<a name="l00045"></a>00045 <span class="preprocessor">#include "hash.h"</span>
|
|
<a name="l00046"></a>00046 <span class="preprocessor">#include "commons.h"</span>
|
|
<a name="l00047"></a>00047
|
|
<a name="l00048"></a>00048
|
|
<a name="l00049"></a>00049 <a class="code" href="structHttpMessage.html">HttpMessage</a> <a class="code" href="get__asset_8c.html#a69ca591563d52afa450af7390568d158">httpWorkerGetAsset</a>(<a class="code" href="structHttpRequest.html">HttpRequest</a>, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">size_t</span>);
|
|
<a name="l00050"></a>00050 <span class="keywordtype">void</span> <a class="code" href="add__common__header_8c.html#add957dad05e83999f82233f85b1ca535">httpWorkerAddCommonHeader</a>(<a class="code" href="structHttpMessage.html">HttpMessage</a>, <a class="code" href="structHttpMessage.html">HttpMessage</a>);
|
|
<a name="l00051"></a>00051
|
|
<a name="l00052"></a>00052
|
|
<a name="l00053"></a>00053 ssize_t
|
|
<a name="l00054"></a><a class="code" href="process_8c.html#a05882322d98d5710a5512c9255e03d71">00054</a> <a class="code" href="process_8c.html#a05882322d98d5710a5512c9255e03d71">httpWorkerProcess</a>(<a class="code" href="structHttpWorker.html">HttpWorker</a> <span class="keyword">this</span>, <a class="code" href="structStream.html">Stream</a> st)
|
|
<a name="l00055"></a>00055 {
|
|
<a name="l00056"></a>00056 ssize_t size;
|
|
<a name="l00057"></a>00057
|
|
<a name="l00058"></a>00058 <span class="keywordflow">if</span> (0 < (size = <a class="code" href="parser_8h.html#a327e735e383c72c2b1da1bfd4734015e">httpParserParse</a>(this->parser, st))) {
|
|
<a name="l00059"></a>00059 <span class="keywordtype">int</span> i;
|
|
<a name="l00060"></a>00060 <a class="code" href="structHttpMessageQueue.html">HttpMessageQueue</a> reqq = this->parser->queue;
|
|
<a name="l00061"></a>00061 <a class="code" href="structHttpMessageQueue.html">HttpMessageQueue</a> respq = this->writer->queue;
|
|
<a name="l00062"></a>00062
|
|
<a name="l00063"></a>00063 <span class="keywordflow">for</span> (i=0; i<reqq-><a class="code" href="structHttpMessageQueue.html#a807ccce02b7709326e8fc613b9cc3763">nmsgs</a>; i++) {
|
|
<a name="l00064"></a>00064 <a class="code" href="structHttpMessage.html">HttpMessage</a> rmessage = reqq-><a class="code" href="structHttpMessageQueue.html#afaff4b536d226f410b3e931e60d702ff">msgs</a>[i];
|
|
<a name="l00065"></a>00065 <a class="code" href="structHttpRequest.html">HttpRequest</a> request = (<a class="code" href="structHttpRequest.html">HttpRequest</a>)(reqq-><a class="code" href="structHttpMessageQueue.html#afaff4b536d226f410b3e931e60d702ff">msgs</a>[i]);
|
|
<a name="l00066"></a>00066 <a class="code" href="structHttpMessage.html">HttpMessage</a> response = NULL;
|
|
<a name="l00067"></a>00067
|
|
<a name="l00073"></a>00073 <span class="keywordflow">if</span> (NULL == this->session) {
|
|
<a name="l00074"></a>00074 <a class="code" href="structHashValue.html">HashValue</a> sidstr = <a class="code" href="hash_2hash_8h.html#ae63f5dffd0f7894f09a5f9b725cb6113">hashGet</a>(request-><a class="code" href="structHttpRequest.html#a409687f7142a45e623e2981c18bb6ff5">cookies</a>, <a class="code" href="memory_8h.html#a2a9234835facec8c1ebca59c214391e3" title="Const STRing Argument.">CSTRA</a>(<span class="stringliteral">"sid"</span>));
|
|
<a name="l00075"></a>00075
|
|
<a name="l00076"></a>00076 <span class="keywordflow">if</span> (NULL != sidstr) {
|
|
<a name="l00077"></a>00077 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> sid;
|
|
<a name="l00078"></a>00078
|
|
<a name="l00079"></a>00079 sid = strtoul((<span class="keywordtype">char</span>*)(sidstr-><a class="code" href="structHashValue.html#ad2620fdeeee5e05b0cb9600c069e081e">value</a>), NULL, 10);
|
|
<a name="l00080"></a>00080 this->session = <a class="code" href="session_8h.html#a129f0576e17b0c9deb744fb3a96b3637">sessionGet</a>(this->sroot, sid);
|
|
<a name="l00081"></a>00081 }
|
|
<a name="l00082"></a>00082 }
|
|
<a name="l00083"></a>00083
|
|
<a name="l00084"></a>00084 <span class="keywordflow">if</span> (NULL != this->session) {
|
|
<a name="l00085"></a>00085 <span class="keywordflow">if</span> (time(NULL) < this->session->livetime) {
|
|
<a name="l00086"></a>00086 this->session->livetime = time(NULL) + <a class="code" href="session_8h.html#ad9da4a25e5fdbb8957a013ad739e032d">SESSION_LIVETIME</a>;
|
|
<a name="l00087"></a>00087 } <span class="keywordflow">else</span> {
|
|
<a name="l00088"></a>00088 <a class="code" href="session_8h.html#ad14f3c6c8402061b01328d6e95975c8e">sessionDelete</a>(this->sroot, this->session->id);
|
|
<a name="l00089"></a>00089 <span class="keyword">delete</span>(this->session);
|
|
<a name="l00090"></a>00090 }
|
|
<a name="l00091"></a>00091 }
|
|
<a name="l00092"></a>00092
|
|
<a name="l00093"></a>00093 <span class="keywordflow">if</span> (0 == strcmp(<span class="stringliteral">"POST"</span>, request-><a class="code" href="structHttpRequest.html#a266c616e67dea85335c9fcfca6e5c0cb">method</a>)) {
|
|
<a name="l00094"></a>00094 <span class="keywordflow">if</span> (0 == strcmp(<span class="stringliteral">"/login/"</span>, request-><a class="code" href="structHttpRequest.html#a926ff822acf2322656d96e70e7b7c97f">path</a>)) {
|
|
<a name="l00095"></a>00095 <span class="keywordtype">char</span> buffer[200];
|
|
<a name="l00096"></a>00096 <span class="keywordtype">size_t</span> nbuf;
|
|
<a name="l00097"></a>00097
|
|
<a name="l00098"></a>00098 <a class="code" href="structHashValue.html">HashValue</a> username = <a class="code" href="hash_2hash_8h.html#ae63f5dffd0f7894f09a5f9b725cb6113">hashGet</a>(request-><a class="code" href="structHttpRequest.html#a4d77c7642fd3ef8bdcd09edfe62927db">post</a>, <a class="code" href="memory_8h.html#a2a9234835facec8c1ebca59c214391e3" title="Const STRing Argument.">CSTRA</a>(<span class="stringliteral">"username"</span>));
|
|
<a name="l00099"></a>00099 <a class="code" href="structHashValue.html">HashValue</a> password = <a class="code" href="hash_2hash_8h.html#ae63f5dffd0f7894f09a5f9b725cb6113">hashGet</a>(request-><a class="code" href="structHttpRequest.html#a4d77c7642fd3ef8bdcd09edfe62927db">post</a>, <a class="code" href="memory_8h.html#a2a9234835facec8c1ebca59c214391e3" title="Const STRing Argument.">CSTRA</a>(<span class="stringliteral">"password"</span>));
|
|
<a name="l00100"></a>00100
|
|
<a name="l00113"></a>00113 <span class="keywordflow">if</span> (NULL == password || NULL == username) {
|
|
<a name="l00114"></a>00114 response = <span class="keyword">new</span>(<a class="code" href="structHttpResponse.html">HttpResponse</a>, <span class="stringliteral">"HTTP/1.1"</span>, 403, <span class="stringliteral">"Forbidden"</span>);
|
|
<a name="l00115"></a>00115 }
|
|
<a name="l00116"></a>00116
|
|
<a name="l00117"></a>00117 <span class="keywordflow">if</span> (NULL == response) {
|
|
<a name="l00118"></a>00118 <a class="code" href="structCredential.html">Credential</a> cred = <span class="keyword">new</span>(<a class="code" href="structCredential.html">Credential</a>,
|
|
<a name="l00119"></a>00119 <a class="code" href="credential_8h.html#ae7b3cf1c6c200a9a07e83688137fd492ad1ac9365f25a3cf968fb38736e7ef8d0">CRED_PASSWORD</a>,
|
|
<a name="l00120"></a>00120 (<span class="keywordtype">char</span>*)(username-><a class="code" href="structHashValue.html#ad2620fdeeee5e05b0cb9600c069e081e">value</a>), username-><a class="code" href="structHashValue.html#aa7080606f7a63a3b8687e32f5492034b">nvalue</a>,
|
|
<a name="l00121"></a>00121 (<span class="keywordtype">char</span>*)(password-><a class="code" href="structHashValue.html#ad2620fdeeee5e05b0cb9600c069e081e">value</a>), password-><a class="code" href="structHashValue.html#aa7080606f7a63a3b8687e32f5492034b">nvalue</a>);
|
|
<a name="l00122"></a>00122
|
|
<a name="l00123"></a>00123 <span class="keywordflow">if</span> (!<a class="code" href="auth_2interface_2auth_8h.html#ab945bc2a04f35ed92362f0c08762a00b">authenticate</a>(this->auth, cred)) {
|
|
<a name="l00124"></a>00124 response = <span class="keyword">new</span>(<a class="code" href="structHttpResponse.html">HttpResponse</a>, <span class="stringliteral">"HTTP/1.1"</span>, 403, <span class="stringliteral">"Forbidden"</span>);
|
|
<a name="l00125"></a>00125 } <span class="keywordflow">else</span> {
|
|
<a name="l00126"></a>00126 <span class="keywordflow">if</span> (NULL == this->session) {
|
|
<a name="l00127"></a>00127 this->session = <a class="code" href="session_8h.html#a1100c55cd86008f7e5931e5e7c517881">sessionAdd</a>(
|
|
<a name="l00128"></a>00128 this->sroot,
|
|
<a name="l00129"></a>00129 <span class="keyword">new</span>(<a class="code" href="structSession.html">Session</a>,
|
|
<a name="l00130"></a>00130 username-><a class="code" href="structHashValue.html#ad2620fdeeee5e05b0cb9600c069e081e">value</a>,
|
|
<a name="l00131"></a>00131 username-><a class="code" href="structHashValue.html#aa7080606f7a63a3b8687e32f5492034b">nvalue</a>));
|
|
<a name="l00132"></a>00132 } <span class="keywordflow">else</span> {
|
|
<a name="l00133"></a>00133 this->session->username = malloc(username-><a class="code" href="structHashValue.html#aa7080606f7a63a3b8687e32f5492034b">nvalue</a> + 1);
|
|
<a name="l00134"></a>00134 this->session->username[username-><a class="code" href="structHashValue.html#aa7080606f7a63a3b8687e32f5492034b">nvalue</a>] = 0;
|
|
<a name="l00135"></a>00135 memcpy(this->session->username,
|
|
<a name="l00136"></a>00136 username-><a class="code" href="structHashValue.html#ad2620fdeeee5e05b0cb9600c069e081e">value</a>,
|
|
<a name="l00137"></a>00137 username-><a class="code" href="structHashValue.html#aa7080606f7a63a3b8687e32f5492034b">nvalue</a>);
|
|
<a name="l00138"></a>00138 }
|
|
<a name="l00139"></a>00139
|
|
<a name="l00140"></a>00140 nbuf = sprintf(buffer,
|
|
<a name="l00141"></a>00141 <span class="stringliteral">"sid=%lu;Path=/"</span>,
|
|
<a name="l00142"></a>00142 this->session->id);
|
|
<a name="l00143"></a>00143
|
|
<a name="l00144"></a>00144 response = (<a class="code" href="structHttpMessage.html">HttpMessage</a>)<a class="code" href="response_8h.html#ab28f3da2d73c756c0640d286c3fd37c5">httpResponseSession</a>(
|
|
<a name="l00145"></a>00145 this->session);
|
|
<a name="l00146"></a>00146
|
|
<a name="l00147"></a>00147 <a class="code" href="hash_2hash_8h.html#a15c5c8fa9517a5dadcdbdd024f3dea88">hashAdd</a>(response-><a class="code" href="structHttpMessage.html#a955ece5fe9f32a91da312c8b9e1f8ab4">header</a>,
|
|
<a name="l00148"></a>00148 <span class="keyword">new</span>(<a class="code" href="structHttpHeader.html">HttpHeader</a>,
|
|
<a name="l00149"></a>00149 <a class="code" href="memory_8h.html#a2a9234835facec8c1ebca59c214391e3" title="Const STRing Argument.">CSTRA</a>(<span class="stringliteral">"Set-Cookie"</span>),
|
|
<a name="l00150"></a>00150 buffer, nbuf));
|
|
<a name="l00151"></a>00151 }
|
|
<a name="l00152"></a>00152 <span class="keyword">delete</span>(cred);
|
|
<a name="l00153"></a>00153 }
|
|
<a name="l00154"></a>00154 }
|
|
<a name="l00155"></a>00155 }
|
|
<a name="l00156"></a>00156
|
|
<a name="l00157"></a>00157 <span class="keywordflow">if</span> (0 == strcmp(<span class="stringliteral">"GET"</span>, request-><a class="code" href="structHttpRequest.html#a266c616e67dea85335c9fcfca6e5c0cb">method</a>)) {
|
|
<a name="l00158"></a>00158
|
|
<a name="l00159"></a>00159 <span class="keywordflow">if</span> (0 == strcmp(<span class="stringliteral">"/"</span>, request-><a class="code" href="structHttpRequest.html#a926ff822acf2322656d96e70e7b7c97f">path</a>)) {
|
|
<a name="l00160"></a>00160 response = <a class="code" href="get__asset_8c.html#a69ca591563d52afa450af7390568d158">httpWorkerGetAsset</a>(
|
|
<a name="l00161"></a>00161 request,
|
|
<a name="l00162"></a>00162 <span class="stringliteral">"./assets/html/main.html"</span>,
|
|
<a name="l00163"></a>00163 <a class="code" href="memory_8h.html#a2a9234835facec8c1ebca59c214391e3" title="Const STRing Argument.">CSTRA</a>(<span class="stringliteral">"text/html"</span>));
|
|
<a name="l00164"></a>00164 }
|
|
<a name="l00165"></a>00165
|
|
<a name="l00166"></a>00166 <span class="keywordflow">if</span> (0 == strcmp(<span class="stringliteral">"/sessinfo/"</span>, request-><a class="code" href="structHttpRequest.html#a926ff822acf2322656d96e70e7b7c97f">path</a>)) {
|
|
<a name="l00167"></a>00167 response = (<a class="code" href="structHttpMessage.html">HttpMessage</a>)<a class="code" href="response_8h.html#ab28f3da2d73c756c0640d286c3fd37c5">httpResponseSession</a>(this->session);
|
|
<a name="l00168"></a>00168 }
|
|
<a name="l00169"></a>00169
|
|
<a name="l00170"></a>00170 <span class="keywordflow">if</span> (0 == strcmp(<span class="stringliteral">"/sess/"</span>, request-><a class="code" href="structHttpRequest.html#a926ff822acf2322656d96e70e7b7c97f">path</a>)) {
|
|
<a name="l00171"></a>00171 <span class="keywordflow">if</span> (NULL == this->session) {
|
|
<a name="l00172"></a>00172 this->session = <a class="code" href="session_8h.html#a1100c55cd86008f7e5931e5e7c517881">sessionAdd</a>(
|
|
<a name="l00173"></a>00173 this->sroot,
|
|
<a name="l00174"></a>00174 <span class="keyword">new</span>(<a class="code" href="structSession.html">Session</a>, NULL, 0));
|
|
<a name="l00175"></a>00175 }
|
|
<a name="l00176"></a>00176 response = (<a class="code" href="structHttpMessage.html">HttpMessage</a>)<a class="code" href="response_8h.html#ab28f3da2d73c756c0640d286c3fd37c5">httpResponseSession</a>(this->session);
|
|
<a name="l00177"></a>00177 }
|
|
<a name="l00178"></a>00178
|
|
<a name="l00179"></a>00179 <span class="keywordflow">if</span> (0 == strcmp(<span class="stringliteral">"/randval/"</span>, request-><a class="code" href="structHttpRequest.html#a926ff822acf2322656d96e70e7b7c97f">path</a>)) {
|
|
<a name="l00180"></a>00180 <span class="keywordflow">if</span> (NULL != this->session) {
|
|
<a name="l00181"></a>00181 response = (<a class="code" href="structHttpMessage.html">HttpMessage</a>)<a class="code" href="response_8h.html#af6ecda2c1f45abc258b7c70767c6b392">httpResponseRandval</a>(
|
|
<a name="l00182"></a>00182 this->val->timestamp,
|
|
<a name="l00183"></a>00183 this->val->value);
|
|
<a name="l00184"></a>00184 } <span class="keywordflow">else</span> {
|
|
<a name="l00185"></a>00185 response = (<a class="code" href="structHttpMessage.html">HttpMessage</a>)<a class="code" href="response_8h.html#a10bdf15320dd802fed606cadf5f3cc2c">httpResponse403</a>();
|
|
<a name="l00186"></a>00186 }
|
|
<a name="l00187"></a>00187 }
|
|
<a name="l00188"></a>00188
|
|
<a name="l00189"></a>00189 <span class="keywordflow">if</span> (0 == strcmp(<span class="stringliteral">"/image/me"</span>, request-><a class="code" href="structHttpRequest.html#a926ff822acf2322656d96e70e7b7c97f">path</a>)) {
|
|
<a name="l00190"></a>00190 response = <a class="code" href="get__asset_8c.html#a69ca591563d52afa450af7390568d158">httpWorkerGetAsset</a>(
|
|
<a name="l00191"></a>00191 request,
|
|
<a name="l00192"></a>00192 <span class="stringliteral">"./assets/image/waldschrat.jpg"</span>,
|
|
<a name="l00193"></a>00193 <a class="code" href="memory_8h.html#a2a9234835facec8c1ebca59c214391e3" title="Const STRing Argument.">CSTRA</a>(<span class="stringliteral">"image/jpeg"</span>));
|
|
<a name="l00194"></a>00194 }
|
|
<a name="l00195"></a>00195
|
|
<a name="l00196"></a>00196 <span class="keywordflow">if</span> (0 == strcmp(<span class="stringliteral">"/assets/js/jquery"</span>, request-><a class="code" href="structHttpRequest.html#a926ff822acf2322656d96e70e7b7c97f">path</a>)) {
|
|
<a name="l00197"></a>00197 response = <a class="code" href="get__asset_8c.html#a69ca591563d52afa450af7390568d158">httpWorkerGetAsset</a>(
|
|
<a name="l00198"></a>00198 request,
|
|
<a name="l00199"></a>00199 <span class="stringliteral">"./assets/js/jquery-1.7.1.min.js"</span>,
|
|
<a name="l00200"></a>00200 <a class="code" href="memory_8h.html#a2a9234835facec8c1ebca59c214391e3" title="Const STRing Argument.">CSTRA</a>(<span class="stringliteral">"text/javascript"</span>));
|
|
<a name="l00201"></a>00201 }
|
|
<a name="l00202"></a>00202
|
|
<a name="l00203"></a>00203 <span class="keywordflow">if</span> (0 == strcmp(<span class="stringliteral">"/assets/js/serverval"</span>, request-><a class="code" href="structHttpRequest.html#a926ff822acf2322656d96e70e7b7c97f">path</a>)) {
|
|
<a name="l00204"></a>00204 response = <a class="code" href="get__asset_8c.html#a69ca591563d52afa450af7390568d158">httpWorkerGetAsset</a>(
|
|
<a name="l00205"></a>00205 request,
|
|
<a name="l00206"></a>00206 <span class="stringliteral">"./assets/js/serverval.js"</span>,
|
|
<a name="l00207"></a>00207 <a class="code" href="memory_8h.html#a2a9234835facec8c1ebca59c214391e3" title="Const STRing Argument.">CSTRA</a>(<span class="stringliteral">"text/javascript"</span>));
|
|
<a name="l00208"></a>00208 }
|
|
<a name="l00209"></a>00209
|
|
<a name="l00210"></a>00210 <span class="keywordflow">if</span> (0 == strcmp(<span class="stringliteral">"/assets/js/session"</span>, request-><a class="code" href="structHttpRequest.html#a926ff822acf2322656d96e70e7b7c97f">path</a>)) {
|
|
<a name="l00211"></a>00211 response = <a class="code" href="get__asset_8c.html#a69ca591563d52afa450af7390568d158">httpWorkerGetAsset</a>(
|
|
<a name="l00212"></a>00212 request,
|
|
<a name="l00213"></a>00213 <span class="stringliteral">"./assets/js/session.js"</span>,
|
|
<a name="l00214"></a>00214 <a class="code" href="memory_8h.html#a2a9234835facec8c1ebca59c214391e3" title="Const STRing Argument.">CSTRA</a>(<span class="stringliteral">"text/javascript"</span>));
|
|
<a name="l00215"></a>00215 }
|
|
<a name="l00216"></a>00216
|
|
<a name="l00217"></a>00217 <span class="keywordflow">if</span> (0 == strcmp(<span class="stringliteral">"/assets/js/init"</span>, request-><a class="code" href="structHttpRequest.html#a926ff822acf2322656d96e70e7b7c97f">path</a>)) {
|
|
<a name="l00218"></a>00218 response = <a class="code" href="get__asset_8c.html#a69ca591563d52afa450af7390568d158">httpWorkerGetAsset</a>(
|
|
<a name="l00219"></a>00219 request,
|
|
<a name="l00220"></a>00220 <span class="stringliteral">"./assets/js/init.js"</span>,
|
|
<a name="l00221"></a>00221 <a class="code" href="memory_8h.html#a2a9234835facec8c1ebca59c214391e3" title="Const STRing Argument.">CSTRA</a>(<span class="stringliteral">"text/javascript"</span>));
|
|
<a name="l00222"></a>00222 }
|
|
<a name="l00223"></a>00223
|
|
<a name="l00224"></a>00224 <span class="keywordflow">if</span> (0 == strcmp(<span class="stringliteral">"/assets/style/common"</span>, request-><a class="code" href="structHttpRequest.html#a926ff822acf2322656d96e70e7b7c97f">path</a>)) {
|
|
<a name="l00225"></a>00225 response = <a class="code" href="get__asset_8c.html#a69ca591563d52afa450af7390568d158">httpWorkerGetAsset</a>(
|
|
<a name="l00226"></a>00226 request,
|
|
<a name="l00227"></a>00227 <span class="stringliteral">"./assets/style/common.css"</span>,
|
|
<a name="l00228"></a>00228 <a class="code" href="memory_8h.html#a2a9234835facec8c1ebca59c214391e3" title="Const STRing Argument.">CSTRA</a>(<span class="stringliteral">"text/css"</span>));
|
|
<a name="l00229"></a>00229 }
|
|
<a name="l00230"></a>00230 }
|
|
<a name="l00231"></a>00231
|
|
<a name="l00232"></a>00232 <span class="keywordflow">if</span> (NULL == response) {
|
|
<a name="l00233"></a>00233 response = (<a class="code" href="structHttpMessage.html">HttpMessage</a>)<a class="code" href="response_8h.html#aeab2dc61e86e010d1eb3511eaf8d8ad0">httpResponse404</a>();
|
|
<a name="l00234"></a>00234 }
|
|
<a name="l00235"></a>00235
|
|
<a name="l00236"></a>00236 <a class="code" href="add__common__header_8c.html#add957dad05e83999f82233f85b1ca535">httpWorkerAddCommonHeader</a>((<a class="code" href="structHttpMessage.html">HttpMessage</a>)request, response);
|
|
<a name="l00237"></a>00237
|
|
<a name="l00238"></a>00238 respq-><a class="code" href="structHttpMessageQueue.html#afaff4b536d226f410b3e931e60d702ff">msgs</a>[(respq-><a class="code" href="structHttpMessageQueue.html#a807ccce02b7709326e8fc613b9cc3763">nmsgs</a>)++] = response;
|
|
<a name="l00239"></a>00239 response = NULL;
|
|
<a name="l00240"></a>00240 <span class="keyword">delete</span>((reqq-><a class="code" href="structHttpMessageQueue.html#afaff4b536d226f410b3e931e60d702ff">msgs</a>)[i]);
|
|
<a name="l00241"></a>00241 }
|
|
<a name="l00242"></a>00242
|
|
<a name="l00243"></a>00243 reqq-><a class="code" href="structHttpMessageQueue.html#a807ccce02b7709326e8fc613b9cc3763">nmsgs</a> = 0;
|
|
<a name="l00244"></a>00244 }
|
|
<a name="l00245"></a>00245
|
|
<a name="l00246"></a>00246 <span class="keywordflow">return</span> size;
|
|
<a name="l00247"></a>00247 }
|
|
<a name="l00248"></a>00248
|
|
<a name="l00249"></a>00249 <span class="comment">// vim: set ts=4 sw=4:</span>
|
|
</pre></div></div>
|
|
</div>
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="process_8c.html">process.c</a> </li>
|
|
<li class="footer">Generated on Wed Mar 28 2012 10:39:43 for Server by 
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </li>
|
|
</ul>
|
|
</div>
|
|
<!--- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Defines</a></div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
|
|
</body>
|
|
</html>
|