mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Implemented send_with_timeout()
This commit is contained in:
parent
f66397adef
commit
21dc563c57
2
Makefile
2
Makefile
@ -216,7 +216,7 @@ install: $(EXECS)
|
|||||||
ifeq ($(OSTYPE),darwin)
|
ifeq ($(OSTYPE),darwin)
|
||||||
@$(INSTALL) -v -m 0644 elogd.plist /Library/LaunchDaemons/ch.psi.elogd.plist
|
@$(INSTALL) -v -m 0644 elogd.plist /Library/LaunchDaemons/ch.psi.elogd.plist
|
||||||
@echo The elogd service can now be started with
|
@echo The elogd service can now be started with
|
||||||
@echo " launchctl load /Library/LaunchDaemons/ch.psi.elogd.plist"
|
@echo " sudo launchctl load /Library/LaunchDaemons/ch.psi.elogd.plist"
|
||||||
else
|
else
|
||||||
@sed "s#\@PREFIX\@#$(PREFIX)#g" elogd.init_template > elogd.init
|
@sed "s#\@PREFIX\@#$(PREFIX)#g" elogd.init_template > elogd.init
|
||||||
@mkdir -p -m 0755 $(RCDIR)
|
@mkdir -p -m 0755 $(RCDIR)
|
||||||
|
|||||||
@ -1,26 +1,16 @@
|
|||||||
Checklist for new ELOG version
|
Checklist for new ELOG version
|
||||||
==============================
|
==============================
|
||||||
|
|
||||||
On RS32:
|
On Mac (MPC1865):
|
||||||
|
|
||||||
- Put all new options in doc/config.html
|
- Put all new options in doc/config.html
|
||||||
- Increase version in elog-version.h
|
- Increase version in elog-version.h
|
||||||
- Do the same in doc/index.html and index_nd.html
|
- Do the same in doc/index.html and index_nd.html
|
||||||
- Modify ChangeLog
|
- Modify ChangeLog
|
||||||
- Add release date to ChangeLog
|
- Add release date to ChangeLog
|
||||||
|
|
||||||
On VPC6562-1:
|
|
||||||
|
|
||||||
- "svn update"
|
|
||||||
- "make loc"
|
- "make loc"
|
||||||
- Translate new strings in eloglang.german
|
- Translate new strings in eloglang.german
|
||||||
- "make indent"
|
- "git commit -a -m "Release x.x.x-y"
|
||||||
- svn -m "Run indent" commit
|
|
||||||
|
|
||||||
On RS32:
|
|
||||||
|
|
||||||
- "svn update"
|
|
||||||
- c:\elog> svn ci -m "Release x.x.x-y"
|
|
||||||
|
|
||||||
On VPC6562-1:
|
On VPC6562-1:
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,15 @@
|
|||||||
|
Version 3.0.0, released December 23th, 2014
|
||||||
|
===========================================
|
||||||
|
|
||||||
|
- Replaced insecure SSLv23 with TLSv1 method
|
||||||
|
- Switched from SVN to GIT versioning
|
||||||
|
- Implemented service under Mac OSC via launchd
|
||||||
|
- Added LDAP support for authentication
|
||||||
|
- Don’t overwrite certificated, themes and init scrip during ‘make install’
|
||||||
|
- Create one logbook subdirectory pear year
|
||||||
|
- Switched to CKEditor with Drag & Drop Upload (courtesy of Dario Milicic)
|
||||||
|
|
||||||
|
|
||||||
Version 2.9.2, released April 27th 2012
|
Version 2.9.2, released April 27th 2012
|
||||||
=======================================
|
=======================================
|
||||||
|
|
||||||
|
|||||||
@ -38,10 +38,7 @@
|
|||||||
<div class=Sub><i>How to set up and run your very own ELOG server</i></div>
|
<div class=Sub><i>How to set up and run your very own ELOG server</i></div>
|
||||||
|
|
||||||
<hr><a name="unix">
|
<hr><a name="unix">
|
||||||
<div class=section> Installing and running on UNIX </div>
|
<div class=section> Installing and running on Linux </div>
|
||||||
<p>
|
|
||||||
<b>ELOG</b> is being developed and tested under Linux, and is being used on (Sparc) Solaris
|
|
||||||
workstations. It should also compile and run on other UNIX flavours.
|
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
<h3><hr><i>Installation from the RPM file</i>:</h3>
|
<h3><hr><i>Installation from the RPM file</i>:</h3>
|
||||||
@ -162,6 +159,37 @@ described <a href="#config">below</a>.
|
|||||||
|
|
||||||
<div class=section> Notes for various platforms </div>
|
<div class=section> Notes for various platforms </div>
|
||||||
<p>
|
<p>
|
||||||
|
<h3><i>Mac OS X</i>:</h3>
|
||||||
|
<p>
|
||||||
|
Under Mac OSX, <b>ELOG</b> must be compiled from the source code. The OSX command line tools (compiler & Co)
|
||||||
|
must be available, which can be done thought he free Xcode package which can be obtained though the App Store.
|
||||||
|
Once Xcode is installed, you can do a <code>xcode-select --install</code> to install the command line tools.
|
||||||
|
After that, a simple <code>make</code> in in the elog directory does the job of compiling ELOG.
|
||||||
|
If SSL support is needed (access via https://...), you have to install OpenSSL and turn on SSL support in the
|
||||||
|
Makefile by setting <code>USE_SSL = 1</code>. You can install OpenSSL for example through the
|
||||||
|
<a href="https://www.macports.org">MacPorts</a> project. After having installed MacPorts, you do a
|
||||||
|
<code>sudo port install openssl</code>.<p>
|
||||||
|
|
||||||
|
After successful compilation, you do a <code>sudo make install</code> to install all required files under
|
||||||
|
the installation directory, which is by default <code>/usr/local/</code>. A subdirectory <code>/usr/local/elog</code>
|
||||||
|
is created which contains a simple example logbook. The ELOG server can now be started either manually with
|
||||||
|
<p>
|
||||||
|
<code>/usr/local/sbin/elogd</code>
|
||||||
|
<p>
|
||||||
|
or through the daemon servics with
|
||||||
|
<p>
|
||||||
|
<code>sudo launchctl load /Library/LaunchDaemons/ch.psi.elogd.plist</code>
|
||||||
|
<p>
|
||||||
|
To stop the service, use
|
||||||
|
<p>
|
||||||
|
<code>sudo launchctl unload /Library/LaunchDaemons/ch.psi.elogd.plist</code>
|
||||||
|
<p>
|
||||||
|
<hr>
|
||||||
|
<h3><i>Debian</i>:</h3>
|
||||||
|
<p>
|
||||||
|
A Debian package is available under <a href="https://tracker.debian.org/pkg/elog">https://tracker.debian.org/pkg/elog</a>.
|
||||||
|
|
||||||
|
<hr>
|
||||||
<h3><i>Solaris</i>:</h3>
|
<h3><i>Solaris</i>:</h3>
|
||||||
|
|
||||||
<p><a href="mailto:huber@secaron.de">Martin Huber</a> reports that
|
<p><a href="mailto:huber@secaron.de">Martin Huber</a> reports that
|
||||||
@ -174,15 +202,6 @@ been problems with <b>ELOG</b>'s <I>keep-alive</I> feature. In such a case you n
|
|||||||
the "<B>-k</B>" flag to the <code><b>elogd</b></code> command line to turn keep-alives off.
|
the "<B>-k</B>" flag to the <code><b>elogd</b></code> command line to turn keep-alives off.
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
<h3><hr><i>Mac OS X</i>:</h3>
|
|
||||||
|
|
||||||
<p><a href="mailto:sak@essc.psu.edu">Sridhar Anandakrishnan</a> and
|
|
||||||
<a href="mailto:roktas@emu.edu.tr">Recai Oktas</a> report that under Mac OS X there is a problem with
|
|
||||||
the default stack size. The command <i><b>limit stacksize unlimited</b></i> (for tcsh) or
|
|
||||||
<i><b>ulimit -s unlimited</b></i> (for bash) increases the stacksize and fixes this problem.
|
|
||||||
Read the according <a href="http://midas.psi.ch/elogs/Forum/379">thread</a> in the forum.
|
|
||||||
<p>
|
|
||||||
|
|
||||||
<h3><hr><i>FreeBSD</i>:</h3>
|
<h3><hr><i>FreeBSD</i>:</h3>
|
||||||
|
|
||||||
<p><a href="mailto:ottodavid@gmx.net">David Otto</a> maintains the
|
<p><a href="mailto:ottodavid@gmx.net">David Otto</a> maintains the
|
||||||
|
|||||||
@ -46,6 +46,11 @@
|
|||||||
body {
|
body {
|
||||||
font-family: Verdana,Arial,Helvetica,Sans-Serif;
|
font-family: Verdana,Arial,Helvetica,Sans-Serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
font-family: Courier,Fixed,monospace;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
[<a class="nav" href="#links">Links</a>] * </div>
|
[<a class="nav" href="#links">Links</a>] * </div>
|
||||||
<P class="Sub">Home of the <i>Electronic Logbook</i> package by <a href="mailto:Stefan.Ritt@psi.ch">
|
<P class="Sub">Home of the <i>Electronic Logbook</i> package by <a href="mailto:Stefan.Ritt@psi.ch">
|
||||||
Stefan Ritt</a></P>
|
Stefan Ritt</a></P>
|
||||||
<div class="version">Current version is : 2.9.2</div>
|
<div class="version">Current version is : 3.0.0</div>
|
||||||
<center>
|
<center>
|
||||||
<a href="http://www.softpedia.com/progClean/ELOG-Clean-30897.html"><img border="0" src="http://www.softpedia.com/images/spyward/softpedia_free_award_f.gif" alt="certificate" title="certificate" /></a>
|
<a href="http://www.softpedia.com/progClean/ELOG-Clean-30897.html"><img border="0" src="http://www.softpedia.com/images/spyward/softpedia_free_award_f.gif" alt="certificate" title="certificate" /></a>
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
[<a class="nav" href="#links">Links</a>] * </div>
|
[<a class="nav" href="#links">Links</a>] * </div>
|
||||||
<P class="Sub">Home of the <i>Electronic Logbook</i> package by <a href="mailto:Stefan.Ritt@psi.ch">
|
<P class="Sub">Home of the <i>Electronic Logbook</i> package by <a href="mailto:Stefan.Ritt@psi.ch">
|
||||||
Stefan Ritt</a></P>
|
Stefan Ritt</a></P>
|
||||||
<div class="version">Current version is : 2.9.2</div>
|
<div class="version">Current version is : 3.0.0</div>
|
||||||
<center>
|
<center>
|
||||||
<a href="http://www.softpedia.com/progClean/ELOG-Clean-30897.html"><img border="0" src="http://www.softpedia.com/images/spyward/softpedia_free_award_f.gif" alt="certificate" title="certificate" /></a>
|
<a href="http://www.softpedia.com/progClean/ELOG-Clean-30897.html"><img border="0" src="http://www.softpedia.com/images/spyward/softpedia_free_award_f.gif" alt="certificate" title="certificate" /></a>
|
||||||
</center>
|
</center>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# German translation by stefan.ritt@psi.ch
|
# German translation by stefan.ritt@psi.ch
|
||||||
# A more recent version may be available at :
|
# A more recent version may be available at:
|
||||||
# http://savannah.psi.ch/viewcvs/trunk/resources/eloglang.german?root=elog
|
# https://bitbucket.org/ritt/elog
|
||||||
#
|
#
|
||||||
|
|
||||||
New = Neu
|
New = Neu
|
||||||
@ -476,4 +476,3 @@ CSV (";" separated) + Text = CSV (mit ";" getreent) + Text
|
|||||||
Entry can only be deleted %1.2lg hours after creation = Eintrag kann nur %1.2lg Stunden nach dem Anlegen gelöscht werden
|
Entry can only be deleted %1.2lg hours after creation = Eintrag kann nur %1.2lg Stunden nach dem Anlegen gelöscht werden
|
||||||
Drop attachments here... = Anhänge bitte hier ablegen...
|
Drop attachments here... = Anhänge bitte hier ablegen...
|
||||||
Insert Timestamp = Aktuelle Zeit einfügen
|
Insert Timestamp = Aktuelle Zeit einfügen
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
153
src/elogd.c
153
src/elogd.c
@ -1768,6 +1768,36 @@ int setuser(char *str)
|
|||||||
|
|
||||||
/*-------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
int send_with_timeout(void *p, int sock, char *buf, int size)
|
||||||
|
{
|
||||||
|
int status;
|
||||||
|
time_t start, now;
|
||||||
|
|
||||||
|
time(&start);
|
||||||
|
|
||||||
|
do {
|
||||||
|
#ifdef HAVE_SSL
|
||||||
|
SSL *ssl = (SSL *)p;
|
||||||
|
if (ssl)
|
||||||
|
status = SSL_write(ssl, buf, size);
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
status = send(sock, buf, size, 0);
|
||||||
|
|
||||||
|
time(&now);
|
||||||
|
|
||||||
|
// abort after 10 seconds
|
||||||
|
if (now > start+10)
|
||||||
|
break;
|
||||||
|
|
||||||
|
// repeat if we were interrupted by alarm() signal
|
||||||
|
} while (status == -1 && errno == EINTR);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*-------------------------------------------------------------------*/
|
||||||
|
|
||||||
int recv_string(int sock, char *buffer, int buffer_size, int millisec)
|
int recv_string(int sock, char *buffer, int buffer_size, int millisec)
|
||||||
{
|
{
|
||||||
int i, n;
|
int i, n;
|
||||||
@ -2421,7 +2451,9 @@ int retrieve_url(LOGBOOK * lbs, const char *url, int ssl, char **buffer)
|
|||||||
fd_set readfds;
|
fd_set readfds;
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
#ifdef HAVE_SSL
|
#ifdef HAVE_SSL
|
||||||
static SSL *ssl_con;
|
static SSL *ssl_con = NULL;
|
||||||
|
#else
|
||||||
|
static void *ssl_con = NULL;
|
||||||
#endif
|
#endif
|
||||||
static int sock, last_port;
|
static int sock, last_port;
|
||||||
static char last_host[256];
|
static char last_host[256];
|
||||||
@ -2491,13 +2523,8 @@ int retrieve_url(LOGBOOK * lbs, const char *url, int ssl, char **buffer)
|
|||||||
|
|
||||||
strcat(str, "\r\n");
|
strcat(str, "\r\n");
|
||||||
|
|
||||||
#ifdef HAVE_SSL
|
send_with_timeout(ssl_con, sock, (char *)str, strlen(str));
|
||||||
if (ssl)
|
|
||||||
SSL_write(ssl_con, str, strlen(str));
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
send(sock, str, strlen(str), 0);
|
|
||||||
|
|
||||||
bufsize = TEXT_SIZE + 1000;
|
bufsize = TEXT_SIZE + 1000;
|
||||||
*buffer = xmalloc(bufsize);
|
*buffer = xmalloc(bufsize);
|
||||||
memset(*buffer, 0, bufsize);
|
memset(*buffer, 0, bufsize);
|
||||||
@ -6675,12 +6702,10 @@ void rsprintf(const char *format, ...)
|
|||||||
void flush_return_buffer()
|
void flush_return_buffer()
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SSL
|
#ifdef HAVE_SSL
|
||||||
if (_ssl_flag) {
|
send_with_timeout(_ssl_con, _sock, return_buffer, strlen_retbuf);
|
||||||
SSL_write(_ssl_con, return_buffer, strlen_retbuf);
|
#else
|
||||||
} else
|
send_with_timeout(NULL, _sock, return_buffer, strlen_retbuf);
|
||||||
#endif
|
#endif
|
||||||
send(_sock, return_buffer, strlen_retbuf, 0);
|
|
||||||
|
|
||||||
memset(return_buffer, 0, return_buffer_size);
|
memset(return_buffer, 0, return_buffer_size);
|
||||||
strlen_retbuf = 0;
|
strlen_retbuf = 0;
|
||||||
}
|
}
|
||||||
@ -15432,6 +15457,8 @@ int submit_message(LOGBOOK * lbs, char *host, int message_id, char *error_str)
|
|||||||
char *content, *p, boundary[80], request[10000], response[10000];
|
char *content, *p, boundary[80], request[10000], response[10000];
|
||||||
#ifdef HAVE_SSL
|
#ifdef HAVE_SSL
|
||||||
SSL *ssl_con = NULL;
|
SSL *ssl_con = NULL;
|
||||||
|
#else
|
||||||
|
void *ssl_con = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
text = (char *) xmalloc(TEXT_SIZE);
|
text = (char *) xmalloc(TEXT_SIZE);
|
||||||
@ -15593,29 +15620,19 @@ int submit_message(LOGBOOK * lbs, char *host, int message_id, char *error_str)
|
|||||||
|
|
||||||
header_length = strlen(request);
|
header_length = strlen(request);
|
||||||
|
|
||||||
|
send_with_timeout(ssl_con, sock, request, header_length);
|
||||||
|
send_with_timeout(ssl_con, sock, content, content_length);
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_SSL
|
#ifdef HAVE_SSL
|
||||||
if (ssl) {
|
if (ssl)
|
||||||
/* send request */
|
|
||||||
SSL_write(ssl_con, request, header_length);
|
|
||||||
|
|
||||||
/* send content */
|
|
||||||
SSL_write(ssl_con, content, content_length);
|
|
||||||
|
|
||||||
/* receive response */
|
/* receive response */
|
||||||
i = SSL_read(ssl_con, response, 10000);
|
i = SSL_read(ssl_con, response, 10000);
|
||||||
|
|
||||||
} else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
|
||||||
/* send request */
|
|
||||||
send(sock, request, header_length, 0);
|
|
||||||
|
|
||||||
/* send content */
|
|
||||||
send_tcp(sock, content, content_length, 0);
|
|
||||||
|
|
||||||
/* receive response */
|
/* receive response */
|
||||||
i = recv(sock, response, 10000, 0);
|
i = recv(sock, response, 10000, 0);
|
||||||
}
|
|
||||||
|
|
||||||
if (i < 0) {
|
if (i < 0) {
|
||||||
closesocket(sock);
|
closesocket(sock);
|
||||||
@ -15825,6 +15842,8 @@ void submit_config(LOGBOOK * lbs, char *server, char *buffer, char *error_str)
|
|||||||
char *content, *p, boundary[80], request[10000], response[10000];
|
char *content, *p, boundary[80], request[10000], response[10000];
|
||||||
#ifdef HAVE_SSL
|
#ifdef HAVE_SSL
|
||||||
SSL *ssl_con = NULL;
|
SSL *ssl_con = NULL;
|
||||||
|
#else
|
||||||
|
void *ssl_con = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
error_str[0] = 0;
|
error_str[0] = 0;
|
||||||
@ -15895,29 +15914,18 @@ void submit_config(LOGBOOK * lbs, char *server, char *buffer, char *error_str)
|
|||||||
|
|
||||||
header_length = strlen(request);
|
header_length = strlen(request);
|
||||||
|
|
||||||
|
send_with_timeout(ssl_con, sock, request, header_length);
|
||||||
|
send_with_timeout(ssl_con, sock, content, content_length);
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_SSL
|
#ifdef HAVE_SSL
|
||||||
if (ssl) {
|
if (ssl)
|
||||||
/* send request */
|
|
||||||
SSL_write(ssl_con, request, header_length);
|
|
||||||
|
|
||||||
/* send content */
|
|
||||||
SSL_write(ssl_con, content, content_length);
|
|
||||||
|
|
||||||
/* receive response */
|
/* receive response */
|
||||||
i = SSL_read(ssl_con, response, 10000);
|
i = SSL_read(ssl_con, response, 10000);
|
||||||
|
else
|
||||||
} else
|
|
||||||
#endif
|
#endif
|
||||||
{
|
|
||||||
/* send request */
|
|
||||||
send(sock, request, header_length, 0);
|
|
||||||
|
|
||||||
/* send content */
|
|
||||||
send_tcp(sock, content, content_length, 0);
|
|
||||||
|
|
||||||
/* receive response */
|
/* receive response */
|
||||||
i = recv(sock, response, 10000, 0);
|
i = recv(sock, response, 10000, 0);
|
||||||
}
|
|
||||||
|
|
||||||
if (i < 0) {
|
if (i < 0) {
|
||||||
closesocket(sock);
|
closesocket(sock);
|
||||||
@ -28652,6 +28660,12 @@ void send_return(int _sock, const char *net_buffer)
|
|||||||
int length, header_length;
|
int length, header_length;
|
||||||
char str[NAME_LENGTH];
|
char str[NAME_LENGTH];
|
||||||
char *p;
|
char *p;
|
||||||
|
#ifndef HAVE_SSL
|
||||||
|
void *ssl_con = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (!_ssl_flag)
|
||||||
|
ssl_con = NULL;
|
||||||
|
|
||||||
if (return_length != -1) {
|
if (return_length != -1) {
|
||||||
if (return_length == 0)
|
if (return_length == 0)
|
||||||
@ -28681,18 +28695,10 @@ void send_return(int _sock, const char *net_buffer)
|
|||||||
header_length = sizeof(header_buffer) - 100;
|
header_length = sizeof(header_buffer) - 100;
|
||||||
memcpy(header_buffer, return_buffer, header_length);
|
memcpy(header_buffer, return_buffer, header_length);
|
||||||
sprintf(header_buffer + header_length, "\r\nContent-Length: %d\r\n\r\n", length);
|
sprintf(header_buffer + header_length, "\r\nContent-Length: %d\r\n\r\n", length);
|
||||||
#ifdef HAVE_SSL
|
|
||||||
if (_ssl_flag) {
|
send_with_timeout(ssl_con, _sock, header_buffer, strlen(header_buffer));
|
||||||
SSL_write(ssl_con, header_buffer, strlen(header_buffer));
|
send_with_timeout(ssl_con, _sock, p + 4, length);
|
||||||
SSL_write(ssl_con, p + 4, length);
|
|
||||||
} else {
|
|
||||||
send(_sock, header_buffer, strlen(header_buffer), 0);
|
|
||||||
send(_sock, p + 4, length, 0);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
send(_sock, header_buffer, strlen(header_buffer), 0);
|
|
||||||
send(_sock, p + 4, length, 0);
|
|
||||||
#endif
|
|
||||||
if (get_verbose() < VERBOSE_DEBUG) {
|
if (get_verbose() < VERBOSE_DEBUG) {
|
||||||
if (get_verbose() > 0)
|
if (get_verbose() > 0)
|
||||||
eprintf("Returned %d bytes\n", length);
|
eprintf("Returned %d bytes\n", length);
|
||||||
@ -28727,27 +28733,14 @@ void send_return(int _sock, const char *net_buffer)
|
|||||||
memcpy(header_buffer, return_buffer, header_length);
|
memcpy(header_buffer, return_buffer, header_length);
|
||||||
sprintf(header_buffer + header_length, "\r\nConnection: Close\r\n\r\n");
|
sprintf(header_buffer + header_length, "\r\nConnection: Close\r\n\r\n");
|
||||||
}
|
}
|
||||||
#ifdef HAVE_SSL
|
|
||||||
if (_ssl_flag) {
|
send_with_timeout(ssl_con, _sock, header_buffer, strlen(header_buffer));
|
||||||
SSL_write(ssl_con, header_buffer, strlen(header_buffer));
|
send_with_timeout(ssl_con, _sock, p + 4, length);
|
||||||
SSL_write(ssl_con, p + 4, length);
|
|
||||||
} else {
|
|
||||||
send(_sock, header_buffer, strlen(header_buffer), 0);
|
|
||||||
send(_sock, p + 4, length, 0);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
send(_sock, header_buffer, strlen(header_buffer), 0);
|
|
||||||
send(_sock, p + 4, length, 0);
|
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
#ifdef HAVE_SSL
|
|
||||||
if (_ssl_flag)
|
send_with_timeout(ssl_con, _sock, return_buffer, return_length);
|
||||||
SSL_write(ssl_con, return_buffer, return_length);
|
|
||||||
else
|
|
||||||
send(_sock, return_buffer, return_length, 0);
|
|
||||||
#else
|
|
||||||
send(_sock, return_buffer, return_length, 0);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_verbose() < VERBOSE_DEBUG) {
|
if (get_verbose() < VERBOSE_DEBUG) {
|
||||||
@ -29327,7 +29320,9 @@ void server_loop(void)
|
|||||||
_ssl_con = NULL;
|
_ssl_con = NULL;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
|
_ssl_con = NULL;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* find new entry in socket table */
|
/* find new entry in socket table */
|
||||||
|
|||||||
@ -251,7 +251,7 @@
|
|||||||
GCC_DYNAMIC_NO_PIC = NO;
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
HAVE_SSL,
|
HAVE_SSL1,
|
||||||
HAVE_KRB5,
|
HAVE_KRB5,
|
||||||
DEBUG,
|
DEBUG,
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user