|
Server 0.0.1
HTTP/REST server implementation
|
#include <sys/types.h>#include <openssl/ssl.h>#include "class.h"

Go to the source code of this file.
Data Structures | |
| struct | Stream |
Typedefs | |
| typedef enum e_StreamHandleType | StreamHandleType |
Enumerations | |
| enum | e_StreamHandleType { STREAM_FD = 0, STREAM_SSL } |
Functions | |
| ssize_t | streamRead (Stream, void *, size_t) |
| ssize_t | streamWrite (Stream, void *, size_t) |
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 stream.h.
| typedef enum e_StreamHandleType StreamHandleType |
| enum e_StreamHandleType |
Definition at line 31 of file stream.h.
{
STREAM_FD = 0,
STREAM_SSL
} StreamHandleType;
| ssize_t streamRead | ( | Stream | , |
| void * | , | ||
| size_t | |||
| ) |
Definition at line 29 of file read.c.
{
ssize_t done;
switch(this->type) {
case STREAM_FD:
done = read((this->handle).fd, buf, count);
break;
case STREAM_SSL:
done = SSL_read((this->handle).ssl, buf, count);
break;
default:
break;
}
return done;
}

| ssize_t streamWrite | ( | Stream | , |
| void * | , | ||
| size_t | |||
| ) |
Definition at line 29 of file write.c.
{
ssize_t done;
switch(this->type) {
case STREAM_FD:
done = write((this->handle).fd, buf, count);
break;
case STREAM_SSL:
done = SSL_write((this->handle).ssl, buf, count);
break;
default:
break;
}
return done;
}
