Skip to content

Commit 9c029ed

Browse files
author
Sebastiano Merlino
committed
Minor fix to Makefiles
1 parent 264f2f7 commit 9c029ed

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ AC_MSG_RESULT([$debugit])
130130

131131
if test x"$debugit" = x"yes"; then
132132
AC_DEFINE([DEBUG],[],[Debug Mode])
133-
AM_CXXFLAGS="$AM_CXXFLAGS -g -Wall -Werror -Wno-uninitialized -O0"
133+
AM_CXXFLAGS="$AM_CXXFLAGS -DDEBUG -g -Wall -Werror -Wno-uninitialized -O0"
134134
else
135135
AC_DEFINE([NDEBUG],[],[No-debug Mode])
136136
AM_CXXFLAGS="$AM_CXXFLAGS -O3"
@@ -312,7 +312,7 @@ if test x$guile = xtrue; then
312312
fi
313313

314314
AC_SUBST(LHT_LIBDEPS)
315-
AC_SUBST([AM_CXXFLAGS])
315+
AC_SUBST(AM_CXXFLAGS)
316316
AC_SUBST(CPPFLAGS)
317317
AC_SUBST(LIBS)
318318
AC_SUBST(LDFLAGS)

src/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ lib_LTLIBRARIES = libhttpserver.la
2222
libhttpserver_la_SOURCES = string_utilities.cpp Webserver.cpp HttpUtils.cpp HttpEndpoint.cpp HttpRequest.cpp HttpResponse.cpp HttpResource.cpp
2323
noinst_HEADERS = httpserver/string_utilities.hpp gettext.h
2424
nobase_include_HEADERS = httpserver.h httpserver/Webserver.hpp httpserver/HttpUtils.hpp httpserver/HttpEndpoint.hpp httpserver/HttpRequest.hpp httpserver/HttpResponse.hpp httpserver/HttpResource.hpp
25-
AM_CXXFLAGS = -fPIC -Wall
25+
AM_CXXFLAGS += -fPIC -Wall
2626
libhttpserver_la_LIBADD = -lmicrohttpd
2727
libhttpserver_la_LDFLAGS =
2828

src/Webserver.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,9 @@ int Webserver::answerToConnection(void* cls, MHD_Connection* connection,
530530
}
531531
if ( 0 != *upload_data_size)
532532
{
533+
#ifdef DEBUG
534+
cout << "Writing content: " << upload_data << endl;
535+
#endif
533536
mr->dhr->growContent(upload_data, *upload_data_size);
534537
*upload_data_size = 0;
535538
return MHD_YES;

test/Test.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <unistd.h>
55
#include <boost/thread.hpp>
66
#include <iostream>
7+
#include <fstream>
78
#include <stdio.h>
89
using namespace std;
910

@@ -28,13 +29,12 @@ HttpResponse Test::render_GET(const HttpRequest& r)
2829

2930
HttpResponse Test::render_POST(const HttpRequest& r)
3031
{
31-
cout << r.getContent() << endl;
32-
cout << "prova: " << r.getArg("prova") << endl;
33-
34-
string pp = r.getArg("prova");
32+
fstream filestr;
33+
filestr.open("test.txt", fstream::out | fstream::app);
34+
filestr << r.getContent() << endl;
35+
filestr.close();
3536
cout << "DOPO" << endl;
36-
37-
return HttpResponse(pp,200);
37+
return HttpResponse("OK",200);
3838
}
3939

4040
HttpResponse Test2::render_GET(const HttpRequest& r)

0 commit comments

Comments
 (0)