Server 0.0.1
HTTP/REST server implementation

src/http/worker/get_asset.c File Reference

#include <sys/types.h>
#include "http/header.h"
#include "http/message.h"
#include "http/request.h"
#include "http/response.h"
#include "utils/memory.h"
#include "hash.h"
Include dependency graph for get_asset.c:

Go to the source code of this file.

Functions

HttpMessage httpWorkerGetAsset (HttpRequest request, const char *fname, const char *mime, size_t nmime)

Detailed Description

Author:
Georg Hopp

Copyright © 2012 Georg Hopp

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Definition in file get_asset.c.


Function Documentation

HttpMessage httpWorkerGetAsset ( HttpRequest  request,
const char *  fname,
const char *  mime,
size_t  nmime 
)

Definition at line 34 of file get_asset.c.

{
        char *     match;
        size_t     nmatch;
        HttpHeader header;

        header = hashGet(
                        ((HttpMessage)request)->header,
                        CSTRA("If-None-Match"));

        if (NULL == header) {
                match  = "";
                nmatch = 0;
        }
        else {
                match  = (header->value)[0];
                nmatch = (header->nvalue)[0];
        }

        return (HttpMessage)httpResponseAsset(
                        fname, mime, nmime, match, nmatch);
}

Here is the call graph for this function:

Here is the caller graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines