From 11d3cbfa0b94ca90ba4b55e71ca935385bb46639 Mon Sep 17 00:00:00 2001 From: Aleksander Czajczynski Date: Thu, 6 Apr 2017 12:07:24 +0200 Subject: [PATCH] 2017-04-06 12:05 UTC+0200 Aleksander Czajczynski (hb fki.pl) * contrib/hbtip/httpcli.prg ! fixed uploading binary files with TIPClientHTTP:PostMultiPart() Thanks to Alexandre Alencar, who informed about the bug, supplied example test code and suggested a patch. This commit simplifies patch given by Alexandre. * ChangeLog.txt % stripped spaces before EOLs --- ChangeLog.txt | 20 +++++++++++++++----- contrib/hbtip/httpcli.prg | 20 ++++++++------------ 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index c043e1b491..7e9df9b029 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,16 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2017-04-06 12:05 UTC+0200 Aleksander Czajczynski (hb fki.pl) + * contrib/hbtip/httpcli.prg + ! fixed uploading binary files with TIPClientHTTP:PostMultiPart() + Thanks to Alexandre Alencar, who informed about the bug, supplied + example test code and suggested a patch. This commit simplifies patch + given by Alexandre. + + * ChangeLog.txt + % stripped spaces before EOLs + 2017-03-29 19:50 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * src/compiler/hbgenerr.c * changed "with object" in last error message to upper cases @@ -789,8 +799,8 @@ win_serviceSetStatus(WIN_SERVICE_STOP_PENDING) ENDIF RETURN - If control function parameter is passed, service state will not be set - to running by default. This allows to abort service on startup. + If control function parameter is passed, service state will not be set + to running by default. This allows to abort service on startup. If service is started, service main function should set running status by calling win_serviceSetStatus(WIN_SERVICE_RUNNING) @@ -977,7 +987,7 @@ * contrib/rddsql/hbrddsql.h * contrib/rddsql/rddsql.hbc - contrib/rddsql/hbrddsql.ch - * definitions of SQL related RDDI_*, DBI_* constants moved from RDDSQL + * definitions of SQL related RDDI_*, DBI_* constants moved from RDDSQL to core code * include/dbinfo.ch * contrib/rddsql/sqlbase.c @@ -989,9 +999,9 @@ + RDDI_CONNECT, RDDI_DISCONNECT implemented. RDDINFO() can be used instead of RDD specific AdsConnect*() calls + other SQL related RDDINFO(), DBINFO() capabilities implemented - + DBUSEAREA() accepts prefixes "SQL:" and "TABLE:" to indicate if + + DBUSEAREA() accepts prefixes "SQL:" and "TABLE:" to indicate if given table name should be treated as SQL query or table file name. - If these prefixes are omitted, function parameter is treated as table + If these prefixes are omitted, function parameter is treated as table file name except in case it begins with "SELECT " (compatibility). 2016-07-18 20:32 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) diff --git a/contrib/hbtip/httpcli.prg b/contrib/hbtip/httpcli.prg index ab4354783e..56b55ff267 100644 --- a/contrib/hbtip/httpcli.prg +++ b/contrib/hbtip/httpcli.prg @@ -577,19 +577,15 @@ METHOD PostMultiPart( xPostData, cQuery ) CLASS TIPClientHTTP // hope this is not a big file.... nFile := FOpen( cFile ) /* TOFIX: Error checking on nFile. [vszakats] */ - nbuf := 8192 - nRead := nBuf - // cBuf := Space( nBuf ) - DO WHILE nRead == nBuf - // nRead := FRead( nFile, @cBuf, nBuf ) - cBuf := FReadStr( nFile, nBuf ) - nRead := hb_BLen( cBuf ) -#if 0 - IF nRead < nBuf - cBuf := PadR( cBuf, nRead ) + nBuf := 65536 + cBuf := Space( nBuf ) + DO WHILE ! hb_FEof( nFile ) + nRead := FRead( nFile, @cBuf, nBuf ) + IF nRead == nBuf + cData += cBuf + ELSE + cData += hb_BLeft( cBuf, nRead ) ENDIF -#endif - cData += cBuf ENDDO FClose( nFile ) cData += cCrlf